Index: tags/latest/LICENCE-fr.txt
===================================================================
--- tags/latest/LICENCE-fr.txt	(revision 209)
+++ tags/latest/LICENCE-fr.txt	(revision 209)
@@ -0,0 +1,529 @@
+
+Le framework de développement UTC/CNRS Heudiasyc Flair est distribué 
+sous les termes de la licence CECILL-C version 1.0.
+
+Copyright (c) UTC/CNRS Heudiasyc. All rights reserved.
+
+
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C
+
+
+    Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes préside à
+sa rédaction:
+
+    * d'une part, le respect des principes de diffusion des logiciels
+      libres: accès au code source, droits étendus conférés aux
+      utilisateurs,
+    * d'autre part, la désignation d'un droit applicable, le droit
+      français, auquel elle est conforme, tant au regard du droit de la
+      responsabilité civile que du droit de la propriété intellectuelle
+      et de la protection qu'il offre aux auteurs et titulaires des
+      droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL-C (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont:
+
+Commissariat à l'Energie Atomique - CEA, établissement public de
+recherche à caractère scientifique, technique et industriel, dont le
+siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, établissement
+public à caractère scientifique et technologique, dont le siège est
+situé 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, établissement public à caractère scientifique et technologique,
+dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+    Préambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conférer aux utilisateurs la liberté de modifier et de réutiliser le
+logiciel régi par cette licence.
+
+L'exercice de cette liberté est assorti d'une obligation de remettre à
+la disposition de la communauté les modifications apportées au code
+source du logiciel afin de contribuer à son évolution.
+
+L'accessibilité au code source et les droits de copie, de modification
+et de redistribution qui découlent de ce contrat ont pour contrepartie
+de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
+peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
+les concédants successifs qu'une responsabilité restreinte.
+
+A cet égard l'attention de l'utilisateur est attirée sur les risques
+associés au chargement, à l'utilisation, à la modification et/ou au
+développement et à la reproduction du logiciel par l'utilisateur étant
+donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+manipuler et qui le réserve donc à des développeurs ou des
+professionnels avertis possédant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invités à charger et tester
+l'adéquation du logiciel à leurs besoins dans des conditions permettant
+d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
+généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
+sécurité. Ce contrat peut être reproduit et diffusé librement, sous
+réserve de le conserver en l'état, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer à tout logiciel dont le
+titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+    Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: désigne le présent contrat de licence, ses éventuelles versions
+postérieures et annexes.
+
+Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas échéant sa documentation, dans leur état au moment de
+l'acceptation du Contrat par le Licencié.
+
+Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
+éventuellement de Code Objet et le cas échéant sa documentation, dans
+leur état au moment de leur première diffusion sous les termes du Contrat.
+
+Logiciel Modifié: désigne le Logiciel modifié par au moins une
+Contribution Intégrée.
+
+Code Source: désigne l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'accès est nécessaire en vue de
+modifier le Logiciel.
+
+Code Objet: désigne les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial.
+
+Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
+Contrat.
+
+Contributeur: désigne le Licencié auteur d'au moins une Contribution
+Intégrée.
+
+Concédant: désigne le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution Intégrée: désigne l'ensemble des modifications,
+corrections, traductions, adaptations et/ou nouvelles fonctionnalités
+intégrées dans le Code Source par tout Contributeur.
+
+Module Lié: désigne un ensemble de fichiers sources y compris leur
+documentation qui, sans modification du Code Source, permet de réaliser
+des fonctionnalités ou services supplémentaires à ceux fournis par le
+Logiciel.
+
+Logiciel Dérivé: désigne toute combinaison du Logiciel, modifié ou non,
+et d'un Module Lié.
+
+Parties: désigne collectivement le Licencié et le Concédant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+    Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Concédant au Licencié d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+définie ci-après à l'article 5 pour toute la durée de protection des droits
+portant sur ce Logiciel.
+
+
+    Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licencié des termes du Contrat est réputée
+acquise du fait du premier des faits suivants:
+
+    * (i) le chargement du Logiciel par tout moyen notamment par
+      téléchargement à partir d'un serveur distant ou par chargement à
+      partir d'un support physique;
+    * (ii) le premier exercice par le Licencié de l'un quelconque des
+      droits concédés par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux spécificités du Logiciel, à la restriction de garantie et à
+la limitation à un usage par des utilisateurs expérimentés a été mis à
+disposition du Licencié préalablement à son acceptation telle que
+définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
+connaissance.
+
+
+    Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+      4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur à la date de son acceptation par le Licencié
+telle que définie en 3.1.
+
+
+      4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la durée légale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+    Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Concédant concède au Licencié, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la durée du Contrat dans
+les conditions ci-après détaillées.
+
+Par ailleurs, si le Concédant détient ou venait à détenir un ou
+plusieurs brevets d'invention protégeant tout ou partie des
+fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
+opposer les éventuels droits conférés par ces brevets aux Licenciés
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
+faire reprendre les obligations du présent alinéa aux cessionnaires.
+
+
+      5.1 DROIT D'UTILISATION
+
+Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
+aux domaines d'application, étant ci-après précisé que cela comporte:
+
+   1. la reproduction permanente ou provisoire du Logiciel en tout ou
+      partie par tout moyen et sous toute forme.
+
+   2. le chargement, l'affichage, l'exécution, ou le stockage du
+      Logiciel sur tout support.
+
+   3. la possibilité d'en observer, d'en étudier, ou d'en tester le
+      fonctionnement afin de déterminer les idées et principes qui sont
+      à la base de n'importe quel élément de ce Logiciel; et ceci,
+      lorsque le Licencié effectue toute opération de chargement,
+      d'affichage, d'exécution, de transmission ou de stockage du
+      Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+      5.2 DROIT DE MODIFICATION
+
+Le droit de modification comporte le droit de traduire, d'adapter,
+d'arranger ou d'apporter toute autre modification au Logiciel et le
+droit de reproduire le logiciel en résultant. Il comprend en particulier
+le droit de créer un Logiciel Dérivé.
+
+Le Licencié est autorisé à apporter toute modification au Logiciel sous
+réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
+cette modification et la date de création de celle-ci.
+
+
+      5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le marché à titre
+onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
+
+Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
+non, à des tiers dans les conditions ci-après détaillées.
+
+
+        5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, à condition que cette
+distribution respecte les dispositions du Contrat dans leur totalité et
+soit accompagnée:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif à la restriction de garantie et de
+      responsabilité du Concédant telle que prévue aux articles 8
+      et 9,
+
+et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
+le Licencié permette un accès effectif au Code Source complet du
+Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
+étant entendu que le coût additionnel d'acquisition du Code Source ne
+devra pas excéder le simple coût de transfert des données.
+
+
+        5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licencié apporte une Contribution Intégrée au Logiciel, les
+conditions de distribution du Logiciel Modifié en résultant sont alors
+soumises à l'intégralité des dispositions du Contrat.
+
+Le Licencié est autorisé à distribuer le Logiciel Modifié sous forme de
+code source ou de code objet, à condition que cette distribution
+respecte les dispositions du Contrat dans leur totalité et soit
+accompagnée:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif à la restriction de garantie et de
+      responsabilité du Concédant telle que prévue aux articles 8
+      et 9,
+
+et que, dans le cas où seul le code objet du Logiciel Modifié est
+redistribué, le Licencié permette un accès effectif à son code source
+complet pendant au moins toute la durée de sa distribution du Logiciel
+Modifié, étant entendu que le coût additionnel d'acquisition du code
+source ne devra pas excéder le simple coût de transfert des données.
+
+
+        5.3.3 DISTRIBUTION DU LOGICIEL DERIVE
+
+Lorsque le Licencié crée un Logiciel Dérivé, ce Logiciel Dérivé peut
+être distribué sous un contrat de licence autre que le présent Contrat à
+condition de respecter les obligations de mention des droits sur le
+Logiciel telles que définies à l'article 6.4. Dans le cas où la création du
+Logiciel Dérivé a nécessité une modification du Code Source le licencié
+s'engage à ce que: 
+
+   1. le Logiciel Modifié correspondant à cette modification soit régi
+      par le présent Contrat,
+   2. les Contributions Intégrées dont le Logiciel Modifié résulte
+      soient clairement identifiées et documentées,
+   3. le Licencié permette un accès effectif au code source du Logiciel
+      Modifié, pendant au moins toute la durée de la distribution du
+      Logiciel Dérivé, de telle sorte que ces modifications puissent
+      être reprises dans une version ultérieure du Logiciel, étant
+      entendu que le coût additionnel d'acquisition du code source du
+      Logiciel Modifié ne devra pas excéder le simple coût du transfert
+      des données.
+
+
+        5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL
+
+Lorsqu'un Logiciel Modifié contient une Contribution Intégrée soumise au
+contrat de licence CeCILL, ou lorsqu'un Logiciel Dérivé contient un
+Module Lié soumis au contrat de licence CeCILL, les stipulations prévues
+au troisième item de l'article 6.4 sont facultatives.
+
+
+    Article 6 - PROPRIETE INTELLECTUELLE
+
+
+      6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la faculté de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
+par le Contrat et ce, pour la durée visée à l'article 4.2.
+
+
+      6.2 SUR LES CONTRIBUTIONS INTEGREES
+
+Le Licencié qui a développé une Contribution Intégrée est titulaire sur
+celle-ci des droits de propriété intellectuelle dans les conditions
+définies par la législation applicable.
+
+
+      6.3 SUR LES MODULES LIES
+
+Le Licencié qui a développé un Module Lié est titulaire sur celui-ci des
+droits de propriété intellectuelle dans les conditions définies par la
+législation applicable et reste libre du choix du contrat régissant sa
+diffusion dans les conditions définies à l'article 5.3.3.
+
+
+      6.4 MENTIONS DES DROITS
+
+Le Licencié s'engage expressément:
+
+   1. à ne pas supprimer ou modifier de quelque manière que ce soit les
+      mentions de propriété intellectuelle apposées sur le Logiciel;
+
+   2. à reproduire à l'identique lesdites mentions de propriété
+      intellectuelle sur les copies du Logiciel modifié ou non;
+
+   3. à faire en sorte que l'utilisation du Logiciel, ses mentions de
+      propriété intellectuelle et le fait qu'il est régi par le Contrat
+      soient indiqués dans un texte facilement accessible notamment
+      depuis l'interface de tout Logiciel Dérivé.
+
+Le Licencié s'engage à ne pas porter atteinte, directement ou
+indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
+l'égard de son personnel toutes les mesures nécessaires pour assurer le
+respect des dits droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+    Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Concédant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors déterminés dans un acte séparé. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilité du Concédant qui les propose.
+
+7.2 De même, tout Concédant est libre de proposer, sous sa seule
+responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalités
+financières de son application feront l'objet d'un acte séparé entre le
+Concédant et le Licencié.
+
+
+    Article 8 - RESPONSABILITE
+
+8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la 
+faculté, sous réserve de prouver la faute du Concédant concerné, de
+solliciter la réparation du préjudice direct qu'il subirait du fait du
+Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilité du Concédant est limitée aux engagements pris en
+application du Contrat et ne saurait être engagée en raison notamment:
+(i) des dommages dus à l'inexécution, totale ou partielle, de ses
+obligations par le Licencié, (ii) des dommages directs ou indirects
+découlant de l'utilisation ou des performances du Logiciel subis par le
+Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent expressément que tout préjudice
+financier ou commercial (par exemple perte de données, perte de
+bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
+manque à gagner, trouble commercial quelconque) ou toute action dirigée
+contre le Licencié par un tiers, constitue un dommage indirect et
+n'ouvre pas droit à réparation par le Concédant.
+
+
+    Article 9 - GARANTIE
+
+9.1 Le Licencié reconnaît que l'état actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en vérifier toutes les
+utilisations ni de détecter l'existence d'éventuels défauts. L'attention
+du Licencié a été attirée sur ce point sur les risques associés au
+chargement, à l'utilisation, la modification et/ou au développement et à
+la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
+
+Il relève de la responsabilité du Licencié de contrôler, par tous
+moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Concédant déclare de bonne foi être en droit de concéder
+l'ensemble des droits attachés au Logiciel (comprenant notamment les
+droits visés à l'article 5).
+
+9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
+Concédant sans autre garantie, expresse ou tacite, que celle prévue à
+l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
+son caractère sécurisé, innovant ou pertinent.
+
+En particulier, le Concédant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'équipement du Licencié et sa configuration logicielle ni qu'il
+remplira les besoins du Licencié.
+
+9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
+Logiciel ne porte pas atteinte à un quelconque droit de propriété
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
+profit du Licencié contre les actions en contrefaçon qui pourraient être
+diligentées au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. Néanmoins, si de telles actions sont
+exercées contre le Licencié, le Concédant lui apportera son aide
+technique et juridique pour sa défense. Cette aide technique et
+juridique est déterminée au cas par cas entre le Concédant concerné et
+le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
+toute responsabilité quant à l'utilisation de la dénomination du
+Logiciel par le Licencié. Aucune garantie n'est apportée quant à
+l'existence de droits antérieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+    Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licencié aux obligations mises à sa
+charge par le Contrat, le Concédant pourra résilier de plein droit le
+Contrat trente (30) jours après notification adressée au Licencié et
+restée sans effet.
+
+10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura concédées antérieurement à la résiliation du Contrat
+resteront valides sous réserve qu'elles aient été effectuées en
+conformité avec le Contrat.
+
+
+    Article 11 - DISPOSITIONS DIVERSES
+
+
+      11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
+d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
+fortuit ou une cause extérieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du réseau électrique ou de
+télécommunication, la paralysie du réseau liée à une attaque
+informatique, l'intervention des autorités gouvernementales, les
+catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
+le feu, les explosions, les grèves et les conflits sociaux, l'état de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+intéressée à s'en prévaloir ultérieurement.
+
+11.3 Le Contrat annule et remplace toute convention antérieure, écrite
+ou orale, entre les Parties sur le même objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
+d'être faite par écrit et signée par leurs représentants dûment habilités.
+
+11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
+s'avèrerait contraire à une loi ou à un texte applicable, existants ou
+futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
+amendements nécessaires pour se conformer à cette loi ou à ce texte.
+Toutes les autres dispositions resteront en vigueur. De même, la
+nullité, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
+
+
+      11.5 LANGUE
+
+Le Contrat est rédigé en langue française et en langue anglaise, ces
+deux versions faisant également foi.
+
+
+    Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autorisée à copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
+et ne peut être modifié que par les auteurs de la licence, lesquels se
+réservent le droit de publier périodiquement des mises à jour ou de
+nouvelles versions du Contrat, qui posséderont chacune un numéro
+distinct. Ces versions ultérieures seront susceptibles de prendre en
+compte de nouvelles problématiques rencontrées par les logiciels libres.
+
+12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
+faire l'objet d'une diffusion ultérieure que sous la même version du
+Contrat ou une version postérieure.
+
+
+    Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est régi par la loi française. Les Parties conviennent
+de tenter de régler à l'amiable les différends ou litiges qui
+viendraient à se produire par suite ou à l'occasion du Contrat.
+
+13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
+de leur survenance et sauf situation relevant d'une procédure d'urgence,
+les différends ou litiges seront portés par la Partie la plus diligente
+devant les Tribunaux compétents de Paris.
+
+
+Version 1.0 du 2006-09-05.
+
Index: tags/latest/LICENSE.txt
===================================================================
--- tags/latest/LICENSE.txt	(revision 209)
+++ tags/latest/LICENSE.txt	(revision 209)
@@ -0,0 +1,561 @@
+
+UTC/CNRS Heudiasyc Flair framework is distributed under the CECILL-C 
+License, Version 1.0.
+
+Copyright (c) UTC/CNRS Heudiasyc. All rights reserved.
+
+
+
+CeCILL-C FREE SOFTWARE LICENSE AGREEMENT
+
+
+    Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+    * firstly, compliance with the principles governing the distribution
+      of Free Software: access to source code, broad rights granted to
+      users,
+    * secondly, the election of a governing law, French law, with which
+      it is conformant, both as regards the law of torts and
+      intellectual property law, and the protection that it offers to
+      both authors and holders of the economic rights over software.
+
+The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial research establishment, having its principal place of
+business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+    Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and re-use the software governed by this license.
+
+The exercising of this right is conditional upon the obligation to make
+available to the community the modifications made to the source code of
+the software so as to contribute to its evolution.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+suitability of the software as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+    Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Integrated Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Integrated
+Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Integrated Contribution: means any or all modifications, corrections,
+translations, adaptations and/or new functions integrated into the
+Source Code by any or all Contributors.
+
+Related Module: means a set of sources files including their
+documentation that, without modification to the Source Code, enables
+supplementary functions or services in addition to those offered by the
+Software.
+
+Derivative Software: means any combination of the Software, modified or
+not, and of a Related Module.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+    Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the
+protection granted by the rights over said Software. 
+
+
+    Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+    * (i) loading the Software by any or all means, notably, by
+      downloading from a remote server, or by loading from a physical
+      medium;
+    * (ii) the first time the Licensee exercises any of the rights
+      granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and
+understood it.
+
+
+    Article 4 - EFFECTIVE DATE AND TERM
+
+
+      4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+      4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+    Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+      5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+   1. permanent or temporary reproduction of all or part of the Software
+      by any or all means and in any or all form.
+
+   2. loading, displaying, running, or storing the Software on any or
+      all medium.
+
+   3. entitlement to observe, study or test its operation so as to
+      determine the ideas and principles behind any or all constituent
+      elements of said Software. This shall apply when the Licensee
+      carries out any or all loading, displaying, running, transmission
+      or storage operation as regards the Software, that it is entitled
+      to carry out hereunder.
+
+
+      5.2 RIGHT OF MODIFICATION
+
+The right of modification includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting software. It includes, in particular, the
+right to create a Derivative Software.
+
+The Licensee is authorized to make any or all modification to the
+Software provided that it includes an explicit notice that it is the
+author of said modification and indicates the date of the creation thereof.
+
+
+      5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows effective access to the full Source
+Code of the Software at a minimum during the entire period of its
+distribution of the Software, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes an Integrated Contribution to the Software, the
+terms and conditions for the distribution of the resulting Modified
+Software become subject to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+source code or object code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the object code of the Modified
+Software is redistributed, the Licensee allows effective access to the
+full source code of the Modified Software at a minimum during the entire
+period of its distribution of the Modified Software, it being understood
+that the additional cost of acquiring the source code shall not exceed
+the cost of transferring the data.
+
+
+        5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE
+
+When the Licensee creates Derivative Software, this Derivative Software
+may be distributed under a license agreement other than this Agreement,
+subject to compliance with the requirement to include a notice
+concerning the rights over the Software as defined in Article 6.4.
+In the event the creation of the Derivative Software required modification 
+of the Source Code, the Licensee undertakes that:
+
+   1. the resulting Modified Software will be governed by this Agreement,
+   2. the Integrated Contributions in the resulting Modified Software
+      will be clearly identified and documented,
+   3. the Licensee will allow effective access to the source code of the
+      Modified Software, at a minimum during the entire period of
+      distribution of the Derivative Software, such that such
+      modifications may be carried over in a subsequent version of the
+      Software; it being understood that the additional cost of
+      purchasing the source code of the Modified Software shall not
+      exceed the cost of transferring the data.
+
+
+        5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE
+
+When a Modified Software contains an Integrated Contribution subject to
+the CeCILL license agreement, or when a Derivative Software contains a
+Related Module subject to the CeCILL license agreement, the provisions
+set forth in the third item of Article 6.4 are optional.
+
+
+    Article 6 - INTELLECTUAL PROPERTY
+
+
+      6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by this Agreement, for the duration set forth in Article 4.2.
+
+
+      6.2 OVER THE INTEGRATED CONTRIBUTIONS
+
+The Licensee who develops an Integrated Contribution is the owner of the
+intellectual property rights over this Contribution as defined by
+applicable law.
+
+
+      6.3 OVER THE RELATED MODULES
+
+The Licensee who develops a Related Module is the owner of the
+intellectual property rights over this Related Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution under the conditions defined in Article 5.3.3.
+
+
+      6.4 NOTICE OF RIGHTS
+
+The Licensee expressly undertakes:
+
+   1. not to remove, or modify, in any manner, the intellectual property
+      notices attached to the Software;
+
+   2. to reproduce said notices, in an identical manner, in the copies
+      of the Software modified or not;
+
+   3. to ensure that use of the Software, its intellectual property
+      notices and the fact that it is governed by the Agreement is
+      indicated in a text that is easily accessible, specifically from
+      the interface of any Derivative Software.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-à-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+    Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+    Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+    Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the suitability of the product for its requirements, its good working
+order, and for ensuring that it shall not cause damage to either persons
+or properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+    Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+    Article 11 - MISCELLANEOUS
+
+
+      11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+      11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+    Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version.
+
+
+    Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 1.0 dated 2006-09-05.
+
+
+LICENSE
+
+1. By using and/or opening any packaging enclosing this 
+software, expanding any compressed file containing this 
+software or by utilizing this software, you agree to be 
+bound by the terms of this license agreement.
+
+2. THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY 
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+PURPOSE AND NONINFRINGEMENT. No oral or written advice given 
+by Licensor or by an authorized representative of Licensor 
+shall create a warranty.
+
+3. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL 
+THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, INCLUDING BUT NOT LIMITED TO PERSONAL INJURY, OR 
+ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES 
+WHATSOEVER, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS 
+OF PROFITS, LOSS OF DATA, BUSINESS INTERRUPTION OR ANY OTHER 
+COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO 
+YOUR USE OR INABILITY TO USE THE SOFTWARE, HOWEVER CAUSED, 
+REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT OR 
+OTHERWISE) AND EVEN IF LICENSOR HAS BEEN ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGES.
+
+4. THIS SOFTWARE IS NOT INTENDED FOR USE IN ANY APPLICATION 
+IN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH, 
+PERSONAL INJURY OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.
+
+5. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED 
+WARRANTIES, LIABILITY OR LIMITATIONS ON APPLICABLE STATUTORY 
+RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSIONS AND 
+LIMITATIONS MAY NOT APPLY TO YOU. IF SUCH EXCLUSIONS FROM 
+LIABILITY APPLY TO YOU, DO NOT USE THIS SOFTWARE.
Index: tags/latest/ReleaseNotes
===================================================================
--- tags/latest/ReleaseNotes	(revision 209)
+++ tags/latest/ReleaseNotes	(revision 209)
@@ -0,0 +1,40 @@
+* Actual Version:
+
+- added GPS to the UAVs, add "use_gps=true" to the UAV creation (see demos/Gps/uav/src/main.cpp)
+- corrected bug: FrameworkManager::SetupConnection now really uses the timeout parameter
+- added RotationType_t to OneAxisRotation constructor. It should handle pre and post rotation (frame changes and embdedd sensor rotation). Still need to be heavily tested and maybe rewritten
+- Gx3_25_imu: quaternion are better handled (no more discontinuities)
+- added logs of imu among logs of ahrs
+
+-----------------------------------------------------------
+* Tag 0.1.0:
+
+- added GSA nmea sentence
+- resolved https://devel.hds.utc.fr/software/flair/ticket/18
+- Vector2D and Vector3D are now templates. Replace all Vector2D to Vector2Df and Vector3D to Vector3Df to keep compatibility.
+- resolved https://devel.hds.utc.fr/software/flair/ticket/17
+- resolved https://devel.hds.utc.fr/software/flair/ticket/16
+- added lib/FlairCore/src/Semaphore.cpp
+- added fixed cameras in simulator, see $FLAIR_ROOT/flair-bin/models/indoor_fligh
+t_arena.xml for an exemple
+- added lib/FlairVisionFilter: some basic vision algorithms using opencv. Note that this lib can be remplaced by HdsVisionFilter if you have access to it, in order to use the DSP in HDS UAV's.
+See also https://devel.hds.utc.fr/software/flair/wiki/hds_users
+- added demos/OpticalFlow: stabilization using optical flow (vertical camera)
+- resolved https://devel.hds.utc.fr/software/flair/ticket/8
+- Uav class is now a singleton
+- VrpnClient class is now a singleton
+- VrpnObject no longer outputs Euler (only Quaternion): warning, output matrix has changed!
+
+-----------------------------------------------------------
+* Tag 0.0.2:
+
+- src/SensorActuator: quaternion support for 3dmgx3
+- tool/FlairGCS: added rx rate display
+- demos/SimpleFleet: new demo, 2 UAVs coordination
+- src/FlairSimulator: added fixed camera
+
+-----------------------------------------------------------
+* Tag 0.0.1:
+
+-original commit
+
Index: tags/latest/Version
===================================================================
--- tags/latest/Version	(revision 209)
+++ tags/latest/Version	(revision 209)
@@ -0,0 +1,1 @@
+flair-src 0.1.2
Index: tags/latest/demos/CircleFollower/simulator/CMakeLists.txt
===================================================================
--- tags/latest/demos/CircleFollower/simulator/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,31 @@
+PROJECT(CircleFollower_simulator)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_SIMULATOR TRUE)
+SET(FLAIR_USE_SIMULATOR_GL TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/CircleFollower/simulator/build
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/CircleFollower/simulator/build_arm/bin/reglages.xml
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build_arm/bin/reglages.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build_arm/bin/reglages.xml	(revision 209)
@@ -0,0 +1,243 @@
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+ <Tab name="simu">
+  <TabWidget name="simu">
+   <Tab name="Reglages">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+    <DoubleSpinBox value="1" name="masse (kg):"/>
+    <DoubleSpinBox value="0.2" name="bras (m):"/>
+    <DoubleSpinBox value="0.05" name="k_driver:"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.01" name="c_mot:"/>
+    <DoubleSpinBox value="0.05" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.5" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <PushButton value="0" name="reset"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="x4">
+  <PushButton value="0" name="kill"/>
+  <PushButton value="0" name="start_log"/>
+  <PushButton value="0" name="stop_log"/>
+  <PushButton value="0" name="take_off"/>
+  <PushButton value="0" name="landing"/>
+ </Tab>
+ <Tab name="SRF08">
+  <TabWidget name="SRF08">
+   <Tab name="Reglages">
+    <GroupBox name="SRF08">
+     <SpinBox value="8" name="gain:"/>
+     <SpinBox value="46" name="range:"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="Passe bas">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="1" name="fc (Hz):"/>
+     </GroupBox>
+     <GroupBox name="Passe bas v">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="1" name="fc (Hz):"/>
+     </GroupBox>
+     <GroupBox name="Vz">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     </GroupBox>
+     <GroupBox name="alt cons">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="0.4" name="velocity max (absolute):"/>
+      <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+     </GroupBox>
+     <GroupBox name="decollage">
+      <DoubleSpinBox value="1.1" name="alt decollage (m):"/>
+      <DoubleSpinBox value="0" name="alt atterissage (m):"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="z">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="vz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="3dmgx3">
+  <TabWidget name="3dmgx3">
+   <Tab name="Reglages">
+    <GroupBox name="3dmgx3">
+     <PushButton value="0" name="gyros bias"/>
+     <SpinBox value="100" name="data rate (Hz):"/>
+     <SpinBox value="1" name="gyro and acc filter win size:"/>
+     <SpinBox value="1" name="mag filter win size:"/>
+     <SpinBox value="1" name="up compensation (s):"/>
+     <SpinBox value="1" name="north compensation (s):"/>
+     <CheckBox value="true" name="enable Coning&amp;Sculling:"/>
+     <CheckBox value="true" name="disable magnetometer:"/>
+     <CheckBox value="true" name="disable magnetic north compensation:"/>
+     <CheckBox value="true" name="disable gravity compensation:"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="valeur (degre):"/>
+     <ComboBox value="0" name="axe:"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="droll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="dpitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="dyaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="loi de commande">
+  <TabWidget name="loi">
+   <Tab name="Reglages">
+    <GroupBox name="uroll">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="1e+06" name="ki:"/>
+     <DoubleSpinBox value="50000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="upitch">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="1e+06" name="ki:"/>
+     <DoubleSpinBox value="50000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="uyaw">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="20000" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="5000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="ugaz">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="100000" name="ki:"/>
+     <DoubleSpinBox value="200000" name="kd:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot name="uroll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="upitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="uyaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="ugaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="ps3eye">
+  <TabWidget name="ps3eye">
+   <Tab name="Reglages">
+    <GroupBox name="ps3eye">
+     <DoubleSpinBox value="0" name="gain:"/>
+     <DoubleSpinBox value="0" name="exposure:"/>
+     <DoubleSpinBox value="0" name="bright:"/>
+     <DoubleSpinBox value="0" name="contrast:"/>
+     <DoubleSpinBox value="0" name="hue:"/>
+     <DoubleSpinBox value="0" name="sharpness:"/>
+     <CheckBox value="true" name="autogain:"/>
+     <CheckBox value="true" name="awb:"/>
+     <Picture name="image source">
+      <Setup period="200" enabled="0"/>
+     </Picture>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="flux optique">
+    <DataPlot name="vx">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="vy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="moteurs">
+  <TabWidget name="moteurs">
+   <Tab name="Reglages">
+    <GroupBox name="moteurs">
+     <SpinBox value="0" name="min:"/>
+     <SpinBox value="2000" name="max:"/>
+     <SpinBox value="0" name="test value:"/>
+     <SpinBox value="950" name="valeur demarrage:"/>
+     <DoubleSpinBox value="0.1" name="pas decollage:"/>
+     <ComboBox value="0" name="avant gauche:"/>
+     <PushButton value="0" name="test avg"/>
+     <ComboBox value="1" name="avant droite:"/>
+     <PushButton value="0" name="test avd"/>
+     <ComboBox value="2" name="arriere gauche:"/>
+     <PushButton value="0" name="test arg"/>
+     <ComboBox value="3" name="arriere droite:"/>
+     <PushButton value="0" name="test ard"/>
+     <ComboBox value="0" name="pas helice avant gauche:"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="20" name="debattement roll (deg)"/>
+     <DoubleSpinBox value="20" name="debattement pitch (deg)"/>
+     <DoubleSpinBox value="90" name="debattement dyaw (deg/s)"/>
+     <DoubleSpinBox value="0.7" name="debattement dz (m/s)"/>
+     <SpinBox value="10" name="trim:"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</root>
Index: tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x4_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-3.5" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.5" value_y="0" value_z="-1"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.2" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.0400000000000000"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+   <Tab name="front camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="-1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="1.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="up" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="target">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.02" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="1" name="y:"/>
+    <DoubleSpinBox value="0" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.5" value_y="1" value_z="0"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
+    <DoubleSpinBox value="60" name="rotational speed (deg/s):"/>
+   </Tab>
+  </TabWidget>
+</Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x8_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-1.2" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.50" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.6" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0" name="position G (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+    <DoubleSpinBox value="0" name="j_r:"/>
+    <DoubleSpinBox value="0.72" name="sigma:"/>
+    <DoubleSpinBox value="1" name="S:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+   <Tab name="front camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="-1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="1.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="up" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="target">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.02" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="0" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="0" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.50" value_y="1.00" value_z="0.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
+    <DoubleSpinBox value="60" name="rotational speed (deg/s):"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x4.sh
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./CircleFollower_simulator_rt
+else
+	EXEC=./CircleFollower_simulator_nrt
+fi
+
+$EXEC -n x4_0 -t x4 -p 9000 -a 127.0.0.1 -x setup_x4.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x8.sh
===================================================================
--- tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./CircleFollower_simulator_rt
+else
+	EXEC=./CircleFollower_simulator_nrt
+fi
+
+$EXEC -n x8_0 -t x8 -p 9000 -a 127.0.0.1 -x setup_x8.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/CircleFollower/simulator/src/main.cpp
===================================================================
--- tags/latest/demos/CircleFollower/simulator/src/main.cpp	(revision 209)
+++ tags/latest/demos/CircleFollower/simulator/src/main.cpp	(revision 209)
@@ -0,0 +1,128 @@
+//  created:    2012/04/18
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main simulateur
+//
+//
+/*********************************************************************/
+
+#include <tclap/CmdLine.h>
+#include <Simulator.h>
+#include <X4.h>
+#include <X8.h>
+#include <SimuImu.h>
+#ifdef GL
+#include <Parser.h>
+#include <Man.h>
+#include <SimuUsGL.h>
+#endif
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::simulator;
+using namespace flair::sensor;
+
+int port;
+int opti_time;
+string xml_file;
+string media_path;
+string scene_file;
+string type;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv)
+{
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> nameArg("n", "name", "uav name, also used for vrpn", true, "x4", "string");
+    cmd.add(nameArg);
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./reglages.xml", "string");
+    cmd.add(xmlArg);
+
+    ValueArg<int> portArg("p", "port", "ground station port", true, 9002, "int");
+    cmd.add(portArg);
+
+    ValueArg<string> addressArg("a", "address", "ground station address", true, "127.0.0.1", "string");
+    cmd.add(addressArg);
+
+    ValueArg<string> typeArg("t", "type", "uav type, x4 or x8", true, "x4", "string");
+    cmd.add(typeArg);
+
+    ValueArg<int> optiArg("o", "opti", "optitrack time ms", false, 0, "int");
+    cmd.add(optiArg);
+
+#ifdef GL
+    ValueArg<string> mediaArg("m", "media", "path to media files", true, "./", "string");
+    cmd.add(mediaArg);
+
+    ValueArg<string> sceneArg("s", "scene", "path to scene file", true, "./voliere.xml", "string");
+    cmd.add(sceneArg);
+#endif
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    port = portArg.getValue();
+    xml_file = xmlArg.getValue();
+    opti_time = optiArg.getValue();
+    type = typeArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
+#ifdef GL
+    media_path = mediaArg.getValue();
+    scene_file = sceneArg.getValue();
+#endif
+
+  } catch(ArgException& e) {
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
+
+int main(int argc, char* argv[])
+{
+  Simulator* simu;
+  Model* drone;
+  SimuImu* imu;
+#ifdef GL
+  SimuUsGL* us_gl;
+  Parser* gui;
+  Man* man;
+#endif
+  parseOptions(argc, argv);
+
+  simu = new Simulator("simulator", opti_time, 90);
+  simu->SetupConnection(address, port);
+  simu->SetupUserInterface(xml_file);
+
+#ifdef GL
+  gui = new Parser(1024, 768, 1024, 768, media_path, scene_file);
+#endif
+
+  if(type == "x4") {
+    drone = new X4(name, 0);
+  } else {
+    drone = new X8(name, 0);
+  }
+
+  imu = new SimuImu(drone, "imu", 0,0);
+
+#ifdef GL
+  us_gl = new SimuUsGL(drone, "us", 0,0);
+
+  man = new Man("target",1);
+#endif
+
+  simu->RunSimu();
+
+  delete simu;
+
+  return 0;
+}
Index: tags/latest/demos/CircleFollower/uav/CMakeLists.txt
===================================================================
--- tags/latest/demos/CircleFollower/uav/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/CMakeLists.txt	(revision 209)
@@ -0,0 +1,35 @@
+PROJECT(CircleFollower)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+SET(FLAIR_USE_VRPN TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/CircleFollower.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/CircleFollower/uav/build
===================================================================
--- tags/latest/demos/CircleFollower/uav/build	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.sh
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.sh	(revision 209)
@@ -0,0 +1,1 @@
+./CircleFollower_nrt -a 192.168.147.193 -p 9000 -l /tmp -x CircleFollower_ardrone2.xml -n Drone_0 -t ardrone2
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.xml
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_ardrone2.xml	(revision 209)
@@ -0,0 +1,357 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="x4-multiplex">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="1" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-us">
+  <TabWidget name="parrot-us">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-us"/>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto"/>
+     <DoubleSpinBox value="10" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="1" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.8" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="0.8" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="parrot-us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-imu">
+  <TabWidget name="parrot-imu">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-imu"/>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <DoubleSpinBox value="0.5" name="k_a[0]:"/>
+    <DoubleSpinBox value="0.5" name="k_a[1]:"/>
+    <DoubleSpinBox value="0" name="k_a[2]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[0]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[1]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[2]:"/>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="IMU">
+    <DataPlot1D name="acc_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10.5" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="1" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="Drone_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Drone_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="R"/>
+     <DoubleSpinBox value="0.5" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures Drone_0">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) Drone_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="camv">
+  <TabWidget name="camv">
+   <Tab name="Setup">
+    <GroupBox name="camv">
+     <DoubleSpinBox value="0" name="gain:"/>
+     <DoubleSpinBox value="0" name="exposure:"/>
+     <DoubleSpinBox value="0" name="bright:"/>
+     <DoubleSpinBox value="0" name="contrast:"/>
+     <DoubleSpinBox value="0" name="hue:"/>
+     <DoubleSpinBox value="0" name="sharpness:"/>
+     <DoubleSpinBox value="0" name="saturation:"/>
+     <CheckBox value="1" name="autogain:"/>
+     <CheckBox value="1" name="autoexposure:"/>
+     <CheckBox value="1" name="awb:"/>
+    <Label name="fps"/></GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="1" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="1"/><DoubleSpinBox name="acceleration (absolute):" value="0.8"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.4" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.4" name="sat i:"/>
+     <DoubleSpinBox value="0.4" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-15" name="debattement roll"/>
+     <DoubleSpinBox value="-15" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.5" name="debattement dz"/>
+     <DoubleSpinBox value="0.02" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+<Tab name="predictor"><DataPlot1D name="u_pitch" period="100" enabled="1"/></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="Drone_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.sh
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.sh	(revision 209)
@@ -0,0 +1,1 @@
+./CircleFollower_nrt -a 192.168.42.24 -p 9000 -l /tmp -x CircleFollower_bebop.xml -n Drone_0 -t bebop
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.xml
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_bebop.xml	(revision 209)
@@ -0,0 +1,268 @@
+<?xml version="1.0"?>
+<root name="FrameworkManager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="x4-multiplex">
+      <TabWidget name="UavMultiplex">
+        <Tab name="Setup">
+          <GroupBox name="x4 multiplex">
+            <ComboBox name="front left blade pitch:" value="0"/>
+          </GroupBox>
+          <GroupBox name="motor attribution">
+            <ComboBox name="front left" value="0"/>
+            <ComboBox name="front rigth" value="1"/>
+            <ComboBox name="rear left" value="3"/>
+            <ComboBox name="rear rigth" value="2"/>
+          </GroupBox>
+          <GroupBox name="bldc">
+            <Label name="flight time"/>
+            <DoubleSpinBox name="min value:" value="0"/>
+            <DoubleSpinBox name="max value:" value="1"/>
+            <DoubleSpinBox name="test value:" value="0.4"/>
+            <PushButton name="test motor 0"/>
+            <PushButton name="test motor 1"/>
+            <PushButton name="test motor 2"/>
+            <PushButton name="test motor 3"/>
+          </GroupBox>
+          <GroupBox name="battery">
+            <Label name="battery"/>
+            <DoubleSpinBox name="threshold" value="10.5"/>
+            <SpinBox name="threshold time" value="10"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Values">
+          <DataPlot1D name="front left" period="100" enabled="0"/>
+          <DataPlot1D name="front right" period="100" enabled="0"/>
+          <DataPlot1D name="rear left" period="100" enabled="0"/>
+          <DataPlot1D name="rear right" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="Speeds">
+          <DataPlot1D name="front left" period="100" enabled="0"/>
+          <DataPlot1D name="front right" period="100" enabled="0"/>
+          <DataPlot1D name="rear left" period="100" enabled="0"/>
+          <DataPlot1D name="rear right" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="bebop-us">
+      <TabWidget name="bebop-us">
+        <Tab name="Reglages">
+          <GroupBox name="bebop-us"/>
+          <GroupBox name="Passe bas">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="5"/>
+          </GroupBox>
+          <GroupBox name="Vz">
+            <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+          </GroupBox>
+          <GroupBox name="Passe bas v">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="5"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Mesures">
+          <DataPlot1D name="bebop-us" period="100" enabled="1"/>
+          <DataPlot1D name="vz" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="bebop-imu">
+      <TabWidget name="bebop-imu">
+        <Tab name="Reglages">
+          <GroupBox name="bebop-imu"/>
+          <GroupBox name="post rotation">
+            <DoubleSpinBox name="value" value="180"/>
+            <ComboBox name="axis" value="0"/>
+          </GroupBox>
+          <DoubleSpinBox name="ka[0]:" value="0.5"/>
+          <DoubleSpinBox name="ka[1]:" value="0.5"/>
+          <DoubleSpinBox name="ka[2]:" value="0"/>
+          <DoubleSpinBox name="kb[0]:" value="0.01"/>
+          <DoubleSpinBox name="kb[1]:" value="0.01"/>
+          <DoubleSpinBox name="kb[2]:" value="0.01"/>
+        </Tab>
+        <Tab name="AHRS">
+          <DataPlot1D name="roll" period="100" enabled="1"/>
+          <DataPlot1D name="pitch" period="100" enabled="0"/>
+          <DataPlot1D name="yaw" period="100" enabled="0"/>
+          <DataPlot1D name="w_x" period="100" enabled="1"/>
+          <DataPlot1D name="w_y" period="100" enabled="0"/>
+          <DataPlot1D name="w_z" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="Quaternion">
+          <DataPlot1D name="q0" period="100" enabled="0"/>
+          <DataPlot1D name="q1" period="100" enabled="0"/>
+          <DataPlot1D name="q2" period="100" enabled="0"/>
+          <DataPlot1D name="q3" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="IMU">
+          <DataPlot1D name="acc_x" period="100" enabled="0"/>
+          <DataPlot1D name="acc_y" period="100" enabled="0"/>
+          <DataPlot1D name="acc_z" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_x" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_y" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_z" period="100" enabled="0"/>
+          <DataPlot1D name="mag_x" period="100" enabled="0"/>
+          <DataPlot1D name="mag_y" period="100" enabled="0"/>
+          <DataPlot1D name="mag_z" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="Dualshock3">
+      <TabWidget name="Dualshock3">
+        <Tab name="Reglages">
+          <GroupBox name="consignes joy">
+            <DoubleSpinBox name="debattement roll" value="-15"/>
+            <DoubleSpinBox name="debattement pitch" value="-15"/>
+            <DoubleSpinBox name="debattement wz" value="90"/>
+            <DoubleSpinBox name="debattement dz" value="-0.5"/>
+            <DoubleSpinBox name="trim" value="0.01"/>
+            <Label name="trim roll"/>
+            <PushButton name="reset roll trim"/>
+            <Label name="trim pitch"/>
+            <PushButton name="reset pitch trim"/>
+          </GroupBox>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="uav">
+      <GridLayout name="buttons">
+        <PushButton name="kill"/>
+        <PushButton name="start_log"/>
+        <PushButton name="stop_log"/>
+        <PushButton name="take_off"/>
+        <PushButton name="land"/>
+        <PushButton name="start_circle"/>
+        <PushButton name="stop_circle"/>
+        <PushButton name="position hold"/>
+      </GridLayout>
+      <GroupBox name="takeoff/landing">
+        <DoubleSpinBox name="desired takeoff altitude" value="0.5"/>
+        <DoubleSpinBox name="desired landing altitude" value="0"/>
+      </GroupBox>
+      <GroupBox name="alt cons">
+        <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+        <DoubleSpinBox name="velocity max (absolute):" value="1"/>
+        <DoubleSpinBox name="acceleration (absolute):" value="1"/>
+      </GroupBox>
+    </Tab>
+    <Tab name="control laws">
+      <TabWidget name="laws">
+        <Tab name="Setup">
+          <GroupBox name="u_roll">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="15.00"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.04"/>
+            <DoubleSpinBox name="sat u:" value="0.5"/>
+          </GroupBox>
+          <GroupBox name="u_pitch">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="15"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.05"/>
+            <DoubleSpinBox name="sat u:" value="0.5"/>
+          </GroupBox>
+          <GroupBox name="u_yaw">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.6"/>
+            <DoubleSpinBox name="ki:" value="0"/>
+            <DoubleSpinBox name="sat i:" value="0"/>
+            <DoubleSpinBox name="kd:" value="0.15"/>
+            <DoubleSpinBox name="sat:" value="0.5"/>
+          </GroupBox>
+          <GroupBox name="u_z">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.3"/>
+            <DoubleSpinBox name="ki:" value="0.2"/>
+            <DoubleSpinBox name="sat i:" value="0.4"/>
+            <DoubleSpinBox name="kd:" value="0.15"/>
+            <DoubleSpinBox name="offset g:" value="0.37"/>
+            <DoubleSpinBox name="sat:" value="1"/>
+            <DoubleSpinBox name="offset step:" value="0.0002"/>
+          </GroupBox>
+          <GroupBox name="u_x">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0"/>
+            <DoubleSpinBox name="ki:" value="0"/>
+            <DoubleSpinBox name="sat i:" value="0"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0"/>
+          </GroupBox>
+          <GroupBox name="u_y">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0"/>
+            <DoubleSpinBox name="ki:" value="0"/>
+            <DoubleSpinBox name="sat i:" value="0"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Graphes">
+          <DataPlot1D name="u_roll" period="100" enabled="0"/>
+          <DataPlot1D name="u_pitch" period="100" enabled="0"/>
+          <DataPlot1D name="u_yaw" period="100" enabled="0"/>
+          <DataPlot1D name="u_z" period="100" enabled="0"/>
+          <DataPlot1D name="u_x" period="100" enabled="0"/>
+          <DataPlot1D name="u_y" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="vrpn">
+      <TabWidget name="vrpn">
+        <Tab name="Reglages">
+          <GroupBox name="post rotation 1">
+            <DoubleSpinBox name="value" value="0"/>
+            <ComboBox name="axis" value="0"/>
+          </GroupBox>
+          <GroupBox name="post rotation 2">
+            <DoubleSpinBox name="value" value="0"/>
+            <ComboBox name="axis" value="0"/>
+          </GroupBox>
+          <GroupBox name="Drone_0 Passe bas">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="1"/>
+          </GroupBox>
+          <GroupBox name="Drone_0_euler">
+            <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+          </GroupBox>
+          <GroupBox name="target Passe bas">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="1"/>
+          </GroupBox>
+          <GroupBox name="target_euler">
+            <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+          </GroupBox>
+          <GroupBox name="circle">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="R" value="0"/>
+            <DoubleSpinBox name="velocity" value="0"/>
+            <DoubleSpinBox name="acceleration (absolute)" value="0"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Mesures Drone_0">
+          <DataPlot1D name="x" period="100" enabled="0"/>
+          <DataPlot1D name="y" period="100" enabled="0"/>
+          <DataPlot1D name="z" period="100" enabled="0"/>
+          <DataPlot1D name="vx" period="100" enabled="0"/>
+          <DataPlot1D name="vy" period="100" enabled="0"/>
+          <DataPlot1D name="vz" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="Mesures (xy) Drone_0">
+          <DataPlot2D name="xy" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="Mesures target">
+          <DataPlot1D name="x" period="100" enabled="0"/>
+          <DataPlot1D name="y" period="100" enabled="0"/>
+          <DataPlot1D name="z" period="100" enabled="0"/>
+          <DataPlot1D name="vx" period="100" enabled="0"/>
+          <DataPlot1D name="vy" period="100" enabled="0"/>
+          <DataPlot1D name="vz" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="Mesures (xy) target">
+          <DataPlot2D name="xy" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+  </TabWidget>
+  <PushButton name="save config on target (Drone_0)" value="1"/>
+</root>
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.sh
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.sh	(revision 209)
@@ -0,0 +1,1 @@
+./CircleFollower_rt -a 192.168.147.217 -p 9000 -l /tmp -x CircleFollower_hdsx8.xml -n x8_0 -t hds_x8
Index: tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.xml
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_arm/bin/CircleFollower_hdsx8.xml	(revision 209)
@@ -0,0 +1,478 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-10" name="debattement roll"/>
+     <DoubleSpinBox value="-10" name="debattement pitch"/>
+     <DoubleSpinBox value="40" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.5" name="debattement dz"/>
+     <DoubleSpinBox value="0.01" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-3"/><DoubleSpinBox name="debattement y" value="3"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <PushButton value="0" name="kill"/>
+  <PushButton value="0" name="start_log"/>
+  <PushButton value="0" name="stop_log"/>
+  <PushButton value="0" name="take_off"/>
+  <PushButton value="0" name="landing"/>
+  <PushButton value="0" name="start_cercle"/>
+  <PushButton value="0" name="stop_cercle"/>
+  <PushButton value="0" name="start_2D"/>
+  <PushButton value="0" name="stop_2D"/>
+  <PushButton value="0" name="Test0"/>
+  <PushButton value="0" name="Test1"/>
+  <PushButton value="0" name="Test11"/>
+  <PushButton value="0" name="Test2"/>
+  <PushButton value="0" name="Test3"/>
+  <PushButton value="0" name="Test4"/>
+  <PushButton value="0" name="Test5"/>
+  <PushButton value="0" name="f1"/>
+  <PushButton value="0" name="f2"/>
+  <PushButton value="0" name="f3"/>
+  <PushButton value="0" name="f4"/>
+  <PushButton value="0" name="f5"/>
+  <PushButton value="0" name="f6"/>
+  <PushButton value="0" name="f7"/>
+  <PushButton value="0" name="f8"/>
+  <PushButton value="0" name="Start_Obs"/>
+ <GridLayout name="buttons"><PushButton name="kill"/><PushButton name="start_log"/><PushButton name="stop_log"/><PushButton name="take_off"/><PushButton name="land"/><PushButton name="f1"/><PushButton name="f2"/><PushButton name="f3"/><PushButton name="f4"/><PushButton name="Reset"/><PushButton name="Start_Obs"/><PushButton name="Optical_flow"/><PushButton name="start_circle"/><PushButton name="stop_circle"/><PushButton name="position hold"/></GridLayout><GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.3"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="multi">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="fault">
+     <DoubleSpinBox value="0.72" name="Coef:"/>
+     <DoubleSpinBox value="0.0025" name="coefficientKf:"/>
+    </GroupBox>
+    <GroupBox name="x8 multiplex">
+     <ComboBox value="1" name="top front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="top front left"/>
+     <ComboBox value="7" name="top front rigth"/>
+     <ComboBox value="4" name="top rear left"/>
+     <ComboBox value="1" name="top rear rigth"/>
+     <ComboBox value="3" name="bottom front left"/>
+     <ComboBox value="5" name="bottom front rigth"/>
+     <ComboBox value="6" name="bottom rear left"/>
+     <ComboBox value="2" name="bottom rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.2" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="1" name="test motor 0"/>
+     <PushButton value="1" name="test motor 1"/>
+     <PushButton value="1" name="test motor 2"/>
+     <PushButton value="1" name="test motor 3"/>
+     <PushButton value="1" name="test motor 4"/>
+     <PushButton value="1" name="test motor 5"/>
+     <PushButton value="1" name="test motor 6"/>
+     <PushButton value="1" name="test motor 7"/>
+    </GroupBox>
+    <GroupBox name="battery">
+     <Label name="battery"/>
+     <DoubleSpinBox value="10" name="threshold"/>
+    </GroupBox>
+    <GroupBox name="Motors">
+     <SpinBox value="14" name="nb poles:"/>
+    </GroupBox>
+    <GroupBox name="startup">
+     <DoubleSpinBox value="0" name="prc_fault:"/>
+     <DoubleSpinBox value="0" name="prc_retab:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="top front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="SRF08">
+  <TabWidget name="SRF08">
+   <Tab name="Reglages">
+    <GroupBox name="SRF08">
+     <SpinBox value="8" name="gain:"/>
+     <SpinBox value="46" name="range:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.3" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="0.7" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="SRF08" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <PushButton value="0" name="gyros bias"/>
+     <SpinBox value="100" name="data rate (Hz):"/>
+     <Label name="data_rate"/>
+     <SpinBox value="15" name="gyro and acc filter win size:"/>
+     <SpinBox value="17" name="mag filter win size:"/>
+     <SpinBox value="10" name="up compensation (s):"/>
+     <SpinBox value="10" name="north compensation (s):"/>
+     <CheckBox value="1" name="enable Coning&amp;Sculling:"/>
+     <CheckBox value="1" name="disable magnetometer:"/>
+     <CheckBox value="1" name="disable magnetic north compensation:"/>
+     <CheckBox value="1" name="disable gravity compensation:"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="180" name="value"/>
+     <ComboBox value="2" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="0"/><DataPlot1D name="q1" period="100" enabled="0"/><DataPlot1D name="q2" period="100" enabled="0"/><DataPlot1D name="q3" period="100" enabled="0"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="10" name="sat ref:"/>
+     <DoubleSpinBox value="10" name="satf ref:"/>
+     <DoubleSpinBox value="10" name="sat2f ref:"/>
+     <DoubleSpinBox value="7" name="kp:"/>
+     <DoubleSpinBox value="7" name="kpf:"/>
+     <DoubleSpinBox value="10" name="kp2f:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="110" name="satf dref:"/>
+     <DoubleSpinBox value="140" name="sat2f dref:"/>
+     <DoubleSpinBox value="0.12" name="kd:"/>
+     <DoubleSpinBox value="0.12" name="kdf:"/>
+     <DoubleSpinBox value="0.13" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+     <DoubleSpinBox value="0.4" name="satf u:"/>
+     <DoubleSpinBox value="0.6" name="sat2f u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="10" name="sat ref:"/>
+     <DoubleSpinBox value="10" name="satf ref:"/>
+     <DoubleSpinBox value="10" name="sat2f ref:"/>
+     <DoubleSpinBox value="7" name="kp:"/>
+     <DoubleSpinBox value="7" name="kpf:"/>
+     <DoubleSpinBox value="10" name="kp2f:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="110" name="satf dref:"/>
+     <DoubleSpinBox value="140" name="sat2f dref:"/>
+     <DoubleSpinBox value="0.12" name="kd:"/>
+     <DoubleSpinBox value="0.12" name="kdf:"/>
+     <DoubleSpinBox value="0.13" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+     <DoubleSpinBox value="0.4" name="satf u:"/>
+     <DoubleSpinBox value="0.6" name="sat2f u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="1.5" name="kpf:"/>
+     <DoubleSpinBox value="2" name="kp2f:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.35" name="kif:"/>
+     <DoubleSpinBox value="0.5" name="ki2f:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.4" name="sat2f i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="kdf:"/>
+     <DoubleSpinBox value="0.3" name="kd2f:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="x_pid">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.01" name="kp:"/>
+     <DoubleSpinBox value="0.015" name="kpf:"/>
+     <DoubleSpinBox value="0.01" name="kp2f:"/>
+     <DoubleSpinBox value="0.03" name="ki:"/>
+     <DoubleSpinBox value="0.035" name="kif:"/>
+     <DoubleSpinBox value="0.02" name="ki2f:"/>
+     <DoubleSpinBox value="0.3" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.3" name="sat2f i:"/>
+     <DoubleSpinBox value="0" name="kd:"/>
+     <DoubleSpinBox value="0" name="kdf:"/>
+     <DoubleSpinBox value="0" name="kd2f:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="y_pid">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.01" name="kp:"/>
+     <DoubleSpinBox value="0.015" name="kpf:"/>
+     <DoubleSpinBox value="0.01" name="kp2f:"/>
+     <DoubleSpinBox value="0.03" name="ki:"/>
+     <DoubleSpinBox value="0.035" name="kif:"/>
+     <DoubleSpinBox value="0.02" name="ki2f:"/>
+     <DoubleSpinBox value="0.3" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.3" name="sat2f i:"/>
+     <DoubleSpinBox value="0" name="kd:"/>
+     <DoubleSpinBox value="0" name="kdf:"/>
+     <DoubleSpinBox value="0" name="kd2f:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.4" name="kpf:"/>
+     <DoubleSpinBox value="0.5" name="kp2f:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.4" name="kif:"/>
+     <DoubleSpinBox value="0.4" name="ki2f:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.8" name="satf i:"/>
+     <DoubleSpinBox value="0.8" name="sat2f i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.3" name="kdf:"/>
+     <DoubleSpinBox value="0.3" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0001" name="offset step:"/>
+    </GroupBox>
+   <GroupBox name="u_x"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0.40"/><DoubleSpinBox name="ki:" value="0.40"/><DoubleSpinBox name="sat i:" value="0.0"/><DoubleSpinBox name="kd:" value="0.200"/><DoubleSpinBox name="sat:" value="0.4"/></GroupBox><GroupBox name="u_y"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0.40"/><DoubleSpinBox name="ki:" value="0.40"/><DoubleSpinBox name="sat i:" value="0.0"/><DoubleSpinBox name="kd:" value="0.200"/><DoubleSpinBox name="sat:" value="0.4"/></GroupBox></Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   <DataPlot1D name="x_pid" period="100" enabled="1"/><DataPlot1D name="y_pid" period="100" enabled="1"/><DataPlot1D name="u_x" period="100" enabled="0"/><DataPlot1D name="u_y" period="100" enabled="0"/></Tab>
+   <Tab name="HighOrder">
+    <GroupBox name="HighOrder">
+     <DoubleSpinBox value="1" name="lambda1:"/>
+     <DoubleSpinBox value="1" name="alpha1:"/>
+     <DoubleSpinBox value="1" name="lambda2:"/>
+     <DoubleSpinBox value="1" name="alpha2:"/>
+     <DoubleSpinBox value="1.5" name="lambda3:"/>
+     <DoubleSpinBox value="2" name="alpha3:"/>
+     <DoubleSpinBox value="2" name="lambda11:"/>
+     <DoubleSpinBox value="2" name="alpha11:"/>
+     <DoubleSpinBox value="2" name="lambda21:"/>
+     <DoubleSpinBox value="2" name="alpha21:"/>
+     <DoubleSpinBox value="2.5" name="lambda31:"/>
+     <DoubleSpinBox value="3" name="alpha31:"/>
+     <DoubleSpinBox value="3" name="lambda12:"/>
+     <DoubleSpinBox value="3" name="alpha12:"/>
+     <DoubleSpinBox value="3" name="lambda22:"/>
+     <DoubleSpinBox value="3" name="alpha22:"/>
+     <DoubleSpinBox value="3" name="lambda32:"/>
+     <DoubleSpinBox value="3.5" name="alpha32:"/>
+    </GroupBox>
+    <DataPlot1D name="phi/dphi">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="theta/dtheta">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="psi/dpsi">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="F">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="Filter">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="1" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x8_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x8_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="cercle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="R"/>
+     <DoubleSpinBox value="0.4" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+    <GroupBox name="Cible Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Cible_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+   <GroupBox name="target Passe bas"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="cutoff frequency" value="1"/></GroupBox><GroupBox name="target_euler"><DoubleSpinBox name="period, 0 for auto:" value="0"/></GroupBox><GroupBox name="circle"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="R" value="1"/><DoubleSpinBox name="velocity" value="0.5"/><DoubleSpinBox name="acceleration (absolute)" value="0.1"/></GroupBox></Tab>
+   <Tab name="Mesures x8_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x8_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures Cible">
+    <DataPlot1D name="x">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) Cible">
+    <DataPlot2D name="xy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  <Tab name="Mesures target"><DataPlot1D name="x" period="100" enabled="0"/><DataPlot1D name="y" period="100" enabled="0"/><DataPlot1D name="z" period="100" enabled="0"/><DataPlot1D name="vx" period="100" enabled="0"/><DataPlot1D name="vy" period="100" enabled="0"/><DataPlot1D name="vz" period="100" enabled="0"/></Tab><Tab name="Mesures (xy) target"><DataPlot2D name="xy" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="camv"><TabWidget name="camv"><Tab name="Setup"><GroupBox name="camv"><DoubleSpinBox name="gain:" value="0.2"/><DoubleSpinBox name="exposure:" value="0.25"/><DoubleSpinBox name="bright:" value="0.3"/><DoubleSpinBox name="contrast:" value="0.4"/><DoubleSpinBox name="hue:" value="1"/><DoubleSpinBox name="sharpness:" value="0.5"/><DoubleSpinBox name="saturation:" value="0"/><CheckBox name="autogain:" value="0"/><CheckBox name="autoexposure:" value="0"/><CheckBox name="awb:" value="0"/><Label name="fps"/></GroupBox><GridLayout name="setup"><GroupBox name="flux optique"><GroupBox name="post rotation"><DoubleSpinBox name="value" value="-90"/><ComboBox name="axis" value="2"/></GroupBox><SpinBox name="max features:" value="64"/></GroupBox><GroupBox name="passe bas"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="cutoff frequency" value="5"/></GroupBox></GridLayout></Tab><Tab name="Picture"><Picture name="camv" period="200" enabled="0"/></Tab></TabWidget></Tab><Tab name="flux optique"><DataPlot1D name="x_velocity" period="100" enabled="0"/><DataPlot1D name="y_velocity" period="100" enabled="0"/></Tab><Tab name="motors"><TabWidget name="UavMultiplex"><Tab name="Setup"><GroupBox name="x8 multiplex"><ComboBox name="top front left blade pitch:" value="1"/></GroupBox><GroupBox name="motor attribution"><ComboBox name="top front left" value="0"/><ComboBox name="top front rigth" value="7"/><ComboBox name="top rear left" value="4"/><ComboBox name="top rear rigth" value="1"/><ComboBox name="bottom front left" value="3"/><ComboBox name="bottom front rigth" value="5"/><ComboBox name="bottom rear left" value="6"/><ComboBox name="bottom rear rigth" value="2"/></GroupBox><GroupBox name="bldc"><Label name="flight time"/><DoubleSpinBox name="min value:" value="0.2"/><DoubleSpinBox name="max value:" value="1"/><DoubleSpinBox name="test value:" value="0.1"/><PushButton name="test motor 0"/><PushButton name="test motor 1"/><PushButton name="test motor 2"/><PushButton name="test motor 3"/><PushButton name="test motor 4"/><PushButton name="test motor 5"/><PushButton name="test motor 6"/><PushButton name="test motor 7"/></GroupBox><GroupBox name="battery"><Label name="battery"/><DoubleSpinBox name="threshold" value="10"/><SpinBox name="threshold time" value="10"/></GroupBox><GroupBox name="Motors"><SpinBox name="nb poles:" value="14"/></GroupBox></Tab><Tab name="Values"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab><Tab name="Speeds"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab><Tab name="Currents"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab></TabWidget></Tab><Tab name="Dualshock3"><TabWidget name="Dualshock3"><Tab name="Reglages"><GroupBox name="consignes joy"><DoubleSpinBox name="debattement roll" value="-15"/><DoubleSpinBox name="debattement pitch" value="-15"/><DoubleSpinBox name="debattement wz" value="90"/><DoubleSpinBox name="debattement dz" value="-0.5"/><DoubleSpinBox name="trim" value="0.02"/><Label name="trim roll"/><PushButton name="reset roll trim"/><Label name="trim pitch"/><PushButton name="reset pitch trim"/></GroupBox></Tab></TabWidget></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x8_0)" value="1"/></root>
Index: tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,361 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="Dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    <DoubleSpinBox name="debattement wz" value="90"/></GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Currents"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="1" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="1"/><DataPlot1D name="q1" period="100" enabled="1"/><DataPlot1D name="q2" period="100" enabled="1"/><DataPlot1D name="q3" period="100" enabled="1"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x4_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x4_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.5" name="R"/>
+     <DoubleSpinBox value="1" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures x4_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x4_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="land"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  </GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x4_0)" value="1"/></root>
Index: tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,342 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x8 multiplex">
+     <ComboBox value="0" name="top front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="top front left"/>
+     <ComboBox value="1" name="top front rigth"/>
+     <ComboBox value="2" name="top rear left"/>
+     <ComboBox value="3" name="top rear rigth"/>
+     <ComboBox value="4" name="bottom front left"/>
+     <ComboBox value="5" name="bottom front rigth"/>
+     <ComboBox value="6" name="bottom rear left"/>
+     <ComboBox value="7" name="bottom rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+     <PushButton value="0" name="test motor 4"/>
+     <PushButton value="0" name="test motor 5"/>
+     <PushButton value="0" name="test motor 6"/>
+     <PushButton value="0" name="test motor 7"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="1" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x8_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x8_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.5" name="R"/>
+     <DoubleSpinBox value="1" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures x8_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x8_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.5"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15.00" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15.00" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x8_0)" value="1"/></root>
Index: tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x4.sh
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x4.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./CircleFollower_rt
+else
+	EXEC=./CircleFollower_nrt
+fi
+
+$EXEC -n x4_0 -a 127.0.0.1 -p 9000 -l /tmp -x setup_x4.xml -t x4_simu 
Index: tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x8.sh
===================================================================
--- tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x8.sh	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/build_x86_64/bin/x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./CircleFollower_rt
+else
+	EXEC=./CircleFollower_nrt
+fi
+
+$EXEC -n x8_0 -a 127.0.0.1 -p 9000 -l ./ -x setup_x8.xml -t x8_simu
Index: tags/latest/demos/CircleFollower/uav/src/CircleFollower.cpp
===================================================================
--- tags/latest/demos/CircleFollower/uav/src/CircleFollower.cpp	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/src/CircleFollower.cpp	(revision 209)
@@ -0,0 +1,284 @@
+//  created:    2011/05/01
+//  filename:   CircleFollower.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo cercle avec optitrack
+//
+//
+/*********************************************************************/
+
+#include "CircleFollower.h"
+#include <TargetController.h>
+#include <Uav.h>
+#include <GridLayout.h>
+#include <PushButton.h>
+#include <DataPlot1D.h>
+#include <DataPlot2D.h>
+#include <MetaDualShock3.h>
+#include <FrameworkManager.h>
+#include <VrpnClient.h>
+#include <MetaVrpnObject.h>
+#include <TrajectoryGenerator2DCircle.h>
+#include <cvmatrix.h>
+#include <cmath>
+#include <Tab.h>
+#include <Pid.h>
+#include <Ahrs.h>
+#include <AhrsData.h>
+#include <Camera.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::meta;
+
+CircleFollower::CircleFollower(TargetController *controller): UavStateMachine(controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
+    Uav* uav=GetUav();
+
+    VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80);
+    uavVrpn = new MetaVrpnObject(uav->ObjectName());
+    getFrameworkManager()->AddDeviceToLog(uavVrpn);
+    uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
+																 
+    startCircle=new PushButton(GetButtonsLayout()->NewRow(),"start_circle");
+    stopCircle=new PushButton(GetButtonsLayout()->LastRowLastCol(),"stop_circle");
+    positionHold=new PushButton(GetButtonsLayout()->LastRowLastCol(),"position hold");
+
+    if(vrpnclient->UseXbee()==true) {
+        targetVrpn=new MetaVrpnObject("target",1);
+    } else {
+        targetVrpn=new MetaVrpnObject("target");
+    }
+		vrpnclient->Start();
+
+    getFrameworkManager()->AddDeviceToLog(targetVrpn);
+
+    circle=new TrajectoryGenerator2DCircle(vrpnclient->GetLayout()->NewRow(),"circle");
+    uavVrpn->xPlot()->AddCurve(circle->Matrix()->Element(0,0),DataPlot::Blue);
+    uavVrpn->yPlot()->AddCurve(circle->Matrix()->Element(0,1),DataPlot::Blue);
+    uavVrpn->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),DataPlot::Blue);
+    uavVrpn->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),DataPlot::Blue);
+    uavVrpn->XyPlot()->AddCurve(circle->Matrix()->Element(0,1),circle->Matrix()->Element(0,0),DataPlot::Blue,"circle");
+
+    uX=new Pid(setupLawTab->At(1,0),"u_x");
+    uX->UseDefaultPlot(graphLawTab->NewRow());
+    uY=new Pid(setupLawTab->At(1,1),"u_y");
+    uY->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+    customReferenceOrientation= new AhrsData(this,"reference");
+    uav->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow);
+    AddDataToControlLawLog(customReferenceOrientation);
+
+    customOrientation=new AhrsData(this,"orientation");
+}
+
+CircleFollower::~CircleFollower() {
+}
+
+const AhrsData *CircleFollower::GetOrientation(void) const {
+    //get yaw from vrpn
+		Quaternion vrpnQuaternion;
+    uavVrpn->GetQuaternion(vrpnQuaternion);
+
+    //get roll, pitch and w from imu
+    Quaternion ahrsQuaternion;
+    Vector3Df ahrsAngularSpeed;
+    GetDefaultOrientation()->GetQuaternionAndAngularRates(ahrsQuaternion, ahrsAngularSpeed);
+
+    Euler ahrsEuler=ahrsQuaternion.ToEuler();
+    ahrsEuler.yaw=vrpnQuaternion.ToEuler().yaw;
+    Quaternion mixQuaternion=ahrsEuler.ToQuaternion();
+
+    customOrientation->SetQuaternionAndAngularRates(mixQuaternion,ahrsAngularSpeed);
+
+    return customOrientation;
+}
+
+void CircleFollower::AltitudeValues(float &z,float &dz) const{
+    Vector3Df uav_pos,uav_vel;
+
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
+    //z and dz must be in uav's frame
+    z=-uav_pos.z;
+    dz=-uav_vel.z;
+}
+
+AhrsData *CircleFollower::GetReferenceOrientation(void) {
+    Vector2Df pos_err, vel_err; // in Uav coordinate system
+    float yaw_ref;
+    Euler refAngles;
+
+    PositionValues(pos_err, vel_err, yaw_ref);
+
+    refAngles.yaw=yaw_ref;
+
+    uX->SetValues(pos_err.x, vel_err.x);
+    uX->Update(GetTime());
+    refAngles.pitch=uX->Output();
+
+    uY->SetValues(pos_err.y, vel_err.y);
+    uY->Update(GetTime());
+    refAngles.roll=-uY->Output();
+
+    customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0));
+
+    return customReferenceOrientation;
+}
+
+void CircleFollower::PositionValues(Vector2Df &pos_error,Vector2Df &vel_error,float &yaw_ref) {
+    Vector3Df uav_pos,uav_vel; // in VRPN coordinate system
+    Vector2Df uav_2Dpos,uav_2Dvel; // in VRPN coordinate system
+
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
+
+    uav_pos.To2Dxy(uav_2Dpos);
+    uav_vel.To2Dxy(uav_2Dvel);
+
+    if (behaviourMode==BehaviourMode_t::PositionHold) {
+        pos_error=uav_2Dpos-posHold;
+        vel_error=uav_2Dvel;
+        yaw_ref=yawHold;
+    } else { //Circle
+        Vector3Df target_pos;
+        Vector2Df circle_pos,circle_vel;
+        Vector2Df target_2Dpos;
+
+        targetVrpn->GetPosition(target_pos);
+        target_pos.To2Dxy(target_2Dpos);
+        circle->SetCenter(target_2Dpos);
+
+        //circle reference
+        circle->Update(GetTime());
+        circle->GetPosition(circle_pos);
+        circle->GetSpeed(circle_vel);
+
+        //error in optitrack frame
+        pos_error=uav_2Dpos-circle_pos;
+        vel_error=uav_2Dvel-circle_vel;
+        yaw_ref=atan2(target_pos.y-uav_pos.y,target_pos.x-uav_pos.x);
+    }
+
+    //error in uav frame
+    Quaternion currentQuaternion=GetCurrentQuaternion();
+    Euler currentAngles;//in vrpn frame
+    currentQuaternion.ToEuler(currentAngles);
+    pos_error.Rotate(-currentAngles.yaw);
+    vel_error.Rotate(-currentAngles.yaw);
+}
+
+void CircleFollower::SignalEvent(Event_t event) {
+    UavStateMachine::SignalEvent(event);
+    switch(event) {
+    case Event_t::TakingOff:
+        behaviourMode=BehaviourMode_t::Default;
+        vrpnLost=false;
+        break;
+    case Event_t::EnteringControlLoop:
+        if ((behaviourMode==BehaviourMode_t::Circle) && (!circle->IsRunning())) {
+            VrpnPositionHold();
+        }
+        break;
+    case Event_t::EnteringFailSafeMode:
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    }
+}
+
+void CircleFollower::ExtraSecurityCheck(void) {
+    if ((!vrpnLost) && ((behaviourMode==BehaviourMode_t::Circle) || (behaviourMode==BehaviourMode_t::PositionHold))) {
+        if (!targetVrpn->IsTracked(500)) {
+            Thread::Err("VRPN, target lost\n");
+            vrpnLost=true;
+            EnterFailSafeMode();
+            Land();
+        }
+        if (!uavVrpn->IsTracked(500)) {
+            Thread::Err("VRPN, uav lost\n");
+            vrpnLost=true;
+            EnterFailSafeMode();
+            Land();
+        }
+    }
+}
+
+void CircleFollower::ExtraCheckPushButton(void) {
+    if(startCircle->Clicked() && (behaviourMode!=BehaviourMode_t::Circle)) {
+        StartCircle();
+    }
+    if(stopCircle->Clicked() && (behaviourMode==BehaviourMode_t::Circle)) {
+        StopCircle();
+    }
+    if(positionHold->Clicked() && (behaviourMode==BehaviourMode_t::Default)) {
+        VrpnPositionHold();
+    }
+}
+
+void CircleFollower::ExtraCheckJoystick(void) {
+    //R1 and Circle
+    if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(4) && (behaviourMode!=BehaviourMode_t::Circle)) {
+        StartCircle();
+    }
+
+    //R1 and Cross
+    if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(5) && (behaviourMode==BehaviourMode_t::Circle)) {
+        StopCircle();
+    }
+    
+    //R1 and Square
+    if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
+        VrpnPositionHold();
+    }
+}
+
+void CircleFollower::StartCircle(void) {
+    if (SetOrientationMode(OrientationMode_t::Custom)) {
+        Thread::Info("CircleFollower: start circle\n");
+    } else {
+        Thread::Warn("CircleFollower: could not start circle\n");
+        return;
+    }
+    Vector3Df uav_pos,target_pos;
+    Vector2Df uav_2Dpos,target_2Dpos;
+
+    targetVrpn->GetPosition(target_pos);
+    target_pos.To2Dxy(target_2Dpos);
+    circle->SetCenter(target_2Dpos);
+
+    uavVrpn->GetPosition(uav_pos);
+    uav_pos.To2Dxy(uav_2Dpos);
+    circle->StartTraj(uav_2Dpos);
+
+    uX->Reset();
+    uY->Reset();
+    behaviourMode=BehaviourMode_t::Circle;
+}
+
+void CircleFollower::StopCircle(void) {
+    circle->FinishTraj();
+    //GetJoystick()->Rumble(0x70);
+    Thread::Info("CircleFollower: finishing circle\n");
+}
+
+void CircleFollower::VrpnPositionHold(void) {
+		Quaternion vrpnQuaternion;
+    uavVrpn->GetQuaternion(vrpnQuaternion);
+		yawHold=vrpnQuaternion.ToEuler().yaw;
+
+    Vector3Df vrpnPosition;
+    uavVrpn->GetPosition(vrpnPosition);
+    vrpnPosition.To2Dxy(posHold);
+
+    uX->Reset();
+    uY->Reset();
+    behaviourMode=BehaviourMode_t::PositionHold;
+    SetOrientationMode(OrientationMode_t::Custom);
+    Thread::Info("CircleFollower: holding position\n");
+}
Index: tags/latest/demos/CircleFollower/uav/src/CircleFollower.h
===================================================================
--- tags/latest/demos/CircleFollower/uav/src/CircleFollower.h	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/src/CircleFollower.h	(revision 209)
@@ -0,0 +1,72 @@
+//  created:    2011/05/01
+//  filename:   CircleFollower.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo cercle avec optitrack
+//
+//
+/*********************************************************************/
+
+#ifndef CIRCLEFOLLOWER_H
+#define CIRCLEFOLLOWER_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+    namespace gui {
+        class PushButton;
+    }
+    namespace filter {
+        class TrajectoryGenerator2DCircle;
+    }
+    namespace meta {
+        class MetaVrpnObject;
+    }
+    namespace sensor {
+        class TargetController;
+    }
+}
+
+class CircleFollower : public flair::meta::UavStateMachine {
+    public:
+        CircleFollower(flair::sensor::TargetController *controller);
+        ~CircleFollower();
+
+    private:
+        enum class BehaviourMode_t {
+            Default,
+            PositionHold,
+            Circle
+        };
+
+        BehaviourMode_t behaviourMode;
+        bool vrpnLost;
+
+        void VrpnPositionHold(void);//flight mode
+        void StartCircle(void);
+        void StopCircle(void);
+        void ExtraSecurityCheck(void);
+        void ExtraCheckPushButton(void);
+        void ExtraCheckJoystick(void);
+        const flair::core::AhrsData *GetOrientation(void) const;
+        void AltitudeValues(float &z,float &dz) const;
+        void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
+        flair::core::AhrsData *GetReferenceOrientation(void);
+        void SignalEvent(Event_t event);
+
+        flair::filter::Pid *uX, *uY;
+
+        flair::core::Vector2Df posHold;
+        float yawHold;
+
+        flair::gui::PushButton *startCircle,*stopCircle,*positionHold;
+        flair::meta::MetaVrpnObject *targetVrpn,*uavVrpn;
+        flair::filter::TrajectoryGenerator2DCircle *circle;
+        flair::core::AhrsData *customReferenceOrientation,*customOrientation;
+};
+
+#endif // CIRCLEFOLLOWER_H
Index: tags/latest/demos/CircleFollower/uav/src/main.cpp
===================================================================
--- tags/latest/demos/CircleFollower/uav/src/main.cpp	(revision 209)
+++ tags/latest/demos/CircleFollower/uav/src/main.cpp	(revision 209)
@@ -0,0 +1,97 @@
+//  created:    2011/05/01
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code uav
+//
+//
+/*********************************************************************/
+
+#include "CircleFollower.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+#include <TargetEthController.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+    manager->SetupLogger(log_path);
+
+    Uav* drone=CreateUav(name,uav_type);
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    CircleFollower* demo=new CircleFollower(controller);
+
+    demo->Start();
+    demo->Join();
+
+    delete manager;
+}
+
+void parseOptions(int argc, char** argv) {
+	try {
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, x4_simu, x8_simu or x4_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        uav_type=typeArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e) { // catch any exceptions
+        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+	}
+}
Index: tags/latest/demos/Gps/simulator/CMakeLists.txt
===================================================================
--- tags/latest/demos/Gps/simulator/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/Gps/simulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,31 @@
+PROJECT(Gps_simulator)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_SIMULATOR TRUE)
+SET(FLAIR_USE_SIMULATOR_GL TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT} nmea)
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT} nmea)
Index: tags/latest/demos/Gps/simulator/build
===================================================================
--- tags/latest/demos/Gps/simulator/build	(revision 209)
+++ tags/latest/demos/Gps/simulator/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/Gps/simulator/build_arm/bin/reglages.xml
===================================================================
--- tags/latest/demos/Gps/simulator/build_arm/bin/reglages.xml	(revision 209)
+++ tags/latest/demos/Gps/simulator/build_arm/bin/reglages.xml	(revision 209)
@@ -0,0 +1,243 @@
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+ <Tab name="simu">
+  <TabWidget name="simu">
+   <Tab name="Reglages">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+    <DoubleSpinBox value="1" name="masse (kg):"/>
+    <DoubleSpinBox value="0.2" name="bras (m):"/>
+    <DoubleSpinBox value="0.05" name="k_driver:"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.01" name="c_mot:"/>
+    <DoubleSpinBox value="0.05" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.5" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <PushButton value="0" name="reset"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="x4">
+  <PushButton value="0" name="kill"/>
+  <PushButton value="0" name="start_log"/>
+  <PushButton value="0" name="stop_log"/>
+  <PushButton value="0" name="take_off"/>
+  <PushButton value="0" name="landing"/>
+ </Tab>
+ <Tab name="SRF08">
+  <TabWidget name="SRF08">
+   <Tab name="Reglages">
+    <GroupBox name="SRF08">
+     <SpinBox value="8" name="gain:"/>
+     <SpinBox value="46" name="range:"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="Passe bas">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="1" name="fc (Hz):"/>
+     </GroupBox>
+     <GroupBox name="Passe bas v">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="1" name="fc (Hz):"/>
+     </GroupBox>
+     <GroupBox name="Vz">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     </GroupBox>
+     <GroupBox name="alt cons">
+      <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+      <DoubleSpinBox value="0.4" name="velocity max (absolute):"/>
+      <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+     </GroupBox>
+     <GroupBox name="decollage">
+      <DoubleSpinBox value="1.1" name="alt decollage (m):"/>
+      <DoubleSpinBox value="0" name="alt atterissage (m):"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="z">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="vz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="3dmgx3">
+  <TabWidget name="3dmgx3">
+   <Tab name="Reglages">
+    <GroupBox name="3dmgx3">
+     <PushButton value="0" name="gyros bias"/>
+     <SpinBox value="100" name="data rate (Hz):"/>
+     <SpinBox value="1" name="gyro and acc filter win size:"/>
+     <SpinBox value="1" name="mag filter win size:"/>
+     <SpinBox value="1" name="up compensation (s):"/>
+     <SpinBox value="1" name="north compensation (s):"/>
+     <CheckBox value="true" name="enable Coning&amp;Sculling:"/>
+     <CheckBox value="true" name="disable magnetometer:"/>
+     <CheckBox value="true" name="disable magnetic north compensation:"/>
+     <CheckBox value="true" name="disable gravity compensation:"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="valeur (degre):"/>
+     <ComboBox value="0" name="axe:"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="droll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="dpitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="dyaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="loi de commande">
+  <TabWidget name="loi">
+   <Tab name="Reglages">
+    <GroupBox name="uroll">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="1e+06" name="ki:"/>
+     <DoubleSpinBox value="50000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="upitch">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="1e+06" name="ki:"/>
+     <DoubleSpinBox value="50000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="uyaw">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="20000" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="5000" name="kd:"/>
+    </GroupBox>
+    <GroupBox name="ugaz">
+     <DoubleSpinBox value="0" name="periode (s), 0 for auto:"/>
+     <DoubleSpinBox value="500000" name="kp:"/>
+     <DoubleSpinBox value="100000" name="ki:"/>
+     <DoubleSpinBox value="200000" name="kd:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot name="uroll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="upitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="uyaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="ugaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="ps3eye">
+  <TabWidget name="ps3eye">
+   <Tab name="Reglages">
+    <GroupBox name="ps3eye">
+     <DoubleSpinBox value="0" name="gain:"/>
+     <DoubleSpinBox value="0" name="exposure:"/>
+     <DoubleSpinBox value="0" name="bright:"/>
+     <DoubleSpinBox value="0" name="contrast:"/>
+     <DoubleSpinBox value="0" name="hue:"/>
+     <DoubleSpinBox value="0" name="sharpness:"/>
+     <CheckBox value="true" name="autogain:"/>
+     <CheckBox value="true" name="awb:"/>
+     <Picture name="image source">
+      <Setup period="200" enabled="0"/>
+     </Picture>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="flux optique">
+    <DataPlot name="vx">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="vy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="moteurs">
+  <TabWidget name="moteurs">
+   <Tab name="Reglages">
+    <GroupBox name="moteurs">
+     <SpinBox value="0" name="min:"/>
+     <SpinBox value="2000" name="max:"/>
+     <SpinBox value="0" name="test value:"/>
+     <SpinBox value="950" name="valeur demarrage:"/>
+     <DoubleSpinBox value="0.1" name="pas decollage:"/>
+     <ComboBox value="0" name="avant gauche:"/>
+     <PushButton value="0" name="test avg"/>
+     <ComboBox value="1" name="avant droite:"/>
+     <PushButton value="0" name="test avd"/>
+     <ComboBox value="2" name="arriere gauche:"/>
+     <PushButton value="0" name="test arg"/>
+     <ComboBox value="3" name="arriere droite:"/>
+     <PushButton value="0" name="test ard"/>
+     <ComboBox value="0" name="pas helice avant gauche:"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="20" name="debattement roll (deg)"/>
+     <DoubleSpinBox value="20" name="debattement pitch (deg)"/>
+     <DoubleSpinBox value="90" name="debattement dyaw (deg/s)"/>
+     <DoubleSpinBox value="0.7" name="debattement dz (m/s)"/>
+     <SpinBox value="10" name="trim:"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+    <DataPlot name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</root>
Index: tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x4_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-3.5" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.5" value_y="0" value_z="-1"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.2" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+   <Tab name="front camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="-1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="1.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="up" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="target">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.02" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="1" name="y:"/>
+    <DoubleSpinBox value="0" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.5" value_y="1" value_z="0"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
+    <DoubleSpinBox value="60" name="rotational speed (deg/s):"/>
+   </Tab>
+  </TabWidget>
+</Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/Gps/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x8_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-1.2" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.50" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.6" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0" name="position G (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+    <DoubleSpinBox value="0" name="j_r:"/>
+    <DoubleSpinBox value="0.72" name="sigma:"/>
+    <DoubleSpinBox value="1" name="S:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+   <Tab name="front camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="-1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="1.00" value_y="0.00" value_z="0.00"/><Vector3DSpinBox name="up" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="target">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.02" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="0" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="0" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="-1.50" value_y="1.00" value_z="0.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
+    <DoubleSpinBox value="60" name="rotational speed (deg/s):"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x4.sh
===================================================================
--- tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
+++ tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./Gps_simulator_rt
+else
+	EXEC=./Gps_simulator_nrt
+fi
+
+$EXEC -n x4_0 -t x4 -p 9000 -a 127.0.0.1 -x setup_x4.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x8.sh
===================================================================
--- tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
+++ tags/latest/demos/Gps/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./CircleFollower_simulator_rt
+else
+	EXEC=./CircleFollower_simulator_nrt
+fi
+
+$EXEC -n x8_0 -t x8 -p 9000 -a 127.0.0.1 -x setup_x8.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/Gps/simulator/src/main.cpp
===================================================================
--- tags/latest/demos/Gps/simulator/src/main.cpp	(revision 209)
+++ tags/latest/demos/Gps/simulator/src/main.cpp	(revision 209)
@@ -0,0 +1,128 @@
+//  created:    2012/04/18
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main simulateur
+//
+//
+/*********************************************************************/
+
+#include <tclap/CmdLine.h>
+#include <Simulator.h>
+#include <X4.h>
+#include <X8.h>
+#include <SimuImu.h>
+#include <SimuGps.h>
+#ifdef GL
+#include <Parser.h>
+#include <Man.h>
+#include <SimuUsGL.h>
+#endif
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::simulator;
+using namespace flair::sensor;
+
+int port;
+int opti_time;
+string xml_file;
+string media_path;
+string scene_file;
+string type;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv)
+{
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> nameArg("n", "name", "uav name, also used for vrpn", true, "x4", "string");
+    cmd.add(nameArg);
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./reglages.xml", "string");
+    cmd.add(xmlArg);
+
+    ValueArg<int> portArg("p", "port", "ground station port", true, 9002, "int");
+    cmd.add(portArg);
+
+    ValueArg<string> addressArg("a", "address", "ground station address", true, "127.0.0.1", "string");
+    cmd.add(addressArg);
+
+    ValueArg<string> typeArg("t", "type", "uav type, x4 or x8", true, "x4", "string");
+    cmd.add(typeArg);
+
+    ValueArg<int> optiArg("o", "opti", "optitrack time ms", false, 0, "int");
+    cmd.add(optiArg);
+
+#ifdef GL
+    ValueArg<string> mediaArg("m", "media", "path to media files", true, "./", "string");
+    cmd.add(mediaArg);
+
+    ValueArg<string> sceneArg("s", "scene", "path to scene file", true, "./voliere.xml", "string");
+    cmd.add(sceneArg);
+#endif
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    port = portArg.getValue();
+    xml_file = xmlArg.getValue();
+    opti_time = optiArg.getValue();
+    type = typeArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
+#ifdef GL
+    media_path = mediaArg.getValue();
+    scene_file = sceneArg.getValue();
+#endif
+
+  } catch(ArgException& e) {
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
+
+int main(int argc, char* argv[])
+{
+  Simulator* simu;
+  Model* drone;
+  SimuImu* imu;
+  SimuGps* gps;
+#ifdef GL
+  SimuUsGL* us_gl;
+  Parser* gui;
+#endif
+  parseOptions(argc, argv);
+
+  simu = new Simulator("simulator", opti_time, 0);
+  simu->SetupConnection(address, port);
+  simu->SetupUserInterface(xml_file);
+
+#ifdef GL
+  gui = new Parser(1024, 768, 1024, 768, media_path, scene_file);
+#endif
+
+  if(type == "x4") {
+    drone = new X4(name, 0);
+  } else {
+    drone = new X8(name, 0);
+  }
+
+  imu = new SimuImu(drone, "imu", 0,0);
+
+#ifdef GL
+  us_gl = new SimuUsGL(drone, "us", 0,0);
+#endif
+  gps = new SimuGps(drone, "gps", 0,0);
+
+  simu->RunSimu();
+
+  delete simu;
+
+  return 0;
+}
Index: tags/latest/demos/Gps/uav/CMakeLists.txt
===================================================================
--- tags/latest/demos/Gps/uav/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/Gps/uav/CMakeLists.txt	(revision 209)
@@ -0,0 +1,35 @@
+PROJECT(DemoGps)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/DemoGps.cpp
+)
+
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/Gps/uav/build
===================================================================
--- tags/latest/demos/Gps/uav/build	(revision 209)
+++ tags/latest/demos/Gps/uav/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.sh
===================================================================
--- tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.sh	(revision 209)
+++ tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.sh	(revision 209)
@@ -0,0 +1,1 @@
+./CircleFollower_nrt -a 192.168.147.193 -p 9000 -l /tmp -x CircleFollower_ardrone2.xml -n Drone_0 -t ardrone2
Index: tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.xml
===================================================================
--- tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.xml	(revision 209)
+++ tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_ardrone2.xml	(revision 209)
@@ -0,0 +1,357 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="x4-multiplex">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="1" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-us">
+  <TabWidget name="parrot-us">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-us"/>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0.04" name="period, 0 for auto"/>
+     <DoubleSpinBox value="10" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="1" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.8" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="0.8" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="parrot-us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-imu">
+  <TabWidget name="parrot-imu">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-imu"/>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <DoubleSpinBox value="0.5" name="k_a[0]:"/>
+    <DoubleSpinBox value="0.5" name="k_a[1]:"/>
+    <DoubleSpinBox value="0" name="k_a[2]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[0]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[1]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[2]:"/>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="IMU">
+    <DataPlot1D name="acc_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10.5" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="1" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="Drone_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Drone_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="R"/>
+     <DoubleSpinBox value="0.5" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures Drone_0">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) Drone_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="camv">
+  <TabWidget name="camv">
+   <Tab name="Setup">
+    <GroupBox name="camv">
+     <DoubleSpinBox value="0" name="gain:"/>
+     <DoubleSpinBox value="0" name="exposure:"/>
+     <DoubleSpinBox value="0" name="bright:"/>
+     <DoubleSpinBox value="0" name="contrast:"/>
+     <DoubleSpinBox value="0" name="hue:"/>
+     <DoubleSpinBox value="0" name="sharpness:"/>
+     <DoubleSpinBox value="0" name="saturation:"/>
+     <CheckBox value="1" name="autogain:"/>
+     <CheckBox value="1" name="autoexposure:"/>
+     <CheckBox value="1" name="awb:"/>
+    <Label name="fps"/></GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="1" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="1"/><DoubleSpinBox name="acceleration (absolute):" value="0.8"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.4" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.4" name="sat i:"/>
+     <DoubleSpinBox value="0.4" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-15" name="debattement roll"/>
+     <DoubleSpinBox value="-15" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.5" name="debattement dz"/>
+     <DoubleSpinBox value="0.02" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+<Tab name="predictor"><DataPlot1D name="u_pitch" period="100" enabled="1"/></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="Drone_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.sh
===================================================================
--- tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.sh	(revision 209)
+++ tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.sh	(revision 209)
@@ -0,0 +1,1 @@
+./CircleFollower_rt -a 192.168.6.121 -p 9000 -l /tmp -x CircleFollower_hdsx8.xml -n x8_0 -t hds_x8
Index: tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.xml
===================================================================
--- tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.xml	(revision 209)
+++ tags/latest/demos/Gps/uav/build_arm/bin/CircleFollower_hdsx8.xml	(revision 209)
@@ -0,0 +1,478 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-10" name="debattement roll"/>
+     <DoubleSpinBox value="-10" name="debattement pitch"/>
+     <DoubleSpinBox value="40" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.5" name="debattement dz"/>
+     <DoubleSpinBox value="0.01" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-3"/><DoubleSpinBox name="debattement y" value="3"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <PushButton value="0" name="kill"/>
+  <PushButton value="0" name="start_log"/>
+  <PushButton value="0" name="stop_log"/>
+  <PushButton value="0" name="take_off"/>
+  <PushButton value="0" name="landing"/>
+  <PushButton value="0" name="start_cercle"/>
+  <PushButton value="0" name="stop_cercle"/>
+  <PushButton value="0" name="start_2D"/>
+  <PushButton value="0" name="stop_2D"/>
+  <PushButton value="0" name="Test0"/>
+  <PushButton value="0" name="Test1"/>
+  <PushButton value="0" name="Test11"/>
+  <PushButton value="0" name="Test2"/>
+  <PushButton value="0" name="Test3"/>
+  <PushButton value="0" name="Test4"/>
+  <PushButton value="0" name="Test5"/>
+  <PushButton value="0" name="f1"/>
+  <PushButton value="0" name="f2"/>
+  <PushButton value="0" name="f3"/>
+  <PushButton value="0" name="f4"/>
+  <PushButton value="0" name="f5"/>
+  <PushButton value="0" name="f6"/>
+  <PushButton value="0" name="f7"/>
+  <PushButton value="0" name="f8"/>
+  <PushButton value="0" name="Start_Obs"/>
+ <GridLayout name="buttons"><PushButton name="kill"/><PushButton name="start_log"/><PushButton name="stop_log"/><PushButton name="take_off"/><PushButton name="land"/><PushButton name="f1"/><PushButton name="f2"/><PushButton name="f3"/><PushButton name="f4"/><PushButton name="Reset"/><PushButton name="Start_Obs"/><PushButton name="Optical_flow"/><PushButton name="start_circle"/><PushButton name="stop_circle"/></GridLayout><GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.3"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="multi">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="fault">
+     <DoubleSpinBox value="0.72" name="Coef:"/>
+     <DoubleSpinBox value="0.0025" name="coefficientKf:"/>
+    </GroupBox>
+    <GroupBox name="x8 multiplex">
+     <ComboBox value="1" name="top front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="top front left"/>
+     <ComboBox value="7" name="top front rigth"/>
+     <ComboBox value="4" name="top rear left"/>
+     <ComboBox value="1" name="top rear rigth"/>
+     <ComboBox value="3" name="bottom front left"/>
+     <ComboBox value="5" name="bottom front rigth"/>
+     <ComboBox value="6" name="bottom rear left"/>
+     <ComboBox value="2" name="bottom rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.2" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="1" name="test motor 0"/>
+     <PushButton value="1" name="test motor 1"/>
+     <PushButton value="1" name="test motor 2"/>
+     <PushButton value="1" name="test motor 3"/>
+     <PushButton value="1" name="test motor 4"/>
+     <PushButton value="1" name="test motor 5"/>
+     <PushButton value="1" name="test motor 6"/>
+     <PushButton value="1" name="test motor 7"/>
+    </GroupBox>
+    <GroupBox name="battery">
+     <Label name="battery"/>
+     <DoubleSpinBox value="10" name="threshold"/>
+    </GroupBox>
+    <GroupBox name="Motors">
+     <SpinBox value="14" name="nb poles:"/>
+    </GroupBox>
+    <GroupBox name="startup">
+     <DoubleSpinBox value="0" name="prc_fault:"/>
+     <DoubleSpinBox value="0" name="prc_retab:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="top front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="top rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="bottom rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="SRF08">
+  <TabWidget name="SRF08">
+   <Tab name="Reglages">
+    <GroupBox name="SRF08">
+     <SpinBox value="8" name="gain:"/>
+     <SpinBox value="46" name="range:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.3" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="0.7" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="SRF08" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <PushButton value="0" name="gyros bias"/>
+     <SpinBox value="100" name="data rate (Hz):"/>
+     <Label name="data_rate"/>
+     <SpinBox value="15" name="gyro and acc filter win size:"/>
+     <SpinBox value="17" name="mag filter win size:"/>
+     <SpinBox value="10" name="up compensation (s):"/>
+     <SpinBox value="10" name="north compensation (s):"/>
+     <CheckBox value="1" name="enable Coning&amp;Sculling:"/>
+     <CheckBox value="1" name="disable magnetometer:"/>
+     <CheckBox value="1" name="disable magnetic north compensation:"/>
+     <CheckBox value="1" name="disable gravity compensation:"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="180" name="value"/>
+     <ComboBox value="2" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="10" name="sat ref:"/>
+     <DoubleSpinBox value="10" name="satf ref:"/>
+     <DoubleSpinBox value="10" name="sat2f ref:"/>
+     <DoubleSpinBox value="7" name="kp:"/>
+     <DoubleSpinBox value="7" name="kpf:"/>
+     <DoubleSpinBox value="10" name="kp2f:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="110" name="satf dref:"/>
+     <DoubleSpinBox value="140" name="sat2f dref:"/>
+     <DoubleSpinBox value="0.12" name="kd:"/>
+     <DoubleSpinBox value="0.12" name="kdf:"/>
+     <DoubleSpinBox value="0.13" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+     <DoubleSpinBox value="0.4" name="satf u:"/>
+     <DoubleSpinBox value="0.6" name="sat2f u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="10" name="sat ref:"/>
+     <DoubleSpinBox value="10" name="satf ref:"/>
+     <DoubleSpinBox value="10" name="sat2f ref:"/>
+     <DoubleSpinBox value="7" name="kp:"/>
+     <DoubleSpinBox value="7" name="kpf:"/>
+     <DoubleSpinBox value="10" name="kp2f:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="110" name="satf dref:"/>
+     <DoubleSpinBox value="140" name="sat2f dref:"/>
+     <DoubleSpinBox value="0.12" name="kd:"/>
+     <DoubleSpinBox value="0.12" name="kdf:"/>
+     <DoubleSpinBox value="0.13" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+     <DoubleSpinBox value="0.4" name="satf u:"/>
+     <DoubleSpinBox value="0.6" name="sat2f u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="1.5" name="kpf:"/>
+     <DoubleSpinBox value="2" name="kp2f:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.35" name="kif:"/>
+     <DoubleSpinBox value="0.5" name="ki2f:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.4" name="sat2f i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="kdf:"/>
+     <DoubleSpinBox value="0.3" name="kd2f:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="x_pid">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.01" name="kp:"/>
+     <DoubleSpinBox value="0.015" name="kpf:"/>
+     <DoubleSpinBox value="0.01" name="kp2f:"/>
+     <DoubleSpinBox value="0.03" name="ki:"/>
+     <DoubleSpinBox value="0.035" name="kif:"/>
+     <DoubleSpinBox value="0.02" name="ki2f:"/>
+     <DoubleSpinBox value="0.3" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.3" name="sat2f i:"/>
+     <DoubleSpinBox value="0" name="kd:"/>
+     <DoubleSpinBox value="0" name="kdf:"/>
+     <DoubleSpinBox value="0" name="kd2f:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="y_pid">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.01" name="kp:"/>
+     <DoubleSpinBox value="0.015" name="kpf:"/>
+     <DoubleSpinBox value="0.01" name="kp2f:"/>
+     <DoubleSpinBox value="0.03" name="ki:"/>
+     <DoubleSpinBox value="0.035" name="kif:"/>
+     <DoubleSpinBox value="0.02" name="ki2f:"/>
+     <DoubleSpinBox value="0.3" name="sat i:"/>
+     <DoubleSpinBox value="0.3" name="satf i:"/>
+     <DoubleSpinBox value="0.3" name="sat2f i:"/>
+     <DoubleSpinBox value="0" name="kd:"/>
+     <DoubleSpinBox value="0" name="kdf:"/>
+     <DoubleSpinBox value="0" name="kd2f:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.4" name="kpf:"/>
+     <DoubleSpinBox value="0.5" name="kp2f:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.4" name="kif:"/>
+     <DoubleSpinBox value="0.4" name="ki2f:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.8" name="satf i:"/>
+     <DoubleSpinBox value="0.8" name="sat2f i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.3" name="kdf:"/>
+     <DoubleSpinBox value="0.3" name="kd2f:"/>
+     <DoubleSpinBox value="0.4" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0001" name="offset step:"/>
+    </GroupBox>
+   <GroupBox name="u_x"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0.010"/><DoubleSpinBox name="ki:" value="0.030"/><DoubleSpinBox name="sat i:" value="0.30"/><DoubleSpinBox name="kd:" value="0"/><DoubleSpinBox name="sat:" value="0.50"/></GroupBox><GroupBox name="u_y"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0.010"/><DoubleSpinBox name="ki:" value="0.030"/><DoubleSpinBox name="sat i:" value="0.30"/><DoubleSpinBox name="kd:" value="0"/><DoubleSpinBox name="sat:" value="0.50"/></GroupBox></Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   <DataPlot1D name="x_pid" period="100" enabled="1"/><DataPlot1D name="y_pid" period="100" enabled="1"/><DataPlot1D name="u_x" period="100" enabled="0"/><DataPlot1D name="u_y" period="100" enabled="0"/></Tab>
+   <Tab name="HighOrder">
+    <GroupBox name="HighOrder">
+     <DoubleSpinBox value="1" name="lambda1:"/>
+     <DoubleSpinBox value="1" name="alpha1:"/>
+     <DoubleSpinBox value="1" name="lambda2:"/>
+     <DoubleSpinBox value="1" name="alpha2:"/>
+     <DoubleSpinBox value="1.5" name="lambda3:"/>
+     <DoubleSpinBox value="2" name="alpha3:"/>
+     <DoubleSpinBox value="2" name="lambda11:"/>
+     <DoubleSpinBox value="2" name="alpha11:"/>
+     <DoubleSpinBox value="2" name="lambda21:"/>
+     <DoubleSpinBox value="2" name="alpha21:"/>
+     <DoubleSpinBox value="2.5" name="lambda31:"/>
+     <DoubleSpinBox value="3" name="alpha31:"/>
+     <DoubleSpinBox value="3" name="lambda12:"/>
+     <DoubleSpinBox value="3" name="alpha12:"/>
+     <DoubleSpinBox value="3" name="lambda22:"/>
+     <DoubleSpinBox value="3" name="alpha22:"/>
+     <DoubleSpinBox value="3" name="lambda32:"/>
+     <DoubleSpinBox value="3.5" name="alpha32:"/>
+    </GroupBox>
+    <DataPlot1D name="phi/dphi">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="theta/dtheta">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="psi/dpsi">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="F">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="Filter">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="1" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x8_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x8_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="cercle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="R"/>
+     <DoubleSpinBox value="0.4" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+    <GroupBox name="Cible Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Cible_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+   <GroupBox name="target Passe bas"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="cutoff frequency" value="1"/></GroupBox><GroupBox name="target_euler"><DoubleSpinBox name="period, 0 for auto:" value="0"/></GroupBox><GroupBox name="circle"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="R" value="1.00"/><DoubleSpinBox name="velocity" value="0.50"/><DoubleSpinBox name="acceleration (absolute)" value="0.10"/></GroupBox></Tab>
+   <Tab name="Mesures x8_0">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x8_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures Cible">
+    <DataPlot1D name="x">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) Cible">
+    <DataPlot2D name="xy">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  <Tab name="Mesures target"><DataPlot1D name="x" period="100" enabled="0"/><DataPlot1D name="y" period="100" enabled="0"/><DataPlot1D name="z" period="100" enabled="0"/><DataPlot1D name="vx" period="100" enabled="0"/><DataPlot1D name="vy" period="100" enabled="0"/><DataPlot1D name="vz" period="100" enabled="0"/></Tab><Tab name="Mesures (xy) target"><DataPlot2D name="xy" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="camv"><TabWidget name="camv"><Tab name="Setup"><GroupBox name="camv"><DoubleSpinBox name="gain:" value="0.2"/><DoubleSpinBox name="exposure:" value="0.25"/><DoubleSpinBox name="bright:" value="0.3"/><DoubleSpinBox name="contrast:" value="0.4"/><DoubleSpinBox name="hue:" value="1"/><DoubleSpinBox name="sharpness:" value="0.5"/><DoubleSpinBox name="saturation:" value="0"/><CheckBox name="autogain:" value="0"/><CheckBox name="autoexposure:" value="0"/><CheckBox name="awb:" value="0"/><Label name="fps"/></GroupBox><GridLayout name="setup"><GroupBox name="flux optique"><GroupBox name="post rotation"><DoubleSpinBox name="value" value="-90"/><ComboBox name="axis" value="2"/></GroupBox><SpinBox name="max features:" value="64"/></GroupBox><GroupBox name="passe bas"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="cutoff frequency" value="5"/></GroupBox></GridLayout></Tab><Tab name="Picture"><Picture name="camv" period="200" enabled="0"/></Tab></TabWidget></Tab><Tab name="flux optique"><DataPlot1D name="x_velocity" period="100" enabled="0"/><DataPlot1D name="y_velocity" period="100" enabled="0"/></Tab><Tab name="motors"><TabWidget name="UavMultiplex"><Tab name="Setup"><GroupBox name="x8 multiplex"><ComboBox name="top front left blade pitch:" value="1"/></GroupBox><GroupBox name="motor attribution"><ComboBox name="top front left" value="0"/><ComboBox name="top front rigth" value="7"/><ComboBox name="top rear left" value="4"/><ComboBox name="top rear rigth" value="1"/><ComboBox name="bottom front left" value="3"/><ComboBox name="bottom front rigth" value="5"/><ComboBox name="bottom rear left" value="6"/><ComboBox name="bottom rear rigth" value="2"/></GroupBox><GroupBox name="bldc"><Label name="flight time"/><DoubleSpinBox name="min value:" value="0.20"/><DoubleSpinBox name="max value:" value="1.00"/><DoubleSpinBox name="test value:" value="0.10"/><PushButton name="test motor 0"/><PushButton name="test motor 1"/><PushButton name="test motor 2"/><PushButton name="test motor 3"/><PushButton name="test motor 4"/><PushButton name="test motor 5"/><PushButton name="test motor 6"/><PushButton name="test motor 7"/></GroupBox><GroupBox name="battery"><Label name="battery"/><DoubleSpinBox name="threshold" value="10.0"/></GroupBox><GroupBox name="Motors"><SpinBox name="nb poles:" value="14"/></GroupBox></Tab><Tab name="Values"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab><Tab name="Speeds"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab><Tab name="Currents"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab></TabWidget></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,361 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interfac">
+<TabWidget name="Main_TabWidget">
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    <DoubleSpinBox name="debattement wz" value="90"/></GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Currents"><DataPlot1D name="front left" period="100" enabled="0"/><DataPlot1D name="front right" period="100" enabled="0"/><DataPlot1D name="rear left" period="100" enabled="0"/><DataPlot1D name="rear right" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="1" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="1"/><DataPlot1D name="q1" period="100" enabled="1"/><DataPlot1D name="q2" period="100" enabled="1"/><DataPlot1D name="q3" period="100" enabled="1"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x4_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x4_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.5" name="R"/>
+     <DoubleSpinBox value="1" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures x4_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x4_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="land"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  </GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+<Tab name="Dualshock3"><TabWidget name="Dualshock3"><Tab name="Reglages"><GroupBox name="consignes joy"><DoubleSpinBox name="debattement roll" value="-30"/><DoubleSpinBox name="debattement pitch" value="-30"/><DoubleSpinBox name="debattement wz" value="0"/><DoubleSpinBox name="debattement dz" value="0"/><DoubleSpinBox name="trim" value="0"/><Label name="trim roll"/><PushButton name="reset roll trim"/><Label name="trim pitch"/><PushButton name="reset pitch trim"/></GroupBox></Tab></TabWidget></Tab><Tab name="gps"><TabWidget name="gps"><Tab name="Setup"><GroupBox name="gps"><PushButton name="set ref"/><Label name="nb_sat"/><Label name="fix"/><SpinBox name="data rate" value="5"/><DoubleSpinBox name="latitude ref" value="49.402313"/><DoubleSpinBox name="longitude ref" value="2.795463"/><DoubleSpinBox name="altitude ref" value="0"/><SpinBox name="fix quality" value="1"/><SpinBox name="number of satellites" value="5"/></GroupBox><GroupBox name="circle"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="R" value="0"/><DoubleSpinBox name="velocity" value="0"/><DoubleSpinBox name="acceleration (absolute)" value="0"/></GroupBox></Tab><Tab name="Mesures"><DataPlot1D name="e" period="100" enabled="0"/><DataPlot1D name="n" period="100" enabled="0"/><DataPlot1D name="u" period="100" enabled="0"/><DataPlot1D name="ve" period="100" enabled="1"/><DataPlot1D name="vn" period="100" enabled="1"/></Tab><Tab name="carte"><Map name="map" period="100" enabled="1" long0="1.532034873962402" lat0="49.35582442393555"/></Tab></TabWidget></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x4_0)" value="1"/></root>
Index: tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/Gps/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,342 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x8 multiplex">
+     <ComboBox value="0" name="top front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="top front left"/>
+     <ComboBox value="1" name="top front rigth"/>
+     <ComboBox value="2" name="top rear left"/>
+     <ComboBox value="3" name="top rear rigth"/>
+     <ComboBox value="4" name="bottom front left"/>
+     <ComboBox value="5" name="bottom front rigth"/>
+     <ComboBox value="6" name="bottom rear left"/>
+     <ComboBox value="7" name="bottom rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+     <PushButton value="0" name="test motor 4"/>
+     <PushButton value="0" name="test motor 5"/>
+     <PushButton value="0" name="test motor 6"/>
+     <PushButton value="0" name="test motor 7"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="1" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x8_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x8_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.5" name="R"/>
+     <DoubleSpinBox value="1" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures x8_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x8_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.5"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15.00" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="15.00" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x8_0)" value="1"/></root>
Index: tags/latest/demos/Gps/uav/build_x86_64/bin/x4.sh
===================================================================
--- tags/latest/demos/Gps/uav/build_x86_64/bin/x4.sh	(revision 209)
+++ tags/latest/demos/Gps/uav/build_x86_64/bin/x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./DemoGps_rt
+else
+	EXEC=./DemoGps_nrt
+fi
+
+$EXEC -n x4_0 -a 127.0.0.1 -p 9000 -l /tmp -x setup_x4.xml -t x4_simu
Index: tags/latest/demos/Gps/uav/build_x86_64/bin/x8.sh
===================================================================
--- tags/latest/demos/Gps/uav/build_x86_64/bin/x8.sh	(revision 209)
+++ tags/latest/demos/Gps/uav/build_x86_64/bin/x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./DemoGps_rt
+else
+	EXEC=./DemoGps_nrt
+fi
+
+$EXEC -n x8_0 -a 127.0.0.1 -p 9000 -l ./ -x setup_x8.xml -t x8_simu
Index: tags/latest/demos/Gps/uav/src/DemoGps.cpp
===================================================================
--- tags/latest/demos/Gps/uav/src/DemoGps.cpp	(revision 209)
+++ tags/latest/demos/Gps/uav/src/DemoGps.cpp	(revision 209)
@@ -0,0 +1,213 @@
+//  created:    2016/07/01
+//  filename:   DemoGps.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo GPS
+//
+//
+/*********************************************************************/
+
+#include "DemoGps.h"
+#include <TargetController.h>
+#include <Uav.h>
+#include <GridLayout.h>
+#include <PushButton.h>
+#include <DataPlot1D.h>
+#include <DataPlot2D.h>
+#include <MetaDualShock3.h>
+#include <FrameworkManager.h>
+#include <TrajectoryGenerator2DCircle.h>
+#include <cvmatrix.h>
+#include <cmath>
+#include <Tab.h>
+#include <Pid.h>
+#include <Ahrs.h>
+#include <AhrsData.h>
+#include <RTDM_SerialPort.h>
+#include <Imu.h>
+#include <NmeaGps.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::meta;
+
+DemoGps::DemoGps(TargetController* controller)
+    : UavStateMachine(controller)
+    , behaviourMode(BehaviourMode_t::Default) {
+  Uav* uav = GetUav();
+  startCircle = new PushButton(GetButtonsLayout()->NewRow(), "start_circle");
+  stopCircle = new PushButton(GetButtonsLayout()->LastRowLastCol(), "stop_circle");
+
+  circle = new TrajectoryGenerator2DCircle(uav->GetGps()->GetLayout()->NewRow(), "circle");
+  // todo: add graphs in gps plot
+  /*
+  uav->GetVrpnObject()->xPlot()->AddCurve(circle->Matrix()->Element(0,0),DataPlot::Blue);
+  uav->GetVrpnObject()->yPlot()->AddCurve(circle->Matrix()->Element(0,1),DataPlot::Blue);
+  uav->GetVrpnObject()->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),DataPlot::Blue);
+  uav->GetVrpnObject()->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),DataPlot::Blue);
+  uav->GetVrpnObject()->XyPlot()->AddCurve(circle->Matrix()->Element(0,1),circle->Matrix()->Element(0,0),DataPlot::Blue,"circle");*/
+
+  uX = new Pid(setupLawTab->At(1, 0), "u_x");
+  uX->UseDefaultPlot(graphLawTab->NewRow());
+  uY = new Pid(setupLawTab->At(1, 1), "u_y");
+  uY->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+  customReferenceOrientation = new AhrsData(this, "reference");
+  uav->GetAhrs()->AddPlot(customReferenceOrientation, DataPlot::Yellow);
+  AddDataToControlLawLog(customReferenceOrientation);
+
+  customOrientation = new AhrsData(this, "orientation");
+}
+
+DemoGps::~DemoGps() {
+}
+
+AhrsData* DemoGps::GetReferenceOrientation(void) {
+  Vector2Df pos_err, vel_err; // in Uav coordinate system
+  float yaw_ref;
+  Euler refAngles;
+
+  PositionValues(pos_err, vel_err, yaw_ref);
+
+  refAngles.yaw = yaw_ref;
+
+  uX->SetValues(pos_err.x, vel_err.x);
+  uX->Update(GetTime());
+  refAngles.pitch = uX->Output();
+
+  uY->SetValues(pos_err.y, vel_err.y);
+  uY->Update(GetTime());
+  refAngles.roll = -uY->Output();
+
+  customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(), Vector3Df(0, 0, 0));
+
+  return customReferenceOrientation;
+}
+
+void DemoGps::PositionValues(Vector2Df& pos_error, Vector2Df& vel_error, float& yaw_ref) {
+  Vector3Df uav_pos, uav_vel;
+  Vector2Df uav_2Dpos, uav_2Dvel;
+
+  // TODO GPS position and circle center
+  // GetUav()->GetVrpnObject()->GetPosition(uav_pos);
+  // GetUav()->GetVrpnObject()->GetSpeed(uav_vel);
+
+  uav_pos.To2Dxy(uav_2Dpos);
+  uav_vel.To2Dxy(uav_2Dvel);
+
+  if(behaviourMode == BehaviourMode_t::PositionHold) {
+    pos_error = uav_2Dpos - posHold;
+    vel_error = uav_2Dvel;
+    yaw_ref = yawHold;
+  } else { // Circle
+    Vector2Df circle_pos, circle_vel;
+    Vector2Df target_2Dpos;
+
+    circle->SetCenter(target_2Dpos);
+
+    // circle reference
+    circle->Update(GetTime());
+    circle->GetPosition(circle_pos);
+    circle->GetSpeed(circle_vel);
+
+    // error in optitrack frame
+    pos_error = uav_2Dpos - circle_pos;
+    vel_error = uav_2Dvel - circle_vel;
+    yaw_ref = atan2(target_2Dpos.y - uav_pos.y, target_2Dpos.x - uav_pos.x);
+  }
+
+  // error in uav frame
+  Quaternion currentQuaternion = GetCurrentQuaternion();
+  Euler currentAngles; // in vrpn frame
+  currentQuaternion.ToEuler(currentAngles);
+  pos_error.Rotate(-currentAngles.yaw);
+  vel_error.Rotate(-currentAngles.yaw);
+}
+
+void DemoGps::SignalEvent(Event_t event) {
+  UavStateMachine::SignalEvent(event);
+  switch(event) {
+  case Event_t::TakingOff:
+    behaviourMode = BehaviourMode_t::Default;
+    break;
+  case Event_t::EnteringControlLoop:
+    if((behaviourMode == BehaviourMode_t::Circle) && (!circle->IsRunning())) {
+      GpsPositionHold();
+    }
+    break;
+  case Event_t::EnteringFailSafeMode:
+    behaviourMode = BehaviourMode_t::Default;
+    break;
+  }
+}
+
+void DemoGps::ExtraSecurityCheck(void) {
+}
+
+void DemoGps::ExtraCheckPushButton(void) {
+  if(startCircle->Clicked() && (behaviourMode != BehaviourMode_t::Circle)) {
+    StartCircle();
+  }
+  if(stopCircle->Clicked() && (behaviourMode == BehaviourMode_t::Circle)) {
+    StopCircle();
+  }
+}
+
+void DemoGps::ExtraCheckJoystick(void) {
+  // R1 and Circle
+  if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(4) &&
+     (behaviourMode != BehaviourMode_t::Circle)) {
+    StartCircle();
+  }
+
+  // R1 and Cross
+  if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(5) &&
+     (behaviourMode == BehaviourMode_t::Circle)) {
+    StopCircle();
+  }
+}
+
+void DemoGps::StartCircle(void) {
+  if(SetOrientationMode(OrientationMode_t::Custom)) {
+    Thread::Info("DemoGps: start circle\n");
+  } else {
+    Thread::Warn("DemoGps: could not start circle\n");
+    return;
+  }
+  Vector3Df uav_pos;
+  Vector2Df uav_2Dpos, target_2Dpos;
+
+  circle->SetCenter(target_2Dpos);
+
+  // todo get uav and circle pos by gps
+  uav_pos.To2Dxy(uav_2Dpos);
+  circle->StartTraj(uav_2Dpos);
+
+  uX->Reset();
+  uY->Reset();
+  behaviourMode = BehaviourMode_t::Circle;
+}
+
+void DemoGps::StopCircle(void) {
+  circle->FinishTraj();
+  // GetJoystick()->Rumble(0x70);
+  Thread::Info("DemoGps: finishing circle\n");
+}
+
+void DemoGps::GpsPositionHold(void) {
+
+  // tood set yawHold and posHold
+
+  uX->Reset();
+  uY->Reset();
+  behaviourMode = BehaviourMode_t::PositionHold;
+  SetOrientationMode(OrientationMode_t::Custom);
+  Thread::Info("DemoGps: holding position\n");
+}
Index: tags/latest/demos/Gps/uav/src/DemoGps.h
===================================================================
--- tags/latest/demos/Gps/uav/src/DemoGps.h	(revision 209)
+++ tags/latest/demos/Gps/uav/src/DemoGps.h	(revision 209)
@@ -0,0 +1,65 @@
+//  created:    2016/07/01
+//  filename:   DemoGps.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo GPS
+//
+//
+/*********************************************************************/
+
+#ifndef DEMOGPS_H
+#define DEMOGPS_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+    namespace gui {
+        class PushButton;
+    }
+    namespace filter {
+        class TrajectoryGenerator2DCircle;
+    }
+    namespace sensor {
+        class TargetController;
+    }
+}
+
+class DemoGps : public flair::meta::UavStateMachine {
+    public:
+        DemoGps(flair::sensor::TargetController *controller);
+        ~DemoGps();
+
+    private:
+        enum class BehaviourMode_t {
+            Default,
+            PositionHold,
+            Circle
+        };
+
+        BehaviourMode_t behaviourMode;
+
+        void GpsPositionHold(void);
+        void StartCircle(void);
+        void StopCircle(void);
+        void ExtraSecurityCheck(void);
+        void ExtraCheckPushButton(void);
+        void ExtraCheckJoystick(void);
+        void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
+        flair::core::AhrsData *GetReferenceOrientation(void);
+        void SignalEvent(Event_t event);
+
+        flair::filter::Pid *uX, *uY;
+
+        flair::core::Vector2Df posHold;
+        float yawHold;
+
+        flair::gui::PushButton *startCircle,*stopCircle;
+        flair::filter::TrajectoryGenerator2DCircle *circle;
+        flair::core::AhrsData *customReferenceOrientation,*customOrientation;
+};
+
+#endif // DEMOGPS_H
Index: tags/latest/demos/Gps/uav/src/main.cpp
===================================================================
--- tags/latest/demos/Gps/uav/src/main.cpp	(revision 209)
+++ tags/latest/demos/Gps/uav/src/main.cpp	(revision 209)
@@ -0,0 +1,97 @@
+//  created:    2011/05/01
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code uav
+//
+//
+/*********************************************************************/
+
+#include "DemoGps.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+#include <TargetEthController.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+    manager->SetupLogger(log_path);
+
+    Uav* drone=CreateUav(name,uav_type,"use_gps=true");
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    DemoGps* demo=new DemoGps(controller);
+
+    demo->Start();
+    demo->Join();
+
+    delete manager;
+}
+
+void parseOptions(int argc, char** argv) {
+	try {
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, x4_simu, x8_simu or x4_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        uav_type=typeArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e) { // catch any exceptions
+        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+	}
+}
Index: tags/latest/demos/HelloWorld/CMakeLists.txt
===================================================================
--- tags/latest/demos/HelloWorld/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/HelloWorld/CMakeLists.txt	(revision 209)
@@ -0,0 +1,14 @@
+PROJECT(HelloWorld)
+cmake_minimum_required(VERSION 2.8)
+
+ADD_EXECUTABLE(${PROJECT_NAME}  
+	src/main.c
+)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_custom_target(
+    delivery
+    COMMAND make
+    COMMAND scp bin/${PROJECT_NAME} root@192.168.6.1:/home/root/
+)
Index: tags/latest/demos/HelloWorld/src/main.c
===================================================================
--- tags/latest/demos/HelloWorld/src/main.c	(revision 209)
+++ tags/latest/demos/HelloWorld/src/main.c	(revision 209)
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main (int argc, char **argv) {
+	printf("Hello world !\n");
+	return 0;
+}
+
Index: tags/latest/demos/OpticalFlow/simulator/CMakeLists.txt
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,36 @@
+PROJECT(OpticalFlow_simulator)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_SIMULATOR TRUE)
+SET(FLAIR_USE_SIMULATOR_GL TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+)
+
+LINK_DIRECTORIES (
+	${FLAIR_LIBRARY_DIR}
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x4_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-3.5" name="z:"/>
+    <SpinBox value="0" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.2" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+  </TabWidget>
+ </Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x8_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-1.2" name="z:"/>
+    <SpinBox value="20" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.6" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0" name="position G (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+    <DoubleSpinBox value="0" name="j_r:"/>
+    <DoubleSpinBox value="0.72" name="sigma:"/>
+    <DoubleSpinBox value="1" name="S:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x4.sh
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libdrm_intel.so.1:/usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2:/usr/lib/x86_64-linux-gnu/libdrm_radeon.so.1
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./OpticalFlow_simulator_rt
+else
+	EXEC=./OpticalFlow_simulator_nrt
+fi
+
+$EXEC -n x4_0 -t x4 -a 127.0.0.1 -p 9000 -x setup_x4.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x8.sh
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./OpticalFlow_simulator_rt
+else
+	EXEC=./OpticalFlow_simulator_nrt
+fi
+
+$EXEC -n x8_0 -t x8 -a 127.0.0.1 -p 9000 -x setup_x8.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/OpticalFlow/simulator/src/main.cpp
===================================================================
--- tags/latest/demos/OpticalFlow/simulator/src/main.cpp	(revision 209)
+++ tags/latest/demos/OpticalFlow/simulator/src/main.cpp	(revision 209)
@@ -0,0 +1,128 @@
+//  created:    2012/04/18
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main simulateur
+//
+//
+/*********************************************************************/
+
+#include <tclap/CmdLine.h>
+#include <Simulator.h>
+#include <X4.h>
+#include <X8.h>
+#include <SimuImu.h>
+#ifdef GL
+#include <SimuCameraGL.h>
+#include <Parser.h>
+#include <SimuUsGL.h>
+#endif
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::simulator;
+using namespace flair::sensor;
+
+int port;
+int opti_time;
+string xml_file;
+string media_path;
+string scene_file;
+string type;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv)
+{
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> nameArg("n", "name", "uav name, also used for vrpn", true, "x4", "string");
+    cmd.add(nameArg);
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./reglages.xml", "string");
+    cmd.add(xmlArg);
+
+    ValueArg<int> portArg("p", "port", "ground station port", true, 9002, "int");
+    cmd.add(portArg);
+
+    ValueArg<string> addressArg("a", "address", "ground station address", true, "127.0.0.1", "string");
+    cmd.add(addressArg);
+
+    ValueArg<string> typeArg("t", "type", "uav type, x4 or x8", true, "x4", "string");
+    cmd.add(typeArg);
+
+    ValueArg<int> optiArg("o", "opti", "optitrack time ms", false, 0, "int");
+    cmd.add(optiArg);
+
+#ifdef GL
+    ValueArg<string> mediaArg("m", "media", "path to media files", true, "./", "string");
+    cmd.add(mediaArg);
+
+    ValueArg<string> sceneArg("s", "scene", "path to scene file", true, "./voliere.xml", "string");
+    cmd.add(sceneArg);
+#endif
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    port = portArg.getValue();
+    xml_file = xmlArg.getValue();
+    opti_time = optiArg.getValue();
+    type = typeArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
+#ifdef GL
+    media_path = mediaArg.getValue();
+    scene_file = sceneArg.getValue();
+#endif
+
+  } catch(ArgException& e) // catch any exceptions
+  {
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
+
+int main(int argc, char* argv[])
+{
+  Simulator* simu;
+  Model* drone;
+  SimuImu* imu;
+#ifdef GL
+  SimuUsGL* us_gl;
+
+  SimuCameraGL* cam_bas;
+  Parser* gui;
+#endif
+  parseOptions(argc, argv);
+
+  simu = new Simulator("simulator", opti_time, 90);
+  simu->SetupConnection(address, port);
+  simu->SetupUserInterface(xml_file);
+
+#ifdef GL
+  gui = new Parser(960, 480, 640, 480, media_path, scene_file);
+#endif
+
+  if(type == "x4") {
+    drone = new X4(name, 0);
+  } else {
+    drone = new X8(name, 0);
+  }
+  imu = new SimuImu(drone, "imu", 0,0);
+
+#ifdef GL
+  us_gl = new SimuUsGL(drone, "us", 0,0);
+  cam_bas = new SimuCameraGL(drone, "bottom camera", 320, 240, 640, 0, 0,0);
+#endif
+
+  simu->RunSimu();
+
+  delete simu;
+
+  return 0;
+}
Index: tags/latest/demos/OpticalFlow/uav/CMakeLists.txt
===================================================================
--- tags/latest/demos/OpticalFlow/uav/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/CMakeLists.txt	(revision 209)
@@ -0,0 +1,34 @@
+PROJECT(OpticalFlow)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/DemoOpticalFlow.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.sh
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.sh	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.sh	(revision 209)
@@ -0,0 +1,1 @@
+./OpticalFlow_nrt -a 192.168.147.217 -p 9000 -l /tmp -x OpticalFlow_ardrone2.xml -n Drone_0 -t ardrone2 -v ./dspcv_dsp.out
Index: tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.xml
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.xml	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_arm/bin/OpticalFlow_ardrone2.xml	(revision 209)
@@ -0,0 +1,267 @@
+<?xml version="1.0"?>
+<root name="FrameworkManager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="x4-multiplex">
+      <TabWidget name="UavMultiplex">
+        <Tab name="Setup">
+          <GroupBox name="x4 multiplex">
+            <ComboBox name="front left blade pitch:" value="1"/>
+          </GroupBox>
+          <GroupBox name="motor attribution">
+            <ComboBox name="front left" value="0"/>
+            <ComboBox name="front rigth" value="1"/>
+            <ComboBox name="rear left" value="2"/>
+            <ComboBox name="rear rigth" value="3"/>
+          </GroupBox>
+          <GroupBox name="bldc">
+            <Label name="flight time"/>
+            <DoubleSpinBox name="min value:" value="0.4"/>
+            <DoubleSpinBox name="max value:" value="1"/>
+            <DoubleSpinBox name="test value:" value="0.2"/>
+            <PushButton name="test motor 0"/>
+            <PushButton name="test motor 1"/>
+            <PushButton name="test motor 2"/>
+            <PushButton name="test motor 3"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Values">
+          <DataPlot1D name="front left" period="100" enabled="0"/>
+          <DataPlot1D name="front right" period="100" enabled="0"/>
+          <DataPlot1D name="rear left" period="100" enabled="0"/>
+          <DataPlot1D name="rear right" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="parrot-us">
+      <TabWidget name="parrot-us">
+        <Tab name="Reglages">
+          <GroupBox name="parrot-us"/>
+          <GroupBox name="Passe bas">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="5"/>
+          </GroupBox>
+          <GroupBox name="Vz">
+            <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+          </GroupBox>
+          <GroupBox name="Passe bas v">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="10"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Mesures">
+          <DataPlot1D name="parrot-us" period="100" enabled="0"/>
+          <DataPlot1D name="vz" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="parrot-imu">
+      <TabWidget name="parrot-imu">
+        <Tab name="Reglages">
+          <GroupBox name="parrot-imu"/>
+          <GroupBox name="post rotation">
+            <DoubleSpinBox name="value" value="0"/>
+            <ComboBox name="axis" value="0"/>
+          </GroupBox>
+          <DoubleSpinBox name="k_a[0]:" value="0.5"/>
+          <DoubleSpinBox name="k_a[1]:" value="0.5"/>
+          <DoubleSpinBox name="k_a[2]:" value="0"/>
+          <DoubleSpinBox name="k_b[0]:" value="0.01"/>
+          <DoubleSpinBox name="k_b[1]:" value="0.01"/>
+          <DoubleSpinBox name="k_b[2]:" value="0.01"/>
+        </Tab>
+        <Tab name="AHRS">
+          <DataPlot1D name="roll" period="100" enabled="0"/>
+          <DataPlot1D name="pitch" period="100" enabled="0"/>
+          <DataPlot1D name="yaw" period="100" enabled="0"/>
+          <DataPlot1D name="w_x" period="100" enabled="0"/>
+          <DataPlot1D name="w_y" period="100" enabled="0"/>
+          <DataPlot1D name="w_z" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="IMU">
+          <DataPlot1D name="acc_x" period="100" enabled="0"/>
+          <DataPlot1D name="acc_y" period="100" enabled="0"/>
+          <DataPlot1D name="acc_z" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_x" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_y" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_z" period="100" enabled="0"/>
+          <DataPlot1D name="mag_x" period="100" enabled="0"/>
+          <DataPlot1D name="mag_y" period="100" enabled="0"/>
+          <DataPlot1D name="mag_z" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="battery">
+      <GroupBox name="battery">
+        <Label name="battery"/>
+        <DoubleSpinBox name="threshold" value="10.5"/>
+      </GroupBox>
+    </Tab>
+    <Tab name="camv">
+      <TabWidget name="camv">
+        <Tab name="Setup">
+          <GroupBox name="camv">
+            <DoubleSpinBox name="gain:" value="0.5"/>
+            <DoubleSpinBox name="exposure:" value="0.5"/>
+            <DoubleSpinBox name="bright:" value="0.5"/>
+            <DoubleSpinBox name="contrast:" value="0.5"/>
+            <DoubleSpinBox name="hue:" value="0.5"/>
+            <DoubleSpinBox name="sharpness:" value="0.5"/>
+            <DoubleSpinBox name="saturation:" value="0.5"/>
+            <CheckBox name="autogain:" value="1"/>
+            <CheckBox name="autoexposure:" value="1"/>
+            <CheckBox name="awb:" value="1"/>
+          <Label name="fps"/></GroupBox>
+          <GridLayout name="setup">
+            <GroupBox name="flux optique">
+              <GroupBox name="post rotation">
+                <DoubleSpinBox name="value" value="90"/>
+                <ComboBox name="axis" value="2"/>
+              </GroupBox>
+              <SpinBox name="max features:" value="64"/>
+            </GroupBox>
+            <GroupBox name="passe bas">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="2"/>
+            </GroupBox>
+            <GroupBox name="sobel along x">
+              <SpinBox name="dx:" value="1"/>
+              <SpinBox name="dy:" value="0"/>
+            </GroupBox>
+            <GroupBox name="threshold">
+              <SpinBox name="threshold:" value="127"/>
+            </GroupBox>
+            <GroupBox name="houghlines">
+              <SpinBox name="full rho step:" value="4"/>
+              <DoubleSpinBox name="full theta step:" value="4"/>
+              <SpinBox name="tracking rho step:" value="4"/>
+              <DoubleSpinBox name="tracking theta step:" value="1"/>
+              <DoubleSpinBox name="tracking delta theta:" value="10"/>
+              <SpinBox name="nb points:" value="100"/>
+            </GroupBox>
+          </GridLayout>
+        </Tab>
+        <Tab name="Picture">
+          <Picture name="camv" period="500" enabled="0"/>
+          <Picture name="sobel along x" period="500" enabled="0"/>
+          <Picture name="threshold" period="500" enabled="0"/>
+          <GridLayout name="hough">
+            <DataPlot1D name="distance" period="100" enabled="1"/>
+            <DataPlot1D name="orientation" period="100" enabled="1"/>
+            <DataPlot1D name="line detected" period="100" enabled="1"/>
+          </GridLayout>
+        <DataPlot1D name="distance" period="100" enabled="1"/><DataPlot1D name="orientation" period="100" enabled="1"/><DataPlot1D name="line detected" period="100" enabled="1"/></Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="uav">
+      <GridLayout name="buttons">
+        <PushButton name="kill"/>
+        <PushButton name="start_log"/>
+        <PushButton name="stop_log"/>
+        <PushButton name="take_off"/>
+        <PushButton name="land"/>
+      </GridLayout>
+      <GroupBox name="takeoff/landing">
+        <DoubleSpinBox name="desired takeoff altitude" value="0.7"/>
+        <DoubleSpinBox name="desired landing altitude" value="0"/>
+      </GroupBox>
+      <GroupBox name="alt cons">
+        <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+        <DoubleSpinBox name="velocity max (absolute):" value="1"/>
+        <DoubleSpinBox name="acceleration (absolute):" value="0.8"/>
+      </GroupBox>
+    </Tab>
+    <Tab name="control laws">
+      <TabWidget name="laws">
+        <Tab name="Setup">
+          <GroupBox name="u_roll">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="12"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat u:" value="0.4"/>
+          </GroupBox>
+          <GroupBox name="u_pitch">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="12"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat u:" value="0.4"/>
+          </GroupBox>
+          <GroupBox name="u_yaw">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.6"/>
+            <DoubleSpinBox name="ki:" value="0.1"/>
+            <DoubleSpinBox name="sat i:" value="0.2"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat:" value="0.5"/>
+          </GroupBox>
+          <GroupBox name="u_z">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.6"/>
+            <DoubleSpinBox name="ki:" value="0.2"/>
+            <DoubleSpinBox name="sat i:" value="0.4"/>
+            <DoubleSpinBox name="kd:" value="0.4"/>
+            <DoubleSpinBox name="offset g:" value="0.6"/>
+            <DoubleSpinBox name="sat:" value="1"/>
+            <DoubleSpinBox name="offset step:" value="0.0002"/>
+          </GroupBox>
+          <GroupBox name="u_x">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.015"/>
+            <DoubleSpinBox name="ki:" value="0.02"/>
+            <DoubleSpinBox name="sat i:" value="0.15"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0.3"/>
+          </GroupBox>
+          <GroupBox name="u_y">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.015"/>
+            <DoubleSpinBox name="ki:" value="0.02"/>
+            <DoubleSpinBox name="sat i:" value="0.15"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0.3"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Graphes">
+          <DataPlot1D name="u_roll" period="100" enabled="0"/>
+          <DataPlot1D name="u_pitch" period="100" enabled="0"/>
+          <DataPlot1D name="u_yaw" period="100" enabled="0"/>
+          <DataPlot1D name="u_z" period="100" enabled="1"/>
+          <DataPlot1D name="u_x" period="100" enabled="1"/>
+          <DataPlot1D name="u_y" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="Dualshock3">
+      <TabWidget name="Dualshock3">
+        <Tab name="Reglages">
+          <GroupBox name="consignes joy">
+            <DoubleSpinBox name="debattement roll" value="-15"/>
+            <DoubleSpinBox name="debattement pitch" value="-15"/>
+            <DoubleSpinBox name="debattement wz" value="90"/>
+            <DoubleSpinBox name="debattement dz" value="-0.5"/>
+            <DoubleSpinBox name="trim" value="0.02"/>
+            <Label name="trim roll"/>
+            <PushButton name="reset roll trim"/>
+            <Label name="trim pitch"/>
+            <PushButton name="reset pitch trim"/>
+          </GroupBox>
+          <GroupBox name="consignes fo">
+            <DoubleSpinBox name="debattement x" value="0"/>
+            <DoubleSpinBox name="debattement y" value="0"/>
+            <DoubleSpinBox name="speed step" value="5"/>
+          </GroupBox>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="flux optique">
+      <DataPlot1D name="x_velocity" period="100" enabled="1"/>
+      <DataPlot1D name="y_velocity" period="100" enabled="1"/>
+    </Tab>
+  </TabWidget>
+  <TabWidget name="App_TabWidget">
+    <Tab name="demo_line">
+      <PushButton name="save config on target" value="1"/>
+    </Tab>
+  <Tab name="Drone_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget>
+</root>
Index: tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,287 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-10" name="debattement roll"/>
+     <DoubleSpinBox value="-10" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-1"/><DoubleSpinBox name="debattement y" value="1"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="0"/><DataPlot1D name="q1" period="100" enabled="0"/><DataPlot1D name="q2" period="100" enabled="0"/><DataPlot1D name="q3" period="100" enabled="0"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="0" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     <GroupBox name="post rotation"><DoubleSpinBox name="value" value="90"/><ComboBox name="axis" value="2"/></GroupBox></GroupBox>
+     <GroupBox name="passe bas">
+      <DoubleSpinBox value="0" name="period, 0 for auto"/>
+      <DoubleSpinBox value="1" name="cutoff frequency"/>
+     </GroupBox>
+    <GroupBox name="derivative"><DoubleSpinBox name="period, 0 for auto:" value="0.02"/></GroupBox><GroupBox name="Speed lowPass"><DoubleSpinBox name="period, 0 for auto" value="0.02"/><DoubleSpinBox name="cutoff frequency" value="2"/></GroupBox><GroupBox name="Acceleration lowPass"><DoubleSpinBox name="period, 0 for auto" value="0.02"/><DoubleSpinBox name="cutoff frequency" value="2"/></GroupBox><GroupBox name="flux optique compens&#xE9;"><SpinBox name="gyro delay (in video frames):" value="2"/></GroupBox></GridLayout>
+   </Tab>
+   <Tab name="Picture">
+    <Picture name="simu_cam_v" period="200" enabled="0">
+     <Setup period="50" enabled="1"/>
+    </Picture>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="1" name="take_off"/>
+   <PushButton value="0" name="land"/>
+  <PushButton name="start optical flow"/></GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="1" name="sat i:"/>
+     <DoubleSpinBox value="0.005" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="1" name="sat i:"/>
+     <DoubleSpinBox value="0.005" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="flux optique">
+  <DataPlot1D name="x_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+  <DataPlot1D name="y_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+ <DataPlot1D name="x_velocity_derivative" period="100" enabled="1"/><DataPlot1D name="y_velocity_derivative" period="100" enabled="1"/><DataPlot1D name="x_acceleration" period="100" enabled="1"/><DataPlot1D name="y_acceleration" period="100" enabled="1"/><DataPlot1D name="x speed (px/s)" period="100" enabled="1"/><DataPlot1D name="y speed (px/s)" period="100" enabled="1"/><DataPlot1D name="x movement first point" period="100" enabled="0"/><DataPlot1D name="y movement first point" period="100" enabled="0"/></Tab>
+  <Tab name="real speed"><DataPlot1D name="x speed (m/s)" period="100" enabled="1"/><DataPlot1D name="y speed (m/s)" period="100" enabled="1"/><DataPlot1D name="x acceleration (m/s2)" period="100" enabled="0"/><DataPlot1D name="y acceleration (m/s2)" period="100" enabled="0"/></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x4_0)" value="1"/></root>
Index: tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,287 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-1"/><DoubleSpinBox name="debattement y" value="1"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    <ComboBox name="top front left" value="0"/><ComboBox name="top front rigth" value="1"/><ComboBox name="top rear left" value="2"/><ComboBox name="top rear rigth" value="3"/><ComboBox name="bottom front left" value="4"/><ComboBox name="bottom front rigth" value="5"/><ComboBox name="bottom rear left" value="6"/><ComboBox name="bottom rear rigth" value="7"/></GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    <PushButton name="test motor 4"/><PushButton name="test motor 5"/><PushButton name="test motor 6"/><PushButton name="test motor 7"/></GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   <GroupBox name="x8 multiplex"><ComboBox name="top front left blade pitch:" value="0"/></GroupBox></Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="0" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     <GroupBox name="post rotation"><DoubleSpinBox name="value" value="90"/><ComboBox name="axis" value="2"/></GroupBox></GroupBox>
+     <GroupBox name="passe bas">
+      <DoubleSpinBox value="0" name="period, 0 for auto"/>
+      <DoubleSpinBox value="1" name="cutoff frequency"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="Picture">
+    <Picture name="simu_cam_v">
+     <Setup period="50" enabled="1"/>
+    </Picture>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="1" name="take_off"/>
+   <PushButton value="0" name="land"/>
+  </GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.03" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.03" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="flux optique">
+  <DataPlot1D name="x_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+  <DataPlot1D name="y_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+ </Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x4.sh
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x4.sh	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./OpticalFlow_rt
+else
+	EXEC=./OpticalFlow_nrt
+fi
+
+$EXEC -n x4_0 -a 127.0.0.1 -p 9000 -l /tmp -x setup_x4.xml -t x4_simu -v dsp_stub
Index: tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x8.sh
===================================================================
--- tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x8.sh	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/build_x86_64/bin/x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./OpticalFlow_rt
+else
+	EXEC=./OpticalFlow_nrt
+fi
+
+$EXEC -n x8_0 -a 127.0.0.1 -p 9000 -l /tmp -x setup_x8.xml -t x8_simu -v dsp_stub
Index: tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp
===================================================================
--- tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp	(revision 209)
@@ -0,0 +1,213 @@
+//  created:    2011/05/01
+//  filename:   DemoOpticalFlow.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo optical flow
+//
+//
+/*********************************************************************/
+
+#include "DemoOpticalFlow.h"
+#include <Uav.h>
+#include <Camera.h>
+#include <V4LCamera.h>
+#include <CvtColor.h>
+#include <OpticalFlow.h>
+#include <OpticalFlowCompensated.h>
+#include <OpticalFlowSpeed.h>
+#include <LowPassFilter.h>
+#include <EulerDerivative.h>
+#include <cvmatrix.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <PushButton.h>
+#include <FrameworkManager.h>
+#include <MetaDualShock3.h>
+#include <Vector2D.h>
+#include <AhrsData.h>
+#include <Ahrs.h>
+#include <Pid.h>
+
+#include <stdio.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+DemoOpticalFlow::DemoOpticalFlow(TargetController *controller): UavStateMachine(controller) {
+  Uav* uav=GetUav();
+	if (uav->GetVerticalCamera() == NULL) {
+				Err("no vertical camera found\n");
+        exit(1);
+    }
+	
+	startOpticalflow=new PushButton(GetButtonsLayout()->NewRow(),"start optical flow");
+
+	greyCameraImage=new CvtColor(uav->GetVerticalCamera(),"gray",CvtColor::Conversion_t::ToGray);
+
+	uav->GetVerticalCamera()->UseDefaultPlot(greyCameraImage->Output()); // Le defaultPlot de la caméra peut afficher n'importe quoi?
+
+	//optical flow stack
+  //opticalFlow= matrice de déplacements en pixels entre 2 images consécutives
+  opticalFlow=new OpticalFlow(greyCameraImage,uav->GetVerticalCamera()->GetLayout()->NewRow(),"flux optique");
+  opticalFlowCompensated=new OpticalFlowCompensated(opticalFlow,uav->GetAhrs(),uav->GetVerticalCamera()->GetLayout()->NewRow(),"flux optique compense");
+  opticalFlowSpeedRaw=new OpticalFlowSpeed(opticalFlowCompensated,uav->GetAhrs(),uav->GetVerticalCamera()->GetLayout()->NewRow(),"vitesse du Flux Optique");
+  //opticalFlowSpeed=vitesse de déplacement en pixels par seconde (moyenne sur tous les points et division par le delta T)
+  cvmatrix* twoByOneOFS=new cvmatrix((const Thread*)this,2,1,floatType);
+  cvmatrix* twoByOneOFAR=new cvmatrix((const Thread*)this,2,1,floatType);
+  cvmatrix* twoByOneOFA=new cvmatrix((const Thread*)this,2,1,floatType);
+  opticalFlowSpeed=new LowPassFilter(opticalFlowSpeedRaw,uav->GetVerticalCamera()->GetLayout()->NewRow(),"Speed lowPass",twoByOneOFS);
+  opticalFlowAccelerationRaw=new EulerDerivative(opticalFlowSpeed,uav->GetVerticalCamera()->GetLayout()->NewRow(),"derivative",twoByOneOFAR);
+  opticalFlowAcceleration=new LowPassFilter(opticalFlowAccelerationRaw,uav->GetVerticalCamera()->GetLayout()->NewRow(),"Acceleration lowPass",twoByOneOFA);
+  
+  getFrameworkManager()->AddDeviceToLog(opticalFlowSpeedRaw);
+
+  Tab* opticalFlowTab=new Tab(getFrameworkManager()->GetTabWidget(),"flux optique");
+  DataPlot1D* xVelocityPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x speed (px/s)",-250,250);
+  DataPlot1D* yVelocityPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y speed (px/s)",-250,250);
+  DataPlot1D* xFirstPointPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x movement first point",-25,25);
+  DataPlot1D* yFirstPointPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y movement first point",-25,25);
+//  DataPlot1D* xAccelerationPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x_acceleration",-250,250);
+//  DataPlot1D* yAccelerationPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y_acceleration",-250,250);
+
+  xVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(0,0));
+  xVelocityPlot->AddCurve(opticalFlowSpeed->Matrix()->Element(0,0),DataPlot::Blue);
+  yVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(1,0));
+  yVelocityPlot->AddCurve(opticalFlowSpeed->Matrix()->Element(1,0),DataPlot::Blue);
+  xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(0,0));
+  xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(1,0),DataPlot::Blue);
+  xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(2,0),DataPlot::Green);
+  yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(0,1));
+  yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(1,1),DataPlot::Blue);
+  yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(2,1),DataPlot::Green);
+//  xAccelerationPlot->AddCurve(opticalFlowAccelerationRaw->Matrix()->Element(0,0));
+//  xAccelerationPlot->AddCurve(opticalFlowAcceleration->Matrix()->Element(0,0),DataPlot::Blue);
+//  yAccelerationPlot->AddCurve(opticalFlowAccelerationRaw->Matrix()->Element(1,0));
+//  yAccelerationPlot->AddCurve(opticalFlowAcceleration->Matrix()->Element(1,0),DataPlot::Blue);
+
+  u_x=new Pid(setupLawTab->At(1,0),"u_x");
+  u_x->UseDefaultPlot(graphLawTab->NewRow());
+  u_y=new Pid(setupLawTab->At(1,1),"u_y");
+  u_y->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+  opticalFlowGroupBox=new GroupBox(GetJoystick()->GetTab()->NewRow(),"consignes fo");
+  maxXSpeed=new DoubleSpinBox(opticalFlowGroupBox->NewRow(),"debattement x"," m/s",-5,5,0.1,1);
+  maxYSpeed=new DoubleSpinBox(opticalFlowGroupBox->LastRowLastCol(),"debattement y"," m/s",-5,5,0.1,1);
+  
+  Tab* opticalFlowRealTab=new Tab(getFrameworkManager()->GetTabWidget(),"real speed");
+  opticalFlowRealSpeed=new cvmatrix((const Thread*)this,2,1,floatType);
+  opticalFlowReference=new cvmatrix((const Thread*)this,2,1,floatType);
+  opticalFlowRealAcceleration=new cvmatrix((const Thread*)this,2,1,floatType);
+  DataPlot1D* xRealVelocityPlot=new DataPlot1D(opticalFlowRealTab->NewRow(),"x speed (m/s)",-2,2);
+  DataPlot1D* yRealVelocityPlot=new DataPlot1D(opticalFlowRealTab->LastRowLastCol(),"y speed (m/s)",-2,2);
+  DataPlot1D* xRealAccelerationPlot=new DataPlot1D(opticalFlowRealTab->NewRow(),"x acceleration (m/s2)",-2,2);
+  DataPlot1D* yRealAccelerationPlot=new DataPlot1D(opticalFlowRealTab->LastRowLastCol(),"y acceleration (m/s2)",-2,2);
+  xRealVelocityPlot->AddCurve(opticalFlowRealSpeed->Element(0));
+  xRealVelocityPlot->AddCurve(opticalFlowReference->Element(0),DataPlot::Blue,"consigne");
+  yRealVelocityPlot->AddCurve(opticalFlowRealSpeed->Element(1));
+  yRealVelocityPlot->AddCurve(opticalFlowReference->Element(1),DataPlot::Blue,"consigne");
+  xRealAccelerationPlot->AddCurve(opticalFlowRealAcceleration->Element(0));
+  yRealAccelerationPlot->AddCurve(opticalFlowRealAcceleration->Element(1));
+
+  customReferenceOrientation= new AhrsData(this,"reference");
+  uav->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow);
+  AddDataToControlLawLog(customReferenceOrientation);
+  
+  flagCameraLost=false;
+}
+
+void DemoOpticalFlow::SignalEvent(Event_t event) {
+    switch(event) {
+    case Event_t::EnteringControlLoop:
+        opticalFlowReference->SetValue(0,0,GetJoystick()->GetAxisValue(1)*maxXSpeed->Value());//joy axis 0 maps to x displacement
+        opticalFlowReference->SetValue(1,0,GetJoystick()->GetAxisValue(0)*maxYSpeed->Value());//joy axis 1 maps to y displacement
+        float focal=271.76;
+        float z,dz;
+        AltitudeValues(z, dz);
+        float scale=z/focal;
+        opticalFlowRealSpeed->SetValue(0,0,opticalFlowSpeed->Output(0,0)*scale);
+        opticalFlowRealSpeed->SetValue(1,0,opticalFlowSpeed->Output(1,0)*scale);
+        opticalFlowRealAcceleration->SetValue(0,0,opticalFlowAcceleration->Output(0,0)*scale);
+        opticalFlowRealAcceleration->SetValue(1,0,opticalFlowAcceleration->Output(1,0)*scale);
+        break;
+    }
+}
+
+void DemoOpticalFlow::StartOpticalFlow(void) {
+	if (SetOrientationMode(OrientationMode_t::Custom)) {
+			Thread::Info("(Re)entering optical flow mode\n");
+			u_x->Reset();
+			u_y->Reset();
+	} else {
+			Thread::Warn("Could not enter optical flow mode\n");
+	}
+}
+
+void DemoOpticalFlow::ExtraCheckPushButton(void) {
+	if(startOpticalflow->Clicked()) {
+            StartOpticalFlow();
+	}
+}
+
+void DemoOpticalFlow::ExtraCheckJoystick(void) {
+    static bool wasOpticalFlowModeButtonPressed=false;
+    // controller button R1 enters optical flow mode
+    if(GetJoystick()->IsButtonPressed(9)) { // R1
+        if (!wasOpticalFlowModeButtonPressed) {
+            wasOpticalFlowModeButtonPressed=true;
+            StartOpticalFlow();
+        }
+    } else {
+        wasOpticalFlowModeButtonPressed=false;
+    }
+}
+
+const AhrsData *DemoOpticalFlow::GetReferenceOrientation(void) {
+    Euler refAngles=GetDefaultReferenceOrientation()->GetQuaternion().ToEuler();//to keep default yaw reference
+
+    // /!\ in this demo, the target value is a speed (in m/s). As a consequence the error is the difference between the current speed and the target speed
+    Vector2Df error, errorVariation; // in Uav coordinate system
+
+    error.x=opticalFlowRealSpeed->Value(0,0)-opticalFlowReference->Value(0,0);
+    error.y=opticalFlowRealSpeed->Value(1,0)-opticalFlowReference->Value(1,0);
+    errorVariation.x=opticalFlowRealAcceleration->Value(0,0);
+    errorVariation.y=opticalFlowRealAcceleration->Value(1,0);
+//Printf("Altitude=%f, Error=(%f,%f)\n",z,error.x,error.y);
+
+    u_x->SetValues(error.x, errorVariation.x);
+    u_x->Update(GetTime());
+    refAngles.pitch=u_x->Output();
+
+    u_y->SetValues(error.y, errorVariation.y);
+    u_y->Update(GetTime());
+    refAngles.roll=-u_y->Output();
+
+    customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0));
+
+    return customReferenceOrientation;
+}
+
+void DemoOpticalFlow::ExtraSecurityCheck(void) {
+  if(GetUav()->GetType()=="hds_x8") {
+    if(((V4LCamera*)GetUav()->GetVerticalCamera())->HasProblems() && !flagCameraLost) {
+      flagCameraLost = true;
+      Thread::Err("Camera lost\n");
+      SafeStop();
+      Land();
+    }
+  }
+}
+
+DemoOpticalFlow::~DemoOpticalFlow() {
+}
Index: tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.h
===================================================================
--- tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.h	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/src/DemoOpticalFlow.h	(revision 209)
@@ -0,0 +1,75 @@
+//  created:    2011/05/01
+//  filename:   DemoOpticalFlow.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo optical flow
+//
+//
+/*********************************************************************/
+//------------
+
+#ifndef DEMOOPTICALFLOW_H
+#define DEMOOPTICALFLOW_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+    namespace core {
+        class cvmatrix;
+    }
+    namespace gui {
+        class GroupBox;
+        class DoubleSpinBox;
+        class PushButton;
+    }
+    namespace filter {
+        class OpticalFlow;
+        class OpticalFlowCompensated;
+        class OpticalFlowSpeed;
+        class LowPassFilter;
+        class EulerDerivative;
+        class CvtColor;
+    }
+    namespace sensor {
+        class TargetController;
+    }
+}
+
+class DemoOpticalFlow : public flair::meta::UavStateMachine {
+
+    public:
+        DemoOpticalFlow(flair::sensor::TargetController *controller);
+        ~DemoOpticalFlow();
+
+    protected:
+        void SignalEvent(Event_t event);
+        void ExtraCheckJoystick(void);
+    void ExtraCheckPushButton(void);
+    void ExtraSecurityCheck(void);
+        const flair::core::AhrsData *GetReferenceOrientation(void);
+
+        flair::gui::GroupBox* opticalFlowGroupBox;
+        flair::gui::DoubleSpinBox *maxXSpeed,*maxYSpeed;
+        flair::core::cvmatrix *opticalFlowReference;
+        flair::filter::Pid *u_x, *u_y;
+        flair::filter::CvtColor* greyCameraImage;
+        flair::core::AhrsData *customReferenceOrientation;
+        flair::core::cvmatrix *opticalFlowRealSpeed,*opticalFlowRealAcceleration;
+
+    private:
+        flair::filter::OpticalFlow *opticalFlow;
+        flair::filter::OpticalFlowCompensated *opticalFlowCompensated;
+        flair::filter::OpticalFlowSpeed *opticalFlowSpeedRaw;
+        flair::filter::EulerDerivative *opticalFlowAccelerationRaw;
+    flair::gui::PushButton *startOpticalflow,*stopOpticalflow;
+    void StartOpticalFlow(void);
+        flair::filter::LowPassFilter* opticalFlowSpeed;
+        flair::filter::LowPassFilter* opticalFlowAcceleration;
+        bool flagCameraLost;
+};
+
+#endif // DEMOOPTICALFLOW_H
Index: tags/latest/demos/OpticalFlow/uav/src/main.cpp
===================================================================
--- tags/latest/demos/OpticalFlow/uav/src/main.cpp	(revision 209)
+++ tags/latest/demos/OpticalFlow/uav/src/main.cpp	(revision 209)
@@ -0,0 +1,110 @@
+//  created:    2011/05/01
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code x4
+//
+//
+/*********************************************************************/
+
+#include "DemoOpticalFlow.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+#include <TargetEthController.h>
+#include <VisionFilter.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string dsp_file;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+		if(!InitVisionFilter("file="+dsp_file)) {
+			exit(1);
+		}
+		
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+    manager->SetupLogger(log_path);
+
+    Uav* drone=CreateUav(name,uav_type);
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    DemoOpticalFlow* demo=new DemoOpticalFlow(controller);
+
+    demo->Start();
+    demo->Join();
+
+    delete manager;
+
+    CloseVisionFilter();
+}
+
+void parseOptions(int argc, char** argv)
+{
+	try
+	{
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, hds_simu or hds_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> dspArg("v","dsp","executable dsp",true,"./dspcv_dsp.out","string");
+        cmd.add( dspArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        uav_type=typeArg.getValue();
+        dsp_file = dspArg.getValue();
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e)  // catch any exceptions
+	{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
+}
Index: tags/latest/demos/PidStandalone/simulator/CMakeLists.txt
===================================================================
--- tags/latest/demos/PidStandalone/simulator/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,31 @@
+PROJECT(simulator_pid)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_SIMULATOR TRUE)
+SET(FLAIR_USE_SIMULATOR_GL TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x4_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-3.5" name="z:"/>
+    <SpinBox value="0" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.2" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+  </TabWidget>
+ </Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x8_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.5" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="-1.2" name="z:"/>
+    <SpinBox value="20" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.6" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0" name="position G (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+    <DoubleSpinBox value="0" name="j_r:"/>
+    <DoubleSpinBox value="0.72" name="sigma:"/>
+    <DoubleSpinBox value="1" name="S:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/><Vector3DSpinBox name="up" value_x="1.00" value_y="0.00" value_z="0.00"/></Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x4.sh
===================================================================
--- tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $IGEP_ROOT/uav_dev/bin/noarch/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./simulator_pid_rt
+else
+	EXEC=./simulator_pid_nrt
+fi
+
+$EXEC -n x4_0 -t x4 -a 127.0.0.1 -p 9000 -x setup_x4.xml -o 10 -m $IGEP_ROOT/uav_dev/media -s $IGEP_ROOT/uav_dev/media/optitrack_b122.xml
Index: tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x8.sh
===================================================================
--- tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $IGEP_ROOT/uav_dev/bin/noarch/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./simulator_pid_rt
+else
+	EXEC=./simulator_pid_nrt
+fi
+
+$EXEC  -n x8_0 -t x8 -a 127.0.0.1 -p 9000 -x setup_x8.xml -o 10 -m $IGEP_ROOT/uav_dev/media -s $IGEP_ROOT/uav_dev/media/optitrack_b122.xml
Index: tags/latest/demos/PidStandalone/simulator/src/main.cpp
===================================================================
--- tags/latest/demos/PidStandalone/simulator/src/main.cpp	(revision 209)
+++ tags/latest/demos/PidStandalone/simulator/src/main.cpp	(revision 209)
@@ -0,0 +1,134 @@
+//  created:    2012/04/18
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main simulateur
+//
+//
+/*********************************************************************/
+
+#include <tclap/CmdLine.h>
+#include <Simulator.h>
+#include <X4.h>
+#include <X8.h>
+#include <SimuImu.h>
+#ifdef GL
+#include <SimuCameraGL.h>
+#include <Parser.h>
+#include <SimuUsGL.h>
+#endif
+
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::simulator;
+using namespace flair::sensor;
+
+int port;
+int opti_time;
+string xml_file;
+string media_path;
+string scene_file;
+string type;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv)
+{
+	try
+	{
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> xmlArg("x","xml","xml file",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<int> portArg("p","port","ground station port",true,9002,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","ground station address",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<string> typeArg("t","type","uav type, x4 or x8",true,"x4","string");
+        cmd.add( typeArg );
+
+
+        ValueArg<int> optiArg("o","opti","optitrack time ms",false,0,"int");
+        cmd.add( optiArg );
+
+#ifdef GL
+        ValueArg<string> mediaArg("m","media","path to media files",true,"./","string");
+        cmd.add( mediaArg );
+
+        ValueArg<string> sceneArg("s","scene","path to scene file",true,"./voliere.xml","string");
+        cmd.add( sceneArg );
+#endif
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        port=portArg.getValue();
+        xml_file = xmlArg.getValue();
+        opti_time = optiArg.getValue();
+        type = typeArg.getValue();
+        name=nameArg.getValue();
+        address=addressArg.getValue();
+#ifdef GL
+        media_path=mediaArg.getValue();
+        scene_file=sceneArg.getValue();
+#endif
+
+	} catch (ArgException &e)  // catch any exceptions
+	{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
+}
+
+
+int main(int argc, char* argv[])
+{
+    Simulator *simu;
+    Model *drone;
+    SimuImu* imu;
+#ifdef GL
+    SimuUsGL* us_gl;
+
+    SimuCameraGL *cam_bas;
+    Parser *gui;
+#endif
+    parseOptions(argc,argv);
+
+    simu= new Simulator("simulator",opti_time,90);
+    simu->SetupConnection(address,port);
+    simu->SetupUserInterface(xml_file);
+
+#ifdef GL
+    gui=new Parser(simu,960,480,640,480,media_path,scene_file);
+#endif
+
+    if(type=="x4")
+    {
+        drone=new X4(simu,name,0);
+    }
+    else
+    {
+        drone=new X8(simu,name,0);
+    }
+    imu=new SimuImu(drone,"imu",0);
+
+#ifdef GL
+    us_gl=new SimuUsGL(drone,"us",0);
+    cam_bas=new SimuCameraGL(drone,"bottom camera",320,240,640,0,0);
+#endif
+
+    simu->RunSimu();
+
+    delete simu;
+
+	return 0;
+}
+
Index: tags/latest/demos/PidStandalone/uav/CMakeLists.txt
===================================================================
--- tags/latest/demos/PidStandalone/uav/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/CMakeLists.txt	(revision 209)
@@ -0,0 +1,34 @@
+PROJECT(demo_pid)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_META TRUE)
+SET(FLAIR_USE_VRPN TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/PidUav.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/PidStandalone/uav/build_arm/bin/demo_pid_parrot.sh
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_arm/bin/demo_pid_parrot.sh	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_arm/bin/demo_pid_parrot.sh	(revision 209)
@@ -0,0 +1,1 @@
+./demo_pid_nrt -a 192.168.147.192 -p 9000 -l /tmp -x reglages_parrot.xml -n Drone_0 -t ardrone2
Index: tags/latest/demos/PidStandalone/uav/build_arm/bin/reglages_parrot.xml
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_arm/bin/reglages_parrot.xml	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_arm/bin/reglages_parrot.xml	(revision 209)
@@ -0,0 +1,267 @@
+<?xml version="1.0"?>
+<root name="FrameworkManager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="x4-multiplex">
+      <TabWidget name="UavMultiplex">
+        <Tab name="Setup">
+          <GroupBox name="x4 multiplex">
+            <ComboBox name="front left blade pitch:" value="1"/>
+          </GroupBox>
+          <GroupBox name="motor attribution">
+            <ComboBox name="front left" value="0"/>
+            <ComboBox name="front rigth" value="1"/>
+            <ComboBox name="rear left" value="2"/>
+            <ComboBox name="rear rigth" value="3"/>
+          </GroupBox>
+          <GroupBox name="bldc">
+            <Label name="flight time"/>
+            <DoubleSpinBox name="min value:" value="0.4"/>
+            <DoubleSpinBox name="max value:" value="1"/>
+            <DoubleSpinBox name="test value:" value="0.2"/>
+            <PushButton name="test motor 0"/>
+            <PushButton name="test motor 1"/>
+            <PushButton name="test motor 2"/>
+            <PushButton name="test motor 3"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Values">
+          <DataPlot1D name="front left" period="100" enabled="0"/>
+          <DataPlot1D name="front right" period="100" enabled="0"/>
+          <DataPlot1D name="rear left" period="100" enabled="0"/>
+          <DataPlot1D name="rear right" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="parrot-us">
+      <TabWidget name="parrot-us">
+        <Tab name="Reglages">
+          <GroupBox name="parrot-us"/>
+          <GroupBox name="Passe bas">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="5"/>
+          </GroupBox>
+          <GroupBox name="Vz">
+            <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+          </GroupBox>
+          <GroupBox name="Passe bas v">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="cutoff frequency" value="10"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Mesures">
+          <DataPlot1D name="parrot-us" period="100" enabled="0"/>
+          <DataPlot1D name="vz" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="parrot-imu">
+      <TabWidget name="parrot-imu">
+        <Tab name="Reglages">
+          <GroupBox name="parrot-imu"/>
+          <GroupBox name="post rotation">
+            <DoubleSpinBox name="value" value="0"/>
+            <ComboBox name="axis" value="0"/>
+          </GroupBox>
+          <DoubleSpinBox name="k_a[0]:" value="0.5"/>
+          <DoubleSpinBox name="k_a[1]:" value="0.5"/>
+          <DoubleSpinBox name="k_a[2]:" value="0"/>
+          <DoubleSpinBox name="k_b[0]:" value="0.01"/>
+          <DoubleSpinBox name="k_b[1]:" value="0.01"/>
+          <DoubleSpinBox name="k_b[2]:" value="0.01"/>
+        </Tab>
+        <Tab name="AHRS">
+          <DataPlot1D name="roll" period="100" enabled="0"/>
+          <DataPlot1D name="pitch" period="100" enabled="0"/>
+          <DataPlot1D name="yaw" period="100" enabled="0"/>
+          <DataPlot1D name="w_x" period="100" enabled="0"/>
+          <DataPlot1D name="w_y" period="100" enabled="0"/>
+          <DataPlot1D name="w_z" period="100" enabled="0"/>
+        </Tab>
+        <Tab name="IMU">
+          <DataPlot1D name="acc_x" period="100" enabled="0"/>
+          <DataPlot1D name="acc_y" period="100" enabled="0"/>
+          <DataPlot1D name="acc_z" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_x" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_y" period="100" enabled="0"/>
+          <DataPlot1D name="gyr_z" period="100" enabled="0"/>
+          <DataPlot1D name="mag_x" period="100" enabled="0"/>
+          <DataPlot1D name="mag_y" period="100" enabled="0"/>
+          <DataPlot1D name="mag_z" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="battery">
+      <GroupBox name="battery">
+        <Label name="battery"/>
+        <DoubleSpinBox name="threshold" value="10.5"/>
+      </GroupBox>
+    </Tab>
+    <Tab name="camv">
+      <TabWidget name="camv">
+        <Tab name="Setup">
+          <GroupBox name="camv">
+            <DoubleSpinBox name="gain:" value="0.5"/>
+            <DoubleSpinBox name="exposure:" value="0.5"/>
+            <DoubleSpinBox name="bright:" value="0.5"/>
+            <DoubleSpinBox name="contrast:" value="0.5"/>
+            <DoubleSpinBox name="hue:" value="0.5"/>
+            <DoubleSpinBox name="sharpness:" value="0.5"/>
+            <DoubleSpinBox name="saturation:" value="0.5"/>
+            <CheckBox name="autogain:" value="1"/>
+            <CheckBox name="autoexposure:" value="1"/>
+            <CheckBox name="awb:" value="1"/>
+          <Label name="fps"/></GroupBox>
+          <GridLayout name="setup">
+            <GroupBox name="flux optique">
+              <GroupBox name="post rotation">
+                <DoubleSpinBox name="value" value="90"/>
+                <ComboBox name="axis" value="2"/>
+              </GroupBox>
+              <SpinBox name="max features:" value="64"/>
+            </GroupBox>
+            <GroupBox name="passe bas">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="2"/>
+            </GroupBox>
+            <GroupBox name="sobel along x">
+              <SpinBox name="dx:" value="1"/>
+              <SpinBox name="dy:" value="0"/>
+            </GroupBox>
+            <GroupBox name="threshold">
+              <SpinBox name="threshold:" value="127"/>
+            </GroupBox>
+            <GroupBox name="houghlines">
+              <SpinBox name="full rho step:" value="4"/>
+              <DoubleSpinBox name="full theta step:" value="4"/>
+              <SpinBox name="tracking rho step:" value="4"/>
+              <DoubleSpinBox name="tracking theta step:" value="1"/>
+              <DoubleSpinBox name="tracking delta theta:" value="10"/>
+              <SpinBox name="nb points:" value="100"/>
+            </GroupBox>
+          </GridLayout>
+        </Tab>
+        <Tab name="Picture">
+          <Picture name="camv" period="500" enabled="0"/>
+          <Picture name="sobel along x" period="500" enabled="0"/>
+          <Picture name="threshold" period="500" enabled="0"/>
+          <GridLayout name="hough">
+            <DataPlot1D name="distance" period="100" enabled="1"/>
+            <DataPlot1D name="orientation" period="100" enabled="1"/>
+            <DataPlot1D name="line detected" period="100" enabled="1"/>
+          </GridLayout>
+        <DataPlot1D name="distance" period="100" enabled="1"/><DataPlot1D name="orientation" period="100" enabled="1"/><DataPlot1D name="line detected" period="100" enabled="1"/></Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="uav">
+      <GridLayout name="buttons">
+        <PushButton name="kill"/>
+        <PushButton name="start_log"/>
+        <PushButton name="stop_log"/>
+        <PushButton name="take_off"/>
+        <PushButton name="land"/>
+      </GridLayout>
+      <GroupBox name="takeoff/landing">
+        <DoubleSpinBox name="desired takeoff altitude" value="0.7"/>
+        <DoubleSpinBox name="desired landing altitude" value="0"/>
+      </GroupBox>
+      <GroupBox name="alt cons">
+        <DoubleSpinBox name="period, 0 for auto:" value="0"/>
+        <DoubleSpinBox name="velocity max (absolute):" value="1"/>
+        <DoubleSpinBox name="acceleration (absolute):" value="0.8"/>
+      </GroupBox>
+    </Tab>
+    <Tab name="control laws">
+      <TabWidget name="laws">
+        <Tab name="Setup">
+          <GroupBox name="u_roll">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="12"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat u:" value="0.4"/>
+          </GroupBox>
+          <GroupBox name="u_pitch">
+            <DoubleSpinBox name="sat ref:" value="20"/>
+            <DoubleSpinBox name="kp:" value="12"/>
+            <DoubleSpinBox name="sat dref:" value="1000"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat u:" value="0.4"/>
+          </GroupBox>
+          <GroupBox name="u_yaw">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.6"/>
+            <DoubleSpinBox name="ki:" value="0.1"/>
+            <DoubleSpinBox name="sat i:" value="0.2"/>
+            <DoubleSpinBox name="kd:" value="0.2"/>
+            <DoubleSpinBox name="sat:" value="0.5"/>
+          </GroupBox>
+          <GroupBox name="u_z">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.6"/>
+            <DoubleSpinBox name="ki:" value="0.2"/>
+            <DoubleSpinBox name="sat i:" value="0.4"/>
+            <DoubleSpinBox name="kd:" value="0.4"/>
+            <DoubleSpinBox name="offset g:" value="0.6"/>
+            <DoubleSpinBox name="sat:" value="1"/>
+            <DoubleSpinBox name="offset step:" value="0.0002"/>
+          </GroupBox>
+          <GroupBox name="u_x">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.015"/>
+            <DoubleSpinBox name="ki:" value="0.02"/>
+            <DoubleSpinBox name="sat i:" value="0.15"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0.3"/>
+          </GroupBox>
+          <GroupBox name="u_y">
+            <DoubleSpinBox name="period, 0 for auto" value="0"/>
+            <DoubleSpinBox name="kp:" value="0.015"/>
+            <DoubleSpinBox name="ki:" value="0.02"/>
+            <DoubleSpinBox name="sat i:" value="0.15"/>
+            <DoubleSpinBox name="kd:" value="0"/>
+            <DoubleSpinBox name="sat:" value="0.3"/>
+          </GroupBox>
+        </Tab>
+        <Tab name="Graphes">
+          <DataPlot1D name="u_roll" period="100" enabled="0"/>
+          <DataPlot1D name="u_pitch" period="100" enabled="0"/>
+          <DataPlot1D name="u_yaw" period="100" enabled="0"/>
+          <DataPlot1D name="u_z" period="100" enabled="1"/>
+          <DataPlot1D name="u_x" period="100" enabled="1"/>
+          <DataPlot1D name="u_y" period="100" enabled="0"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="dualshock3">
+      <TabWidget name="dualshock3">
+        <Tab name="Reglages">
+          <GroupBox name="consignes joy">
+            <DoubleSpinBox name="debattement roll" value="-15"/>
+            <DoubleSpinBox name="debattement pitch" value="-15"/>
+            <DoubleSpinBox name="debattement dyaw" value="90"/>
+            <DoubleSpinBox name="debattement dz" value="-0.5"/>
+            <DoubleSpinBox name="trim" value="0.02"/>
+            <Label name="trim roll"/>
+            <PushButton name="reset roll trim"/>
+            <Label name="trim pitch"/>
+            <PushButton name="reset pitch trim"/>
+          </GroupBox>
+          <GroupBox name="consignes fo">
+            <DoubleSpinBox name="debattement x" value="0"/>
+            <DoubleSpinBox name="debattement y" value="0"/>
+            <DoubleSpinBox name="speed step" value="5"/>
+          </GroupBox>
+        </Tab>
+      </TabWidget>
+    </Tab>
+    <Tab name="flux optique">
+      <DataPlot1D name="x_velocity" period="100" enabled="1"/>
+      <DataPlot1D name="y_velocity" period="100" enabled="1"/>
+    </Tab>
+  </TabWidget>
+  <TabWidget name="App_TabWidget">
+    <Tab name="demo_line">
+      <PushButton name="save config on target" value="1"/>
+    </Tab>
+  <Tab name="Drone_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget>
+</root>
Index: tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x4.xml
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x4.xml	(revision 209)
@@ -0,0 +1,287 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-1"/><DoubleSpinBox name="debattement y" value="1"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="0"/><DataPlot1D name="q1" period="100" enabled="0"/><DataPlot1D name="q2" period="100" enabled="0"/><DataPlot1D name="q3" period="100" enabled="0"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="0" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     <GroupBox name="post rotation"><DoubleSpinBox name="value" value="90"/><ComboBox name="axis" value="2"/></GroupBox></GroupBox>
+     <GroupBox name="passe bas">
+      <DoubleSpinBox value="0" name="period, 0 for auto"/>
+      <DoubleSpinBox value="1" name="cutoff frequency"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="Picture">
+    <Picture name="simu_cam_v">
+     <Setup period="50" enabled="1"/>
+    </Picture>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="1" name="take_off"/>
+   <PushButton value="0" name="land"/>
+  </GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.030" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.20" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.03" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.20" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   <GroupBox name="custom uRoll"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0"/><DoubleSpinBox name="ki:" value="0"/><DoubleSpinBox name="sat i:" value="0"/><DoubleSpinBox name="kd:" value="0"/><DoubleSpinBox name="sat:" value="0"/></GroupBox><GroupBox name="custom uPitch"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="kp:" value="0"/><DoubleSpinBox name="ki:" value="0"/><DoubleSpinBox name="sat i:" value="0"/><DoubleSpinBox name="kd:" value="0"/><DoubleSpinBox name="sat:" value="0"/></GroupBox></Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   <DataPlot1D name="custom uRoll" period="100" enabled="0"/><DataPlot1D name="custom uPitch" period="100" enabled="0"/></Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="flux optique">
+  <DataPlot1D name="x_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+  <DataPlot1D name="y_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+ </Tab>
+  <Tab name="Emulated Controller"><TabWidget name="Emulated Controller"><Tab name="Reglages"><GroupBox name="consignes joy"><DoubleSpinBox name="debattement roll" value="-20"/><DoubleSpinBox name="debattement pitch" value="-20"/><DoubleSpinBox name="debattement wz" value="90"/><DoubleSpinBox name="debattement dz" value="-0.7"/><DoubleSpinBox name="trim" value="0"/><Label name="trim roll"/><PushButton name="reset roll trim"/><Label name="trim pitch"/><PushButton name="reset pitch trim"/></GroupBox></Tab></TabWidget></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x4_0)" value="1"/></root>
Index: tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,287 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="dualshock3">
+  <TabWidget name="dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="dualshock3">
+     <SpinBox value="10" name="dead zone:"/>
+     <Label name="batterie"/>
+    </GroupBox>
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement dyaw"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   <GroupBox name="consignes fo"><DoubleSpinBox name="debattement x" value="-1"/><DoubleSpinBox name="debattement y" value="1"/></GroupBox></Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="roll">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="gaz">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="0" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    <ComboBox name="top front left" value="0"/><ComboBox name="top front rigth" value="1"/><ComboBox name="top rear left" value="2"/><ComboBox name="top rear rigth" value="3"/><ComboBox name="bottom front left" value="4"/><ComboBox name="bottom front rigth" value="5"/><ComboBox name="bottom rear left" value="6"/><ComboBox name="bottom rear rigth" value="7"/></GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    <PushButton name="test motor 4"/><PushButton name="test motor 5"/><PushButton name="test motor 6"/><PushButton name="test motor 7"/></GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   <GroupBox name="x8 multiplex"><ComboBox name="top front left blade pitch:" value="0"/></GroupBox></Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="0" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup">
+     <GroupBox name="flux optique">
+      <SpinBox value="64" name="max features:"/>
+     <GroupBox name="post rotation"><DoubleSpinBox name="value" value="90"/><ComboBox name="axis" value="2"/></GroupBox></GroupBox>
+     <GroupBox name="passe bas">
+      <DoubleSpinBox value="0" name="period, 0 for auto"/>
+      <DoubleSpinBox value="1" name="cutoff frequency"/>
+     </GroupBox>
+    </GridLayout>
+   </Tab>
+   <Tab name="Picture">
+    <Picture name="simu_cam_v">
+     <Setup period="50" enabled="1"/>
+    </Picture>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="1" name="take_off"/>
+   <PushButton value="0" name="land"/>
+  </GridLayout>
+  <GroupBox name="takeoff/landing">
+   <DoubleSpinBox value="1" name="desired takeoff altitude"/>
+   <DoubleSpinBox value="0" name="desired landing altitude"/>
+  </GroupBox>
+  <GroupBox name="alt cons">
+   <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+   <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+   <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.03" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.03" name="kp:"/>
+     <DoubleSpinBox value="0.020" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="flux optique">
+  <DataPlot1D name="x_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+  <DataPlot1D name="y_velocity" period="100" enabled="1">
+   <Setup period="100" enabled="1"/>
+  </DataPlot1D>
+ </Tab>
+  </TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x4_0"><PushButton name="save config on target" value="1"/></Tab><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x4.sh
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x4.sh	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x4.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $IGEP_ROOT/uav_dev/bin/noarch/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./demo_pid_rt
+else
+	EXEC=./demo_pid_nrt
+fi
+
+$EXEC -n x4_0 -a 127.0.0.1 -p 9000 -l ./ -x setup_x4.xml -t x4_simu $*
Index: tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x8.sh
===================================================================
--- tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x8.sh	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/build_x86_64/bin/x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $IGEP_ROOT/uav_dev/bin/noarch/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./demo_pid_rt
+else
+	EXEC=./demo_pid_nrt
+fi
+
+$EXEC -n x8_0 -a 127.0.0.1 -p 9000 -l ./ -x setup_x8.xml -t x8_simu
Index: tags/latest/demos/PidStandalone/uav/src/PidUav.cpp
===================================================================
--- tags/latest/demos/PidStandalone/uav/src/PidUav.cpp	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/src/PidUav.cpp	(revision 209)
@@ -0,0 +1,131 @@
+//  created:    2016/06/01
+//  filename:   PidUav.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Uav class showing the incidence of pid parameters choice
+//
+//
+/*********************************************************************/
+
+#include "PidUav.h"
+#include <TargetController.h>
+#include <cvmatrix.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <FrameworkManager.h>
+#include <MetaDualShock3.h>
+#include <Pid.h>
+#include <AhrsData.h>
+
+#include <stdio.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::sensor;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::meta;
+
+/*
+** ===================================================================
+**    constructor and destructor
+**
+** ===================================================================
+*/
+PidUav::PidUav(Uav *uav, TargetController *controller)
+    : behaviourMode(BehaviourMode_t::Default),
+      UavStateMachine(uav, controller) {
+  my_uRoll = new Pid(setupLawTab->At(1, 1), "custom uRoll");
+  my_uRoll->UseDefaultPlot(graphLawTab->LastRowLastCol());
+  my_uPitch = new Pid(setupLawTab->At(1, 0), "custom uPitch");
+  my_uPitch->UseDefaultPlot(graphLawTab->NewRow());
+}
+
+void PidUav::SignalEvent(Event_t event) {
+  UavStateMachine::SignalEvent(event);
+  switch (event) {
+  case Event_t::TakingOff:
+    // always take off in default mode
+    behaviourMode = BehaviourMode_t::Default;
+    break;
+  case Event_t::EnteringFailSafeMode:
+    // return to default mode
+    Thread::Info("Entering failSafe mode\n");
+    behaviourMode = BehaviourMode_t::Default;
+    break;
+  }
+}
+
+bool PidUav::StartCustomMode() {
+  // ask UavStateMachine to enter in custom torques
+  if (SetTorqueMode(TorqueMode_t::Custom)) {
+    Thread::Info("CustomTorques: start\n");
+    my_uPitch->Reset();
+    my_uRoll->Reset();
+    return true;
+  } else {
+    Thread::Warn("CustomTorques: could not start\n");
+    return false;
+  }
+}
+
+void PidUav::StartOscillatingMode() {
+  if (behaviourMode == BehaviourMode_t::Default) {
+    if (!StartCustomMode())
+      return;
+  }
+  behaviourMode = BehaviourMode_t::Oscillating;
+  Thread::Info("Entering oscillating mode\n");
+  // remove the 'D' effect with a strong 'P'
+}
+
+void PidUav::ExtraCheckJoystick(void) {
+  static bool wasOscillatingModeButtonPressed = false;
+  // controller button R1 enters optical flow mode
+  if (GetJoystick()->IsButtonPressed(9)) { // R1
+    if (!wasOscillatingModeButtonPressed) {
+      wasOscillatingModeButtonPressed = true;
+      if (behaviourMode != BehaviourMode_t::Oscillating)
+        StartOscillatingMode();
+    }
+  } else {
+    wasOscillatingModeButtonPressed = false;
+  }
+}
+
+void PidUav::ComputeCustomTorques(Euler &torques) {
+  ComputeDefaultTorques(torques);
+  // overload default torques calculation for pitch and roll
+  const AhrsData *refOrientation = GetDefaultReferenceOrientation();
+  Quaternion refQuaternion;
+  Vector3D refAngularRates;
+  refOrientation->GetQuaternionAndAngularRates(refQuaternion, refAngularRates);
+  Euler refAngles = refQuaternion.ToEuler();
+
+  const AhrsData *currentOrientation = GetDefaultOrientation();
+  Quaternion currentQuaternion;
+  Vector3D currentAngularRates;
+  currentOrientation->GetQuaternionAndAngularRates(currentQuaternion,
+                                                   currentAngularRates);
+  Euler currentAngles = currentQuaternion.ToEuler();
+
+  my_uRoll->SetValues(currentAngles.roll - refAngles.roll,
+                      currentAngularRates.x);
+  my_uRoll->Update(GetTime());
+  torques.roll = my_uRoll->Output();
+
+  my_uPitch->SetValues(currentAngles.pitch - refAngles.pitch,
+                       currentAngularRates.y);
+  my_uPitch->Update(GetTime());
+  torques.pitch = my_uPitch->Output();
+}
+
+PidUav::~PidUav() {}
Index: tags/latest/demos/PidStandalone/uav/src/PidUav.h
===================================================================
--- tags/latest/demos/PidStandalone/uav/src/PidUav.h	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/src/PidUav.h	(revision 209)
@@ -0,0 +1,54 @@
+//  created:    2016/06/01
+//  filename:   PidUav.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Uav class showing the incidence of pid parameters choice
+//
+//
+/*********************************************************************/
+
+#ifndef PID_UAV_H
+#define PID_UAV_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+  namespace core {
+    class cvmatrix;
+  }
+  namespace gui {
+    class GroupBox;
+    class DoubleSpinBox;
+  }
+  namespace filter {
+    class Pid;
+  }
+  namespace sensor {
+    class TargetController;
+  }
+}
+
+class PidUav : public flair::meta::UavStateMachine {
+public:
+  PidUav(flair::meta::Uav *uav,
+         flair::sensor::TargetController *controller);
+  ~PidUav();
+
+protected:
+  void SignalEvent(Event_t event);
+  void ExtraCheckJoystick(void);
+
+private:
+  void ComputeCustomTorques(flair::core::Euler &torques);
+  bool StartCustomMode();
+  void StartOscillatingMode();
+  flair::filter::Pid *my_uPitch, *my_uRoll;
+  enum class BehaviourMode_t { Default, Oscillating };
+  BehaviourMode_t behaviourMode;
+};
+
+#endif // PID_UAV_H
Index: tags/latest/demos/PidStandalone/uav/src/main.cpp
===================================================================
--- tags/latest/demos/PidStandalone/uav/src/main.cpp	(revision 209)
+++ tags/latest/demos/PidStandalone/uav/src/main.cpp	(revision 209)
@@ -0,0 +1,121 @@
+//  created:    2016/06/01
+//  filename:   main.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code x4
+//
+//
+/*********************************************************************/
+
+#include "PidUav.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+#include <TargetEthController.h>
+#include <EmulatedController.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string dsp_file;
+string log_path;
+bool headless;
+int port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char **argv);
+
+int main(int argc, char *argv[]) {
+  parseOptions(argc, argv);
+
+  FrameworkManager *manager;
+  manager = new FrameworkManager(name);
+  if (!headless) {
+    manager->SetupConnection(address, port);
+  }
+  manager->SetupUserInterface(xml_file);
+  manager->SetupLogger(log_path);
+
+  Uav *drone = CreateUav(manager, name, uav_type);
+  TargetEthController *controller =
+      new TargetEthController(manager, "Dualshock3", 20000);
+  // EmulatedController *controller=new EmulatedController(manager,"Emulated
+  // Controller");
+  //    controller->AddStep(10000,"Waiting for AHRS
+  //    stabilization",0,0.,0.,0.,0.);
+  //    controller->AddStep(500,"Takeoff",(uint16_t)EmulatedController::ButtonType::start,0.,0.,0.,0.);
+  //    controller->AddStep(3000,"Waiting for flight
+  //    stabilization",0,0.,0.,0.,0.);
+  /*    controller->AddStep(2000,"fly left",0,-0.3,0.,0.,0.);
+      controller->AddStep(1000,"fly right",0,0.3,0.,0.,0.);*/
+  //    controller->AddStep(500,"Land",(uint16_t)EmulatedController::ButtonType::start,0.,0.,0.,0.);
+  //    controller->AddStep(3000,"Waiting for landing",0,0.,0.,0.,0.);
+  //    controller->AddStep(500,"Stop",(uint16_t)EmulatedController::ButtonType::select,0.,0.,0.,0.);
+  PidUav *app = new PidUav(drone, controller);
+
+  app->Start();
+  app->Join();
+
+  delete manager;
+}
+
+void parseOptions(int argc, char **argv) {
+  try {
+
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> nameArg("n", "name", "uav name", true, "x4", "string");
+    cmd.add(nameArg);
+
+    ValueArg<string> typeArg(
+        "t", "type", "uav type: ardrone2, hds_x4, hds_x8, hds_xufo, hds_simu "
+                     "or hds_simux (with x the number of the simulated uav)",
+        true, "hds_x4", "string");
+    cmd.add(typeArg);
+
+    ValueArg<string> xmlArg("x", "xml", "fichier xml", true, "./reglages.xml",
+                            "string");
+    cmd.add(xmlArg);
+
+    ValueArg<string> logsArg("l", "logs", "repertoire des logs", true,
+                             "/media/ram", "string");
+    cmd.add(logsArg);
+
+    ValueArg<int> portArg("p", "port", "port pour station sol", true, 9000,
+                          "int");
+    cmd.add(portArg);
+
+    ValueArg<string> addressArg("a", "address", "addresse station sol", true,
+                                "127.0.0.1", "string");
+    cmd.add(addressArg);
+
+    SwitchArg headlessArg("e", "headless", "headless mode", false);
+    cmd.add(headlessArg);
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    uav_type = typeArg.getValue();
+    log_path = logsArg.getValue();
+    port = portArg.getValue();
+    xml_file = xmlArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
+    headless = headlessArg.getValue();
+
+  } catch (ArgException &e) // catch any exceptions
+  {
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
Index: tags/latest/demos/SimpleFleet/simulator/CMakeLists.txt
===================================================================
--- tags/latest/demos/SimpleFleet/simulator/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/SimpleFleet/simulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,31 @@
+PROJECT(SimpleFleet_simulator)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_SIMULATOR TRUE)
+SET(FLAIR_USE_SIMULATOR_GL TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/SimpleFleet/simulator/build
===================================================================
--- tags/latest/demos/SimpleFleet/simulator/build	(revision 209)
+++ tags/latest/demos/SimpleFleet/simulator/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+  <TabWidget name="Main_TabWidget">
+ <Tab name="x8_0">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.001" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="-1.50" name="x:"/>
+    <DoubleSpinBox value="0.0" name="y:"/>
+    <DoubleSpinBox value="-1.2" name="z:"/>
+    <SpinBox value="90" name="yaw (deg):"/>
+   <Vector3DSpinBox name="position" value_x="1.5" value_y="0.00" value_z="-1.00"/></Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.6" name="mass (kg):"/>
+    <DoubleSpinBox value="0.2" name="arm length (m):"/>
+    <DoubleSpinBox value="0" name="position G (m):"/>
+    <DoubleSpinBox value="0.001" name="k_mot:"/>
+    <DoubleSpinBox value="0.001" name="c_mot:"/>
+    <DoubleSpinBox value="0.01" name="f_air_vert:"/>
+    <DoubleSpinBox value="0.4" name="f_air_lat:"/>
+    <DoubleSpinBox value="0.006" name="j_roll:"/>
+    <DoubleSpinBox value="0.006" name="j_pitch:"/>
+    <DoubleSpinBox value="0.1" name="j_yaw:"/>
+    <DoubleSpinBox value="0" name="j_r:"/>
+    <DoubleSpinBox value="0.72" name="sigma:"/>
+    <DoubleSpinBox value="1" name="S:"/>
+   </Tab>
+   <Tab name="us">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0.04" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="6" name="range:"/>
+   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0.0399999991059303"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
+   <Tab name="bottom camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="1" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   </Tab>
+   <Tab name="front camera">
+    <GroupBox name="position">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="direction">
+     <DoubleSpinBox value="1" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="0" name="z:"/>
+    </GroupBox>
+    <GroupBox name="up">
+     <DoubleSpinBox value="0" name="x:"/>
+     <DoubleSpinBox value="0" name="y:"/>
+     <DoubleSpinBox value="-1" name="z:"/>
+    </GroupBox>
+    <DoubleSpinBox value="70" name="fov:"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="target">
+  <TabWidget name="tabs">
+   <Tab name="sampling">
+    <DoubleSpinBox value="0.02" name="Tech (s):"/>
+   </Tab>
+   <Tab name="optitrack">
+    <CheckBox value="1" name="enabled"/>
+   </Tab>
+   <Tab name="init">
+    <DoubleSpinBox value="0" name="x:"/>
+    <DoubleSpinBox value="0" name="y:"/>
+    <DoubleSpinBox value="0" name="z:"/>
+    <SpinBox value="0" name="yaw (deg):"/>
+   </Tab>
+   <Tab name="model">
+    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
+    <DoubleSpinBox value="60" name="rotational speed (deg/s):"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+<Tab name="x8_1"><TabWidget name="tabs"><Tab name="sampling"><DoubleSpinBox name="Tech (s):" value="0.001"/></Tab><Tab name="optitrack"><CheckBox name="enabled" value="1"/></Tab><Tab name="init"><DoubleSpinBox name="x:" value="1.50"/><DoubleSpinBox name="y:" value="0.0"/><DoubleSpinBox name="z:" value="-1.2"/><SpinBox name="yaw (deg):" value="-90"/><Vector3DSpinBox name="position" value_x="-1.5" value_y="0.00" value_z="-1.00"/></Tab><Tab name="model"><DoubleSpinBox name="mass (kg):" value="1.6"/><DoubleSpinBox name="arm length (m):" value="0.2"/><DoubleSpinBox name="position G (m):" value="0"/><DoubleSpinBox name="k_mot:" value="0.001"/><DoubleSpinBox name="c_mot:" value="0.001"/><DoubleSpinBox name="f_air_vert:" value="0.01"/><DoubleSpinBox name="f_air_lat:" value="0.4"/><DoubleSpinBox name="j_roll:" value="0.006"/><DoubleSpinBox name="j_pitch:" value="0.006"/><DoubleSpinBox name="j_yaw:" value="0.1"/><DoubleSpinBox name="j_r:" value="0"/><DoubleSpinBox name="sigma:" value="0.72"/><DoubleSpinBox name="S:" value="1"/></Tab><Tab name="us"><GroupBox name="position"><DoubleSpinBox name="x:" value="0"/><DoubleSpinBox name="y:" value="0"/><DoubleSpinBox name="z:" value="0.04"/></GroupBox><GroupBox name="direction"><DoubleSpinBox name="x:" value="0"/><DoubleSpinBox name="y:" value="0"/><DoubleSpinBox name="z:" value="1"/></GroupBox><DoubleSpinBox name="range:" value="6"/><Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0.0399999991059303"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab></TabWidget></Tab></TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="simulator"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (simulator)" value="1"/></root>
Index: tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/simulator_x8.sh
===================================================================
--- tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
+++ tags/latest/demos/SimpleFleet/simulator/build_x86_64/bin/simulator_x8.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./SimpleFleet_simulator_rt
+else
+	EXEC=./SimpleFleet_simulator_nrt
+fi
+
+$EXEC -n x8 -a 127.0.0.1 -p 9000 -x setup_x8.xml -o 10 -m $FLAIR_ROOT/flair-bin/models -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml
Index: tags/latest/demos/SimpleFleet/simulator/src/main.cpp
===================================================================
--- tags/latest/demos/SimpleFleet/simulator/src/main.cpp	(revision 209)
+++ tags/latest/demos/SimpleFleet/simulator/src/main.cpp	(revision 209)
@@ -0,0 +1,112 @@
+//  created:    2012/04/18
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main simulateur
+//
+//
+/*********************************************************************/
+
+#include <tclap/CmdLine.h>
+#include <Simulator.h>
+#include <X4.h>
+#include <X8.h>
+#include <SimuImu.h>
+#ifdef GL
+#include <Parser.h>
+#include <Man.h>
+#include <SimuUsGL.h>
+#endif
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::simulator;
+using namespace flair::sensor;
+
+int port;
+int opti_time;
+string xml_file;
+string media_path;
+string scene_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv)
+{
+	try
+	{
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> xmlArg("x","xml","xml file",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<int> portArg("p","port","ground station port",true,9002,"int");
+        cmd.add( portArg );
+
+        ValueArg<int> optiArg("o","opti","optitrack time ms",false,0,"int");
+        cmd.add( optiArg );
+#ifdef GL
+        ValueArg<string> mediaArg("m","media","path to media files",true,"./","string");
+        cmd.add( mediaArg );
+
+        ValueArg<string> sceneArg("s","scene","path to scene file",true,"./voliere.xml","string");
+        cmd.add( sceneArg );
+#endif
+        ValueArg<string> addressArg("a","address","ground station address",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        port=portArg.getValue();
+        address=addressArg.getValue();
+        xml_file = xmlArg.getValue();
+        opti_time = optiArg.getValue();
+        name=nameArg.getValue();
+#ifdef GL
+        media_path=mediaArg.getValue();
+        scene_file=sceneArg.getValue();
+#endif
+
+
+	} catch (ArgException &e)  // catch any exceptions
+	{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
+}
+
+
+int main(int argc, char* argv[])
+{
+  Simulator *simu;
+
+  parseOptions(argc,argv);
+
+  simu= new Simulator("simulator",opti_time,90);
+  simu->SetupConnection(address,port);
+  simu->SetupUserInterface(xml_file);
+  #ifdef GL
+  Parser *gui=new Parser(1024,768,1024,768,media_path,scene_file);
+  #endif
+  for(int i=0; i<2;i++) {
+    stringstream uavName;
+    uavName << name.c_str() << "_" << i;
+    Model *drone=new X8(uavName.str(),i);
+#ifdef GL
+    SimuUsGL *us_gl=new SimuUsGL(drone,"us",i,0);
+#endif
+    SimuImu *imu=new SimuImu(drone,"imu",i,0);
+  }
+
+  simu->RunSimu();
+
+  delete simu;
+
+	return 0;
+}
+
Index: tags/latest/demos/SimpleFleet/uav/CMakeLists.txt
===================================================================
--- tags/latest/demos/SimpleFleet/uav/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/CMakeLists.txt	(revision 209)
@@ -0,0 +1,35 @@
+PROJECT(SimpleFleet)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+SET(FLAIR_USE_VRPN TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/SimpleFleet.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/SimpleFleet/uav/build
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet.sh
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet.sh	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet.sh	(revision 209)
@@ -0,0 +1,1 @@
+./SimpleFleet_nrt -a 192.168.147.193 -p 9000 -l /tmp -x SimpleFleet_ardrone2.xml -n Drone_0 -t ardrone2 -b 192.168.147.255
Index: tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet_ardrone2.xml
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet_ardrone2.xml	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build_arm/bin/SimpleFleet_ardrone2.xml	(revision 209)
@@ -0,0 +1,357 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="x4-multiplex">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x4 multiplex">
+     <ComboBox value="1" name="front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="front left"/>
+     <ComboBox value="1" name="front rigth"/>
+     <ComboBox value="2" name="rear left"/>
+     <ComboBox value="3" name="rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-us">
+  <TabWidget name="parrot-us">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-us"/>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="10" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="1" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.8" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="0.8" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="parrot-us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="parrot-imu">
+  <TabWidget name="parrot-imu">
+   <Tab name="Reglages">
+    <GroupBox name="parrot-imu"/>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <DoubleSpinBox value="0.5" name="k_a[0]:"/>
+    <DoubleSpinBox value="0.5" name="k_a[1]:"/>
+    <DoubleSpinBox value="0" name="k_a[2]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[0]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[1]:"/>
+    <DoubleSpinBox value="0.01" name="k_b[2]:"/>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="IMU">
+    <DataPlot1D name="acc_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="acc_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="gyr_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="mag_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10.5" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="1" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="90" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="Drone_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Drone_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.2" name="R"/>
+     <DoubleSpinBox value="0.5" name="velocity"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute)"/>
+    </GroupBox>
+   <DoubleSpinBox name="x circle center" value="0"/><DoubleSpinBox name="y circle center" value="0"/><DoubleSpinBox name="y displacement" value="1.0"/></Tab>
+   <Tab name="Mesures Drone_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) Drone_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="y">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="z">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy">
+     <Setup period="100" enabled="0"/>
+    </DataPlot2D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="camv">
+  <TabWidget name="camv">
+   <Tab name="Setup">
+    <GroupBox name="camv">
+     <DoubleSpinBox value="0" name="gain:"/>
+     <DoubleSpinBox value="0" name="exposure:"/>
+     <DoubleSpinBox value="0" name="bright:"/>
+     <DoubleSpinBox value="0" name="contrast:"/>
+     <DoubleSpinBox value="0" name="hue:"/>
+     <DoubleSpinBox value="0" name="sharpness:"/>
+     <DoubleSpinBox value="0" name="saturation:"/>
+     <CheckBox value="1" name="autogain:"/>
+     <CheckBox value="1" name="autoexposure:"/>
+     <CheckBox value="1" name="awb:"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="0" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.6"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="20" name="sat ref:"/>
+     <DoubleSpinBox value="12" name="kp:"/>
+     <DoubleSpinBox value="1000" name="sat dref:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0.2" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.4" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.4" name="kp:"/>
+     <DoubleSpinBox value="0.1" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="0.4" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.6" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.4" name="sat i:"/>
+     <DoubleSpinBox value="0.4" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="15" name="debattement roll"/>
+     <DoubleSpinBox value="15" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="0.5" name="debattement dz"/>
+     <DoubleSpinBox value="0.02" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="Drone_0"><PushButton name="save config on target" value="1"/></Tab></TabWidget></root>
Index: tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/setup_x8.xml
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/setup_x8.xml	(revision 209)
@@ -0,0 +1,342 @@
+<?xml version="1.0"?>
+<!DOCTYPE remote_ui_xml>
+<root name="interface">
+<TabWidget name="Main_TabWidget">
+ <Tab name="motors">
+  <TabWidget name="UavMultiplex">
+   <Tab name="Setup">
+    <GroupBox name="x8 multiplex">
+     <ComboBox value="0" name="top front left blade pitch:"/>
+    </GroupBox>
+    <GroupBox name="motor attribution">
+     <ComboBox value="0" name="top front left"/>
+     <ComboBox value="1" name="top front rigth"/>
+     <ComboBox value="2" name="top rear left"/>
+     <ComboBox value="3" name="top rear rigth"/>
+     <ComboBox value="4" name="bottom front left"/>
+     <ComboBox value="5" name="bottom front rigth"/>
+     <ComboBox value="6" name="bottom rear left"/>
+     <ComboBox value="7" name="bottom rear rigth"/>
+    </GroupBox>
+    <GroupBox name="bldc">
+     <Label name="flight time"/>
+     <DoubleSpinBox value="0.4" name="min value:"/>
+     <DoubleSpinBox value="1" name="max value:"/>
+     <DoubleSpinBox value="0.1" name="test value:"/>
+     <PushButton value="0" name="test motor 0"/>
+     <PushButton value="0" name="test motor 1"/>
+     <PushButton value="0" name="test motor 2"/>
+     <PushButton value="0" name="test motor 3"/>
+     <PushButton value="0" name="test motor 4"/>
+     <PushButton value="0" name="test motor 5"/>
+     <PushButton value="0" name="test motor 6"/>
+     <PushButton value="0" name="test motor 7"/>
+    </GroupBox>
+    <GroupBox name="simubldc">
+     <DoubleSpinBox value="86" name="k driver:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Values">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Speeds">
+    <DataPlot1D name="front left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="front right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear left" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="rear right" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="us">
+  <TabWidget name="us">
+   <Tab name="Reglages">
+    <GroupBox name="us">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="Vz">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="Passe bas v">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="5" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="alt cons">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+     <DoubleSpinBox value="0.5" name="velocity max (absolute):"/>
+     <DoubleSpinBox value="0.2" name="acceleration (absolute):"/>
+    </GroupBox>
+    <GroupBox name="decollage">
+     <DoubleSpinBox value="1" name="alt decollage"/>
+     <DoubleSpinBox value="0" name="alt atterissage"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Mesures">
+    <DataPlot1D name="us" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="imu">
+  <TabWidget name="imu">
+   <Tab name="Reglages">
+    <GroupBox name="imu">
+     <SpinBox value="200" name="data rate"/>
+    </GroupBox>
+    <GroupBox name="post rotation">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="AHRS">
+    <DataPlot1D name="roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="w_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  <Tab name="Quaternion"><DataPlot1D name="q0" period="100" enabled="0"/><DataPlot1D name="q1" period="100" enabled="0"/><DataPlot1D name="q2" period="100" enabled="0"/><DataPlot1D name="q3" period="100" enabled="0"/></Tab><Tab name="IMU"><DataPlot1D name="acc_x" period="100" enabled="0"/><DataPlot1D name="acc_y" period="100" enabled="0"/><DataPlot1D name="acc_z" period="100" enabled="0"/><DataPlot1D name="gyr_x" period="100" enabled="0"/><DataPlot1D name="gyr_y" period="100" enabled="0"/><DataPlot1D name="gyr_z" period="100" enabled="0"/><DataPlot1D name="mag_x" period="100" enabled="0"/><DataPlot1D name="mag_y" period="100" enabled="0"/><DataPlot1D name="mag_z" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="battery">
+  <GroupBox name="battery">
+   <Label name="battery"/>
+   <DoubleSpinBox value="10" name="threshold"/>
+  </GroupBox>
+ </Tab>
+ <Tab name="simu_cam_v">
+  <TabWidget name="simu_cam_v">
+   <Tab name="Setup">
+    <GroupBox name="simu_cam_v">
+     <SpinBox value="50" name="data rate"/>
+    </GroupBox>
+    <GridLayout name="setup"/>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="vrpn">
+  <TabWidget name="vrpn">
+   <Tab name="Reglages">
+    <GroupBox name="post rotation 1">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="post rotation 2">
+     <DoubleSpinBox value="0" name="value"/>
+     <ComboBox value="0" name="axis"/>
+    </GroupBox>
+    <GroupBox name="x8_0 Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="x8_0_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="target Passe bas">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="2" name="cutoff frequency"/>
+    </GroupBox>
+    <GroupBox name="target_euler">
+     <DoubleSpinBox value="0" name="period, 0 for auto:"/>
+    </GroupBox>
+    <GroupBox name="circle">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1.5" name="R"/>
+     <DoubleSpinBox value="1" name="velocity"/>
+     <DoubleSpinBox value="0.1" name="acceleration (absolute)"/>
+    </GroupBox>
+   <GroupBox name="x8_1 Passe bas"><DoubleSpinBox name="period, 0 for auto" value="0"/><DoubleSpinBox name="cutoff frequency" value="1"/></GroupBox><GroupBox name="x8_1_euler"><DoubleSpinBox name="period, 0 for auto:" value="0"/></GroupBox><DoubleSpinBox name="x circle center" value="0"/><DoubleSpinBox name="y circle center" value="0"/><DoubleSpinBox name="y displacement" value="1"/></Tab>
+   <Tab name="Mesures x8_0">
+    <DataPlot1D name="x" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="1">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) x8_0">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+   <Tab name="Mesures target">
+    <DataPlot1D name="x" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="y" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="z" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="vx" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="vz" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+   </Tab>
+   <Tab name="Mesures (xy) target">
+    <DataPlot2D name="xy" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot2D>
+   </Tab>
+  <Tab name="Mesures x8_1"><DataPlot1D name="x" period="100" enabled="0"/><DataPlot1D name="y" period="100" enabled="0"/><DataPlot1D name="z" period="100" enabled="0"/><DataPlot1D name="vx" period="100" enabled="0"/><DataPlot1D name="vy" period="100" enabled="0"/><DataPlot1D name="vz" period="100" enabled="0"/></Tab><Tab name="Mesures (xy) x8_1"><DataPlot2D name="xy" period="100" enabled="0"/></Tab></TabWidget>
+ </Tab>
+ <Tab name="uav">
+  <GridLayout name="buttons">
+   <PushButton value="0" name="kill"/>
+   <PushButton value="0" name="start_log"/>
+   <PushButton value="0" name="stop_log"/>
+   <PushButton value="1" name="take_off"/>
+   <PushButton value="0" name="landing"/>
+   <PushButton value="0" name="start_circle"/>
+   <PushButton value="0" name="stop_circle"/>
+  <PushButton name="land"/></GridLayout>
+ <GroupBox name="takeoff/landing"><DoubleSpinBox name="desired takeoff altitude" value="1"/><DoubleSpinBox name="desired landing altitude" value="0"/></GroupBox><GroupBox name="alt cons"><DoubleSpinBox name="period, 0 for auto:" value="0"/><DoubleSpinBox name="velocity max (absolute):" value="0.5"/><DoubleSpinBox name="acceleration (absolute):" value="0.2"/></GroupBox></Tab>
+ <Tab name="control laws">
+  <TabWidget name="laws">
+   <Tab name="Setup">
+    <GroupBox name="u_roll">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_pitch">
+     <DoubleSpinBox value="15" name="sat ref:"/>
+     <DoubleSpinBox value="5" name="kp:"/>
+     <DoubleSpinBox value="100" name="sat dref:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.5" name="sat u:"/>
+    </GroupBox>
+    <GroupBox name="u_yaw">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="1" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.2" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_x">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_y">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.2" name="kp:"/>
+     <DoubleSpinBox value="0" name="ki:"/>
+     <DoubleSpinBox value="0" name="sat i:"/>
+     <DoubleSpinBox value="0.2" name="kd:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+    </GroupBox>
+    <GroupBox name="u_z">
+     <DoubleSpinBox value="0" name="period, 0 for auto"/>
+     <DoubleSpinBox value="0.3" name="kp:"/>
+     <DoubleSpinBox value="0.2" name="ki:"/>
+     <DoubleSpinBox value="0.5" name="sat i:"/>
+     <DoubleSpinBox value="0.1" name="kd:"/>
+     <DoubleSpinBox value="0.6" name="offset g:"/>
+     <DoubleSpinBox value="1" name="sat:"/>
+     <DoubleSpinBox value="0.0002" name="offset step:"/>
+    </GroupBox>
+   </Tab>
+   <Tab name="Graphes">
+    <DataPlot1D name="u_roll" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_pitch" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_yaw" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_x" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_y" period="100" enabled="0">
+     <Setup period="100" enabled="0"/>
+    </DataPlot1D>
+    <DataPlot1D name="u_z" period="100" enabled="0">
+     <Setup period="100" enabled="1"/>
+    </DataPlot1D>
+   </Tab>
+  </TabWidget>
+ </Tab>
+ <Tab name="Dualshock3">
+  <TabWidget name="Dualshock3">
+   <Tab name="Reglages">
+    <GroupBox name="consignes joy">
+     <DoubleSpinBox value="-20" name="debattement roll"/>
+     <DoubleSpinBox value="-20" name="debattement pitch"/>
+     <DoubleSpinBox value="90" name="debattement wz"/>
+     <DoubleSpinBox value="-0.7" name="debattement dz"/>
+     <DoubleSpinBox value="0" name="trim"/>
+     <Label name="trim roll"/>
+     <PushButton value="0" name="reset roll trim"/>
+     <Label name="trim pitch"/>
+     <PushButton value="0" name="reset pitch trim"/>
+    </GroupBox>
+   </Tab>
+  </TabWidget>
+ </Tab>
+</TabWidget>
+<TabWidget name="App_TabWidget"><Tab name="x8_0"><PushButton name="save config on target" value="1"/></Tab><Tab name="x8_1"><PushButton name="save config on target" value="1"/></Tab></TabWidget><PushButton name="save config on target (x8_0)" value="1"/></root>
Index: tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_0.sh
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_0.sh	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_0.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./SimpleFleet_rt
+else
+	EXEC=./SimpleFleet_nrt
+fi
+
+$EXEC -n x8_0 -a 127.0.0.1 -p 9000 -l ./ -x setup_x8.xml -t x8_simu0 -b 127.255.255.255:20010
Index: tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_1.sh
===================================================================
--- tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_1.sh	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/build_x86_64/bin/x8_1.sh	(revision 209)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./SimpleFleet_rt
+else
+	EXEC=./SimpleFleet_nrt
+fi
+
+$EXEC -n x8_1 -a 127.0.0.1 -p 9000 -l ./ -x setup_x8.xml -t x8_simu1 -b 127.255.255.255:20010 -d 21000
Index: tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.cpp
===================================================================
--- tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.cpp	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.cpp	(revision 209)
@@ -0,0 +1,360 @@
+//  created:    2015/11/05
+//  filename:   SimpleFleet.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo fleet
+//
+//
+/*********************************************************************/
+
+#include "SimpleFleet.h"
+#include <TargetController.h>
+#include <Uav.h>
+#include <GridLayout.h>
+#include <PushButton.h>
+#include <DataPlot1D.h>
+#include <Ahrs.h>
+#include <MetaUsRangeFinder.h>
+#include <MetaDualShock3.h>
+#include <FrameworkManager.h>
+#include <VrpnClient.h>
+#include <MetaVrpnObject.h>
+#include <TrajectoryGenerator2DCircle.h>
+#include <Vector3D.h>
+#include <Vector2D.h>
+#include <PidThrust.h>
+#include <Euler.h>
+#include <cvmatrix.h>
+#include <AhrsData.h>
+#include <Ahrs.h>
+#include <DoubleSpinBox.h>
+#include <stdio.h>
+#include <cmath>
+#include <Tab.h>
+#include <Pid.h>
+#include <UdpSocket.h>
+#include <string.h>
+
+#define PI ((float)3.14159265358979323846)
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::meta;
+
+
+SimpleFleet::SimpleFleet(string broadcast,TargetController *controller): UavStateMachine(controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
+    Uav* uav=GetUav();
+		
+	VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80);
+	uavVrpn = new MetaVrpnObject(uav->ObjectName());
+	getFrameworkManager()->AddDeviceToLog(uavVrpn);
+	uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
+	vrpnclient->Start();
+
+    circle=new TrajectoryGenerator2DCircle(vrpnclient->GetLayout()->NewRow(),"circle");
+    uavVrpn->xPlot()->AddCurve(circle->Matrix()->Element(0,0),0,0,255);
+    uavVrpn->yPlot()->AddCurve(circle->Matrix()->Element(0,1),0,0,255);
+    uavVrpn->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),0,0,255);
+    uavVrpn->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),0,0,255);
+
+    xCircleCenter=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"x circle center"," m",-5,5,0.1,1,0);
+    yCircleCenter=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"y circle center"," m",-5,5,0.1,1,0);
+    yDisplacement=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"y displacement"," m",0,2,0.1,1,0);
+
+    //parent->AddDeviceToLog(Uz());
+
+    u_x=new Pid(setupLawTab->At(1,0),"u_x");
+    u_x->UseDefaultPlot(graphLawTab->NewRow());
+    u_y=new Pid(setupLawTab->At(1,1),"u_y");
+    u_y->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+    message=new UdpSocket(uav,"Message",broadcast,true);
+
+    customReferenceOrientation= new AhrsData(this,"reference");
+    uav->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow);
+    AddDataToControlLawLog(customReferenceOrientation);
+
+    customOrientation=new AhrsData(this,"orientation");
+/*
+    //check init conditions
+    Vector3D uav_pos;
+    Euler vrpn_euler;
+    GetVrpnObject()->GetPosition(uav_pos);
+    GetVrpnObject()->GetEuler(vrpn_euler);
+
+    if(name=="x8_0") {
+        //x8_0 should be on the left, with 0 yaw
+        if(uav_pos.y>yCircleCenter->Value() || vrpn_euler.yaw>20 || vrpn_euler.yaw<-20) Thread::Err("wrong init position\n");
+    }
+    if(name=="x8_1") {
+        //x8_1 should be on the right, with 180 yaw
+        if(uav_pos.y<yCircleCenter->Value() || (vrpn_euler.yaw<160 && vrpn_euler.yaw>-160)) Thread::Err("wrong init position %f %f\n",yCircleCenter->Value(),vrpn_euler.yaw);
+    }
+    */
+}
+
+SimpleFleet::~SimpleFleet() {
+}
+
+const AhrsData *SimpleFleet::GetOrientation(void) const {
+    //get yaw from vrpn
+		Quaternion vrpnQuaternion;
+    uavVrpn->GetQuaternion(vrpnQuaternion);
+
+    //get roll, pitch and w from imu
+    Quaternion ahrsQuaternion;
+    Vector3Df ahrsAngularSpeed;
+    GetDefaultOrientation()->GetQuaternionAndAngularRates(ahrsQuaternion, ahrsAngularSpeed);
+
+    Euler ahrsEuler=ahrsQuaternion.ToEuler();
+    ahrsEuler.yaw=vrpnQuaternion.ToEuler().yaw;
+    Quaternion mixQuaternion=ahrsEuler.ToQuaternion();
+
+    customOrientation->SetQuaternionAndAngularRates(mixQuaternion,ahrsAngularSpeed);
+
+    return customOrientation;
+}
+
+void SimpleFleet::AltitudeValues(float &z,float &dz) const {
+    Vector3Df uav_pos,uav_vel;
+
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
+    //z and dz must be in uav's frame
+    z=-uav_pos.z;
+    dz=-uav_vel.z;
+}
+
+const AhrsData *SimpleFleet::GetReferenceOrientation(void) {
+    Vector2Df pos_err, vel_err; // in uav coordinate system
+    float yaw_ref;
+    Euler refAngles;
+
+    PositionValues(pos_err, vel_err, yaw_ref);
+
+    refAngles.yaw=yaw_ref;
+
+    u_x->SetValues(pos_err.x, vel_err.x);
+    u_x->Update(GetTime());
+    refAngles.pitch=u_x->Output();
+
+    u_y->SetValues(pos_err.y, vel_err.y);
+    u_y->Update(GetTime());
+    refAngles.roll=-u_y->Output();
+
+    customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0));
+
+    return customReferenceOrientation;
+}
+
+void SimpleFleet::PositionValues(Vector2Df &pos_error,Vector2Df &vel_error,float &yaw_ref) {
+    Vector3Df uav_pos,uav_vel; // in VRPN coordinate system
+    Vector2Df uav_2Dpos,uav_2Dvel; // in VRPN coordinate system
+
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
+
+    uav_pos.To2Dxy(uav_2Dpos);
+    uav_vel.To2Dxy(uav_2Dvel);
+
+    if (behaviourMode==BehaviourMode_t::PositionHold1 || behaviourMode==BehaviourMode_t::PositionHold2
+        || behaviourMode==BehaviourMode_t::PositionHold3 || behaviourMode==BehaviourMode_t::PositionHold4) {
+        pos_error=uav_2Dpos-posHold;
+        vel_error=uav_2Dvel;
+        yaw_ref=yawHold;
+    } else { //Circle
+        Vector2Df circle_pos,circle_vel;
+        Vector2Df target_2Dpos;
+
+        //circle center
+        target_2Dpos.x=xCircleCenter->Value();
+        target_2Dpos.y=yCircleCenter->Value();
+        circle->SetCenter(target_2Dpos);
+
+        //circle reference
+        circle->Update(GetTime());
+        circle->GetPosition(circle_pos);
+        circle->GetSpeed(circle_vel);
+
+        //error in optitrack frame
+        pos_error=uav_2Dpos-circle_pos;
+        vel_error=uav_2Dvel-circle_vel;
+        yaw_ref=PI/2+atan2(uav_pos.y-target_2Dpos.y,uav_pos.x-target_2Dpos.x);
+    }
+    //error in uav frame
+    Quaternion currentQuaternion=GetCurrentQuaternion();
+    Euler currentAngles;//in vrpn frame
+    currentQuaternion.ToEuler(currentAngles);
+    pos_error.Rotate(-currentAngles.yaw);
+    vel_error.Rotate(-currentAngles.yaw);
+}
+
+void SimpleFleet::SignalEvent(Event_t event) {
+    UavStateMachine::SignalEvent(event);
+
+    switch(event) {
+    case Event_t::EmergencyStop:
+        message->SendMessage("EmergencyStop");
+        break;
+    case Event_t::TakingOff:
+        //behaviourMode=BehaviourMode_t::Default;
+        message->SendMessage("TakeOff");
+        VrpnPositionHold();
+        behaviourMode=BehaviourMode_t::PositionHold1;
+        break;
+    case Event_t::StartLanding:
+        VrpnPositionHold();
+        behaviourMode=BehaviourMode_t::PositionHold4;
+        message->SendMessage("Landing");
+        break;
+    case Event_t::EnteringControlLoop:
+        CheckMessages();
+        if ((behaviourMode==BehaviourMode_t::Circle1) && (!circle->IsRunning())) {
+            VrpnPositionHold();
+            behaviourMode=BehaviourMode_t::PositionHold2;
+            if(posHold.y<0) {
+                posHold.y-=yDisplacement->Value();
+            } else {
+                posHold.y+=yDisplacement->Value();
+            }
+            posWait=GetTime();
+            Printf("Circle1 -> PositionHold2\n");
+        }
+        if (behaviourMode==BehaviourMode_t::PositionHold2 && GetTime()>(posWait+3*(Time)1000000000)) {
+            behaviourMode=BehaviourMode_t::PositionHold3;
+            if(posHold.y<0) {
+                posHold.y+=yDisplacement->Value();
+            } else {
+                posHold.y-=yDisplacement->Value();
+            }
+            posWait=GetTime();
+            Printf("PositionHold2 -> PositionHold3\n");
+        }
+        if (behaviourMode==BehaviourMode_t::PositionHold3 && GetTime()>(posWait+3*(Time)1000000000)) {
+            behaviourMode=BehaviourMode_t::Circle2;
+            StartCircle();
+            Printf("PositionHold3 -> Circle2\n");
+        }
+        if ((behaviourMode==BehaviourMode_t::Circle2) && (!circle->IsRunning())) {
+            Printf("Circle2 -> Land\n");
+            behaviourMode=BehaviourMode_t::PositionHold4;
+            Land();
+        }
+
+        break;
+    case Event_t::EnteringFailSafeMode:
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    case Event_t::ZTrajectoryFinished:
+        Printf("PositionHold1 -> Circle1\n");
+        StartCircle();
+        behaviourMode=BehaviourMode_t::Circle1;
+        break;
+    }
+}
+
+void SimpleFleet::CheckMessages(void) {
+    char msg[64];
+    char src[64];
+    size_t src_size=sizeof(src);
+    while(message->RecvMessage(msg,sizeof(msg),TIME_NONBLOCK,src,&src_size)>0) {
+        //printf("%s %s\n",GetUav()->ObjectName().c_str(),src);
+        if(strcmp(src,GetUav()->ObjectName().c_str())!=0) {
+            /*
+            if(strcmp(msg,"StopMotors")==0 && orientation_state!=OrientationState_t::Stopped)
+            {
+                joy->FlashLed(DualShock3::led1,10,10);
+                joy->Rumble(0x70);
+                GetBldc()->SetEnabled(false);
+                GetUavMultiplex()->UnlockUserInterface();
+                altitude_state=AltitudeState_t::Stopped;
+                orientation_state=OrientationState_t::Stopped;
+                GetAhrs()->UnlockUserInterface();
+            }
+*/
+            if(strcmp(msg,"TakeOff")==0) {
+                Printf("TakeOff fleet\n");
+                TakeOff();
+            }
+            if(strcmp(msg,"Landing")==0) {
+                Printf("Landing fleet\n");
+                Land();
+            }
+            if(strcmp(msg,"EmergencyStop")==0) {
+                Printf("EmergencyStop fleet\n");
+                EmergencyStop();
+            }
+        }
+    }
+}
+
+void SimpleFleet::ExtraSecurityCheck(void) {
+    if (!vrpnLost && behaviourMode!=BehaviourMode_t::Default) {
+        if (!uavVrpn->IsTracked(500)) {
+            Thread::Err("Optitrack, uav lost\n");
+            vrpnLost=true;
+            EnterFailSafeMode();
+            Land();
+        }
+    }
+}
+
+void SimpleFleet::ExtraCheckJoystick(void) {
+
+}
+
+void SimpleFleet::StartCircle(void) {
+    if (SetOrientationMode(OrientationMode_t::Custom)) {
+        Thread::Info("Demo flotte: start circle\n");
+    } else {
+        Thread::Warn("Demo flotte: could not start circle\n");
+        return;
+    }
+    Vector3Df uav_pos;
+    Vector2Df uav_2Dpos,target_2Dpos;
+
+    //circle center
+    target_2Dpos.x=xCircleCenter->Value();
+    target_2Dpos.y=yCircleCenter->Value();
+    circle->SetCenter(target_2Dpos);
+
+    uavVrpn->GetPosition(uav_pos);
+    uav_pos.To2Dxy(uav_2Dpos);
+    circle->StartTraj(uav_2Dpos,1);
+
+    u_x->Reset();
+    u_y->Reset();
+}
+
+void SimpleFleet::StopCircle(void) {
+    circle->FinishTraj();
+    //joy->Rumble(0x70);
+    Thread::Info("Demo flotte: finishing circle\n");
+}
+
+void SimpleFleet::VrpnPositionHold(void) {
+  if (SetOrientationMode(OrientationMode_t::Custom)) {
+        Thread::Info("Demo flotte: holding position\n");
+    } else {
+        Thread::Info("Demo flotte: could not hold position\n");
+        //return;
+    }  
+		
+		Quaternion vrpnQuaternion;
+    uavVrpn->GetQuaternion(vrpnQuaternion);
+		yawHold=vrpnQuaternion.ToEuler().yaw;
+
+		Vector3Df vrpnPosition;
+    uavVrpn->GetPosition(vrpnPosition);
+    vrpnPosition.To2Dxy(posHold);
+
+    u_x->Reset();
+    u_y->Reset();
+}
Index: tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.h
===================================================================
--- tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.h	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/src/SimpleFleet.h	(revision 209)
@@ -0,0 +1,83 @@
+//  created:    2015/11/05
+//  filename:   SimpleFleet.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    demo fleet
+//
+//
+/*********************************************************************/
+
+#ifndef SIMPLEFLEET_H
+#define SIMPLEFLEET_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+    namespace core {
+        class FrameworkManager;
+        class UdpSocket;
+        class AhrsData;
+    }
+    namespace filter {
+        class TrajectoryGenerator2DCircle;
+    }
+		namespace meta {
+        class MetaVrpnObject;
+    }
+    namespace gui {
+        class DoubleSpinBox;
+    }
+}
+
+
+class SimpleFleet : public flair::meta::UavStateMachine {
+    public:
+        SimpleFleet(std::string broadcast,flair::sensor::TargetController *controller);
+        ~SimpleFleet();
+
+    private:
+        enum class BehaviourMode_t {
+            Default,
+            PositionHold1,
+            Circle1,
+            PositionHold2,
+            PositionHold3,
+            Circle2,
+            PositionHold4,
+        };
+
+//        BehaviourMode_t orientation_state;
+        BehaviourMode_t behaviourMode;
+        bool vrpnLost;
+
+        void VrpnPositionHold(void);//flight mode
+        void StartCircle(void);
+        void StopCircle(void);
+        void ExtraTakeOff(void);
+        void ExtraSecurityCheck(void);
+        void ExtraCheckJoystick(void);
+        const flair::core::AhrsData *GetOrientation(void) const;
+        void AltitudeValues(float &z,float &dz) const;
+        void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
+        const flair::core::AhrsData *GetReferenceOrientation(void);
+        void SignalEvent(Event_t event);
+        void CheckMessages(void);
+
+        flair::filter::Pid *u_x, *u_y;
+
+        flair::core::Vector2Df posHold;
+        float yawHold;
+        flair::core::UdpSocket *message;
+        flair::core::Time posWait;
+
+        flair::filter::TrajectoryGenerator2DCircle *circle;
+        flair::gui::DoubleSpinBox *xCircleCenter,*yCircleCenter,*yDisplacement;
+        flair::core::AhrsData *customReferenceOrientation,*customOrientation;
+				flair::meta::MetaVrpnObject *uavVrpn;
+};
+
+#endif // SIMPLEFLEET_H
Index: tags/latest/demos/SimpleFleet/uav/src/main.cpp
===================================================================
--- tags/latest/demos/SimpleFleet/uav/src/main.cpp	(revision 209)
+++ tags/latest/demos/SimpleFleet/uav/src/main.cpp	(revision 209)
@@ -0,0 +1,103 @@
+//  created:    2011/05/01
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code uav
+//
+//
+/*********************************************************************/
+
+#include "SimpleFleet.h"
+#include <FrameworkManager.h>
+#include <UavFactory.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+#include <TargetEthController.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string broadcast;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupLogger(log_path);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+
+    Uav* drone=CreateUav(name,uav_type);
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    SimpleFleet* demo=new SimpleFleet(broadcast,controller);
+
+    demo->Start();
+    demo->Join();
+
+    delete manager;
+}
+
+
+void parseOptions(int argc, char** argv) {
+	try {
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, x4_simu, x8_simu or x4_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        ValueArg<string> broadcastArg("b","broadcast","broadcast ip address and port,",true,"127.255.255.255:20001","string");
+        cmd.add( broadcastArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        broadcast=broadcastArg.getValue();
+        uav_type=typeArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e) { // catch any exceptions
+        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+	}
+}
Index: tags/latest/demos/Sinus/CMakeLists.txt
===================================================================
--- tags/latest/demos/Sinus/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/Sinus/CMakeLists.txt	(revision 209)
@@ -0,0 +1,37 @@
+PROJECT(Sinus)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/Loop.cpp
+	${CMAKE_SOURCE_DIR}/src/Sinus.cpp
+	${CMAKE_SOURCE_DIR}/src/MeanFilter.cpp
+)
+
+LINK_DIRECTORIES (
+	${FLAIR_LIBRARY_DIR}
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/Sinus/build
===================================================================
--- tags/latest/demos/Sinus/build	(revision 209)
+++ tags/latest/demos/Sinus/build	(revision 209)
@@ -0,0 +1,1 @@
+link build_x86_64
Index: tags/latest/demos/Sinus/build_arm/bin/Sinus.sh
===================================================================
--- tags/latest/demos/Sinus/build_arm/bin/Sinus.sh	(revision 209)
+++ tags/latest/demos/Sinus/build_arm/bin/Sinus.sh	(revision 209)
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./Sinus_rt
+else
+	EXEC=./Sinus_nrt
+fi
+
+$EXEC  -a ${1}
+
Index: tags/latest/demos/Sinus/build_arm/bin/Sinus.xml
===================================================================
--- tags/latest/demos/Sinus/build_arm/bin/Sinus.xml	(revision 209)
+++ tags/latest/demos/Sinus/build_arm/bin/Sinus.xml	(revision 209)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<root name="FrameworkManager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="Loop">
+      <PushButton name="kill"/>
+      <PushButton name="start_log"/>
+      <PushButton name="stop_log"/>
+      <SpinBox name="period thread:" value="10"/>
+    </Tab>
+    <Tab name="sinus">
+      <TabWidget name="sinus">
+        <Tab name="Settings">
+          <GroupBox name="sinus">
+            <DoubleSpinBox name="frequence:" value="1.00"/>
+            <DoubleSpinBox name="amplitude:" value="1.00"/>
+            <DoubleSpinBox name="offset:" value="8.00"/>
+          </GroupBox>
+          <SpinBox name="period thread:" value="10"/>
+          <GridLayout name="setup">
+            <GroupBox name="1st order lawpass filter">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="1"/>
+            </GroupBox>
+            <GroupBox name="3rd order lawpass filter">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="1"/>
+            </GroupBox>
+            <GroupBox name="Mean filter">
+              <SpinBox name="numberOfElements:" value="10"/>
+            </GroupBox>
+            <GroupBox name="Mean filter on 1st order lawpass filter">
+              <SpinBox name="numberOfElements:" value="10"/>
+            </GroupBox>
+          </GridLayout>
+        </Tab>
+        <Tab name="Graph">
+          <DataPlot1D name="Sinus" period="100" enabled="1"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+  </TabWidget>
+  <PushButton name="save config on target (Sinus)" value="1"/>
+</root>
Index: tags/latest/demos/Sinus/build_x86_64/bin/Sinus.sh
===================================================================
--- tags/latest/demos/Sinus/build_x86_64/bin/Sinus.sh	(revision 209)
+++ tags/latest/demos/Sinus/build_x86_64/bin/Sinus.sh	(revision 209)
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+. $FLAIR_ROOT/flair-dev/scripts/ubuntu_cgroup_hack.sh
+
+if [ -f /proc/xenomai/version ];then
+	EXEC=./Sinus_rt
+else
+	EXEC=./Sinus_nrt
+fi
+
+$EXEC
+
Index: tags/latest/demos/Sinus/build_x86_64/bin/Sinus.xml
===================================================================
--- tags/latest/demos/Sinus/build_x86_64/bin/Sinus.xml	(revision 209)
+++ tags/latest/demos/Sinus/build_x86_64/bin/Sinus.xml	(revision 209)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<root name="FrameworkManager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="Loop">
+      <PushButton name="kill"/>
+      <PushButton name="start_log"/>
+      <PushButton name="stop_log"/>
+      <SpinBox name="period thread:" value="10"/>
+    </Tab>
+    <Tab name="sinus">
+      <TabWidget name="sinus">
+        <Tab name="Settings">
+          <GroupBox name="sinus">
+            <DoubleSpinBox name="frequence:" value="1.00"/>
+            <DoubleSpinBox name="amplitude:" value="1.00"/>
+            <DoubleSpinBox name="offset:" value="8.00"/>
+          </GroupBox>
+          <SpinBox name="period thread:" value="10"/>
+          <GridLayout name="setup">
+            <GroupBox name="1st order lawpass filter">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="1"/>
+            </GroupBox>
+            <GroupBox name="3rd order lawpass filter">
+              <DoubleSpinBox name="period, 0 for auto" value="0"/>
+              <DoubleSpinBox name="cutoff frequency" value="1"/>
+            </GroupBox>
+            <GroupBox name="Mean filter">
+              <SpinBox name="numberOfElements:" value="10"/>
+            </GroupBox>
+            <GroupBox name="Mean filter on 1st order lawpass filter">
+              <SpinBox name="numberOfElements:" value="10"/>
+            </GroupBox>
+          </GridLayout>
+        </Tab>
+        <Tab name="Graph">
+          <DataPlot1D name="Sinus" period="100" enabled="1"/>
+        </Tab>
+      </TabWidget>
+    </Tab>
+  </TabWidget>
+  <PushButton name="save config on target (Sinus)" value="1"/>
+</root>
Index: tags/latest/demos/Sinus/src/Loop.cpp
===================================================================
--- tags/latest/demos/Sinus/src/Loop.cpp	(revision 209)
+++ tags/latest/demos/Sinus/src/Loop.cpp	(revision 209)
@@ -0,0 +1,112 @@
+//  created:    2013/06/26
+//  filename:   Loop.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//
+//
+/*********************************************************************/
+
+// include header of the class
+#include "Loop.h"
+// include only header of class declared in Loop.h (forward declaration)
+#include "Sinus.h"
+#include "MeanFilter.h"
+#include <LowPassFilter.h>
+#include <ButterworthLowPass.h>
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <SpinBox.h>
+#include <PushButton.h>
+#include <DataPlot1D.h>
+#include <cvmatrix.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::sensor;
+
+Loop::Loop(FrameworkManager *parent, string name, int priority)
+    : Thread(parent, name, priority) {
+  Tab *mainTab = new Tab(parent->GetTabWidget(), ObjectName());
+  killButton = new PushButton(mainTab->NewRow(), "kill");
+  startLogButton = new PushButton(mainTab->NewRow(), "start_log");
+  stopLogButton = new PushButton(mainTab->LastRowLastCol(), "stop_log");
+  period = new SpinBox(mainTab->NewRow(), "period thread:", " ms", 10, 1000, 1);
+
+  sinus = new Sinus(parent, "sinus");
+  sinus->UseDefaultPlot();
+
+  // 1st order law pass filter on raw signal, its parent is the sinus
+  firstLowPass = new LowPassFilter(sinus, sinus->GetSetupLayout()->NewRow(),
+                                   "1st order lawpass filter");
+  sinus->GetPlot()->AddCurve(
+      firstLowPass->Matrix()->Element(0),
+      DataPlot::Blue); // add output of the filter to signal's graph
+
+  // 3rd order law pass filter on raw signal, its parent is the sinus
+  thirdLowPass = new ButterworthLowPass(
+      sinus, sinus->GetSetupLayout()->NewRow(), "3rd order lawpass filter", 3);
+  sinus->GetPlot()->AddCurve(
+      thirdLowPass->Matrix()->Element(0),
+      DataPlot::Yellow); // add output of the filter to signal's graph
+
+  // mean filter on raw signal, its parent is the sinus
+  mean =
+      new MeanFilter(sinus, sinus->GetSetupLayout()->NewRow(), "Mean filter");
+  sinus->GetPlot()->AddCurve(
+      mean->GetMatrix()->Element(0),
+      DataPlot::Green); // add output of the filter to signal's graph
+
+  // mean filter on 1st order law pass filter, its parent is the 1st order law
+  // pass filter
+  meanOnfirstLowPass =
+      new MeanFilter(firstLowPass, sinus->GetSetupLayout()->NewRow(),
+                     "Mean filter on 1st order lawpass filter");
+  sinus->GetPlot()->AddCurve(
+      meanOnfirstLowPass->GetMatrix()->Element(0),
+      DataPlot::Black); // add output of the filter to signal's graph
+
+  // set ojects to be logged
+  // as the law pass filters and the mean filters have the sinus as parent, they
+  // are automatically logged
+  parent->AddDeviceToLog(sinus);
+}
+
+Loop::~Loop() {}
+
+// main loop of the Thread
+void Loop::Run(void) {
+  // warn if changing from primary to secondary mode when in real time
+  WarnUponSwitches(true);
+
+  sinus->Start();
+
+  SetPeriodMS(period->Value());
+
+  while (1) {
+    WaitPeriod();
+
+    if (period->ValueChanged())
+      SetPeriodMS(period->Value());
+
+    if (killButton->Clicked())
+      break;
+    if (startLogButton->Clicked())
+      getFrameworkManager()->StartLog();
+    if (stopLogButton->Clicked())
+      getFrameworkManager()->StopLog();
+
+    // nothing more to do
+    // this is a very simple example
+
+    // normaly, we should use results of filters to calculate a control law
+  }
+
+  WarnUponSwitches(false);
+}
Index: tags/latest/demos/Sinus/src/Loop.h
===================================================================
--- tags/latest/demos/Sinus/src/Loop.h	(revision 209)
+++ tags/latest/demos/Sinus/src/Loop.h	(revision 209)
@@ -0,0 +1,68 @@
+//  created:    2013/06/26
+//  filename:   Loop.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//
+//
+/*********************************************************************/
+
+#ifndef LOOP_H
+#define LOOP_H
+
+// necessary include, as Thread is a base of our class
+#include <Thread.h>
+
+// forward declaration for other classes
+namespace flair {
+namespace core {
+class FrameworkManager;
+}
+namespace gui {
+class PushButton;
+class SpinBox;
+}
+namespace sensor {
+class Sinus;
+}
+namespace filter {
+class LowPassFilter;
+class ButterworthLowPass;
+class MeanFilter;
+}
+}
+
+class Loop : public flair::core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds main loop
+  *
+  * \param parent the FrameworkManager to use
+  * \param name object name
+  * \param priority Thread priority, 51 by default (1:mini, 99:maxi)
+  */
+  Loop(flair::core::FrameworkManager *parent, std::string name,
+       int priority = 51);
+
+  /*!
+  * \brief Destructor
+  */
+  ~Loop();
+
+private:
+  void Run(void);
+
+  flair::sensor::Sinus *sinus;
+  flair::filter::LowPassFilter *firstLowPass;
+  flair::filter::ButterworthLowPass *thirdLowPass;
+  flair::filter::MeanFilter *mean, *meanOnfirstLowPass;
+  flair::gui::PushButton *startLogButton, *stopLogButton, *killButton;
+  flair::gui::SpinBox *period;
+};
+
+#endif // LOOP_H
Index: tags/latest/demos/Sinus/src/MeanFilter.cpp
===================================================================
--- tags/latest/demos/Sinus/src/MeanFilter.cpp	(revision 209)
+++ tags/latest/demos/Sinus/src/MeanFilter.cpp	(revision 209)
@@ -0,0 +1,89 @@
+//  created:    2013/06/27
+//  filename:   MeanFilter.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    object computing a mean filter
+//
+//
+/*********************************************************************/
+
+#include "MeanFilter.h"
+#include <cvmatrix.h>
+#include <LayoutPosition.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+MeanFilter::MeanFilter(const IODevice *parent, const LayoutPosition *position,
+                       string name)
+    : IODevice(parent, name) {
+  // interface initialisation
+  groupBox = new GroupBox(position, name);
+  numberOfElements = new SpinBox(groupBox->NewRow(), "numberOfElements:", 1,
+                                 MAX_NUMBER_OF_ELEMENTS,
+                                 1); // saturated to MAX_NUMBER_OF_ELEMENTS
+
+  // init storage
+  for (int i = 0; i < MAX_NUMBER_OF_ELEMENTS; i++)
+    previousValues[i] = 0;
+
+  // 1*1 output matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0,
+                       "mean filter"); // name will be used for graphs and logs
+  output = new cvmatrix(this, desc, floatType, name);
+  delete desc;
+
+  AddDataToLog(output);
+  
+  SetIsReady(true);
+}
+
+MeanFilter::~MeanFilter() {}
+
+cvmatrix *MeanFilter::GetMatrix() const { return output; }
+
+float MeanFilter::GetValue(void) const { return output->Value(0, 0); }
+
+// UpdateFrom, where we implement the filter
+// this method is automatically called when the parent IODevice calls
+// ProcessUpdate
+// in our case it is the sinus or the 1st orde law pass filter
+//(see in Sinus::Run the call to ProcessUpdate)
+void MeanFilter::UpdateFrom(const io_data *data) {
+
+  float result = 0;
+  // get input argument in a cvmatrix
+  cvmatrix *input = (cvmatrix *)data;
+
+  // simple (and not efficent!) implementation of the filter
+  previousValues[numberOfElements->Value() - 1] = input->Value(0, 0);
+  for (int i = 0; i < numberOfElements->Value(); i++)
+    result += previousValues[i];
+  for (int i = 1; i < numberOfElements->Value(); i++)
+    previousValues[i - 1] = previousValues[i];
+
+  // put the result in output matrix
+  output->SetValue(0, 0, result / numberOfElements->Value());
+  // put corresponding time
+  output->SetDataTime(data->DataTime());
+
+  // ProcessUpdate is very important
+  // we must call it after updating the output matrix
+  // it allows:
+  // -to save value in the logs
+  // -to automatically call the next filter UpdateFrom method
+  ProcessUpdate(output);
+}
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/demos/Sinus/src/MeanFilter.h
===================================================================
--- tags/latest/demos/Sinus/src/MeanFilter.h	(revision 209)
+++ tags/latest/demos/Sinus/src/MeanFilter.h	(revision 209)
@@ -0,0 +1,93 @@
+//  created:    2013/06/27
+//  filename:   MeanFilter.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    object computing a mean filter
+//
+//
+/*********************************************************************/
+
+#ifndef MEANFILTER_H
+#define MEANFILTER_H
+
+// we fix the max number of elements to compute the mean
+// this is a simple example, it should be dynamical
+#define MAX_NUMBER_OF_ELEMENTS 200
+
+// necessary include, as IODevice is a base of our class
+#include <IODevice.h>
+
+// forward declaration for other classes
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class GroupBox;
+class SpinBox;
+}
+}
+
+// MeanFilter is a class computing a mean
+// based on a parametrizable number of elements
+// it derives on IODevice as it as an input and an output
+// it is a filter, we extend the namespace
+namespace flair {
+namespace filter {
+class MeanFilter : public core::IODevice {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds a mean filter. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  *
+  * \param parent IODevice to use as parent
+  * \param position where to place settings
+  * \param name name of the object
+  */
+  MeanFilter(const core::IODevice *parent, const gui::LayoutPosition *position,
+             std::string name);
+
+  /*!
+  * \brief Destructor
+  */
+  ~MeanFilter();
+
+  /*!
+  * \brief Output matrix
+  *
+  * allows to access output matrix, to get signal value or to put it in a graph.
+  *\n
+  *
+  * \return pointer to the output matrix
+  */
+  core::cvmatrix *GetMatrix(void) const;
+
+  /*!
+  * \brief Value
+  *
+  * this method is equivalent to GetMatrix()->Value(0,0)
+  *
+  * \return actual mean value
+  */
+  float GetValue(void) const;
+
+private:
+  // UpdateFrom method from base class IODevice
+  void UpdateFrom(const core::io_data *data);
+  gui::GroupBox *groupBox;
+  gui::SpinBox *numberOfElements;
+  core::cvmatrix *output;
+  float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage
+};
+} // end namespace filter
+} // end namespace flair
+#endif // MEANFILTER_H
Index: tags/latest/demos/Sinus/src/Sinus.cpp
===================================================================
--- tags/latest/demos/Sinus/src/Sinus.cpp	(revision 209)
+++ tags/latest/demos/Sinus/src/Sinus.cpp	(revision 209)
@@ -0,0 +1,138 @@
+//  created:    2013/06/26
+//  filename:   Sinus.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class generating a sinus signal
+//
+//
+/*********************************************************************/
+
+#include "Sinus.h"
+#include <FrameworkManager.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <SpinBox.h>
+#include <DataPlot1D.h>
+#include <cvmatrix.h>
+#include <math.h>
+
+#define PI ((float)3.14159265358979323846)
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+Sinus::Sinus(const FrameworkManager *parent, string name, int priority)
+    : IODevice(parent, name), Thread(parent, name, priority) {
+
+  plot = NULL;
+
+  // 1*1 output matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0, "value"); // name will be used for graphs and logs
+  output = new cvmatrix((IODevice *)this, desc, floatType, name);
+  delete desc;
+
+  AddDataToLog(output);
+
+  // interface initialisation
+  mainTab = new Tab(parent->GetTabWidget(), name);
+  tabWidget = new TabWidget(mainTab->NewRow(), name);
+
+  Tab *settingsTab = new Tab(tabWidget, "Settings");
+  GroupBox *sinusGroupBox = new GroupBox(settingsTab->NewRow(), name);
+  frequency = new DoubleSpinBox(sinusGroupBox->NewRow(), "frequence:", " Hz", 0,
+                                100, 1);
+  amplitude = new DoubleSpinBox(sinusGroupBox->LastRowLastCol(), "amplitude:",
+                                0, 10, 1);
+  offset =
+      new DoubleSpinBox(sinusGroupBox->LastRowLastCol(), "offset:", 0, 10, 1);
+  period =
+      new SpinBox(settingsTab->NewRow(), "period thread:", " ms", 1, 1000, 1);
+
+  setupLayout = new GridLayout(
+      settingsTab->NewRow(),
+      "setup"); // layout sui servira à placer des filtres par exemple
+      
+  SetIsReady(true);
+}
+
+Sinus::~Sinus() {
+
+  SafeStop();
+  Join();
+
+  // main_tab has the FrameworkManager as parent; it will be destroyed when
+  // FrameworkManager is destroyed
+  // it is cleaner to delete it manually, because main_tab is unnecessary when
+  // Sinus is deleted
+  delete mainTab;
+}
+
+void Sinus::UseDefaultPlot(void) {
+  Tab *plotTab = new Tab(tabWidget, "Graph");
+  plot = new DataPlot1D(plotTab->NewRow(), "Sinus", -10, 10);
+  plot->AddCurve(output->Element(0), DataPlot::Red);
+}
+
+GridLayout *Sinus::GetSetupLayout(void) const { return setupLayout; }
+
+DataPlot1D *Sinus::GetPlot(void) const {
+  if (plot == NULL)
+    Printf("Sinus::Plot, plot not yet defined, call UseDefaultPlot first\n");
+  return plot;
+}
+
+cvmatrix *Sinus::GetMatrix(void) const { return output; }
+
+float Sinus::GetValue(void) const { return output->Value(0, 0); }
+
+// main function, where  we compute the signal
+void Sinus::Run(void) {
+
+  SetPeriodMS(period->Value());
+
+  // warn if changing from primary to secondary mode when in real time
+  WarnUponSwitches(true);
+
+  Time initTime = GetTime();
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (period->ValueChanged() == true)
+      SetPeriodMS(period->Value());
+
+    // compute sinus
+    Time actualTime = GetTime();
+    float value =
+        offset->Value() +
+        amplitude->Value() *
+            sinf(2 * PI * frequency->Value() * (actualTime - initTime) /
+                 1000000000.); // les temps sont en nanosecondes
+
+    // put the result in output matrix
+    output->SetValue(0, 0, value);
+    // put corresponding time
+    output->SetDataTime(actualTime);
+
+    // ProcessUpdate is very important
+    // we must call it after updating the output matrix
+    // it allows:
+    // -to save value in the logs
+    // -to automatically call the next filter UpdateFrom method
+    ProcessUpdate(output);
+  }
+}
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/demos/Sinus/src/Sinus.h
===================================================================
--- tags/latest/demos/Sinus/src/Sinus.h	(revision 209)
+++ tags/latest/demos/Sinus/src/Sinus.h	(revision 209)
@@ -0,0 +1,125 @@
+//  created:    2013/06/26
+//  filename:   Sinus.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class generating a sinus signal
+//
+//
+/*********************************************************************/
+
+#ifndef SINUS_H
+#define SINUS_H
+
+// necessary includes, as IODevice and Thread are bases of our class
+#include <IODevice.h>
+#include <Thread.h>
+
+// forward declaration for other classes
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GridLayout;
+class DoubleSpinBox;
+class SpinBox;
+class DataPlot1D;
+}
+}
+
+// sinus is a class generating a sinus signal
+// in this example, it emulates a sensonr, so we extend the namespace sensor
+// it derives frome
+// IODevice: as it has an ouput
+// Thread: is it a thread
+namespace flair {
+namespace sensor {
+class Sinus : public core::IODevice, public core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds a sinus generator
+  *
+  * \param parent the FrameworkManager to use
+  * \param name object name
+  * \param priority Thread priority, 50 by default (1:mini, 99:maxi)
+  */
+  Sinus(const core::FrameworkManager *parent, std::string name,
+        int priority = 50);
+
+  /*!
+  * \brief Destructor
+  */
+  ~Sinus();
+
+  /*!
+  * \brief Output matrix
+  *
+  * allows to access output matrix, to get signal value or to put it in a graph.
+  *\n
+  *
+  * \return un pointeur vers la matrice de sortie
+  */
+  core::cvmatrix *GetMatrix(void) const;
+
+  /*!
+  * \brief Value
+  *
+  * this method is equivalent to GetMatrix()->Value(0,0)
+  *
+  * \return actual signal value
+  */
+  float GetValue(void) const;
+
+  /*!
+  * \brief Use defautl plot
+  *
+  * this method put a graph in a specific tab
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief SetupLayout
+  *
+  * this method allows to add other widgets in the sinus tab.
+  *
+  * \return the GridLayout
+  */
+  gui::GridLayout *GetSetupLayout(void) const;
+
+  /*!
+  * \brief Plot
+  *
+  * this method allows to add other curves in the graph
+  *
+  * \return the DataPlot1D
+  */
+  gui::DataPlot1D *GetPlot(void) const;
+
+private:
+  // UpdateFrom method from base class IODevice
+  // sinus is like a sensor, so it does not have input; we define an empty
+  // method
+  void UpdateFrom(const core::io_data *data){};
+  void Run(void);
+
+  core::cvmatrix *output;
+  gui::Tab *mainTab;
+  gui::TabWidget *tabWidget;
+  gui::DataPlot1D *plot;
+  gui::DoubleSpinBox *frequency, *amplitude, *offset;
+  gui::SpinBox *period;
+  gui::GridLayout *setupLayout;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SINUS_H
Index: tags/latest/demos/Sinus/src/main.cpp
===================================================================
--- tags/latest/demos/Sinus/src/main.cpp	(revision 209)
+++ tags/latest/demos/Sinus/src/main.cpp	(revision 209)
@@ -0,0 +1,97 @@
+//  created:    2013/06/26
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//
+//
+/*********************************************************************/
+
+#include "Loop.h"
+#include <FrameworkManager.h>
+#include <tclap/CmdLine.h>
+#include <stdio.h>
+
+// we use namespace std, to avoid writing for examlpe std::string
+using namespace std;
+// idem for TCLAP
+using namespace TCLAP;
+// idem for flair
+using namespace flair::core;
+
+// global variables for the command line arguments
+string logPath; // path for logs
+string address; // address for FlairGCS
+int port; // port for FlairGCS
+string xmlFile; // setup xml file
+string name; // name
+
+void parseOptions(int argc, char **argv);
+
+int main(int argc, char *argv[]) {
+  // get command line arguments (name,port,xml_file,log_path)
+  parseOptions(argc, argv);
+
+  // creation of FrameworkManager
+  FrameworkManager *manager;
+  manager = new FrameworkManager(name);
+  manager->SetupConnection(address, port);
+  manager->SetupUserInterface(xmlFile);
+  manager->SetupLogger(logPath);
+
+  // creation of the
+  Loop *example = new Loop(manager, "Loop");
+
+  // start loop
+  example->Start();
+
+  // wait for loop ends (with kill button)
+  example->Join();
+
+  delete manager;
+}
+
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    // name of the FrameworkManager, Sinus by default
+    ValueArg<string> nameArg("n", "name", "program name", false, "Sinus",
+                             "string");
+    cmd.add(nameArg);
+
+    // setup xml file, ./Sinus.xml by default
+    ValueArg<string> xmlArg("x", "xml", "xml file", false, "./Sinus.xml",
+                            "string");
+    cmd.add(xmlArg);
+
+    // log path, ./ by defaults
+    ValueArg<string> logArg("l", "log", "log path", false, "/tmp", "string");
+    cmd.add(logArg);
+
+    // address for FlairGCS
+    ValueArg<string> addressArg("a", "address",
+                                "address for FlairGCS station sol", false,
+                                "127.0.0.1", "string");
+    cmd.add(addressArg);
+
+    // port for FlairGCS, 9000 by default
+    ValueArg<int> portArg("p", "port", "port for FlairGCS", false, 9000, "int");
+    cmd.add(portArg);
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    logPath = logArg.getValue();
+    port = portArg.getValue();
+    xmlFile = xmlArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
+
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
Index: tags/latest/demos/Skeletons/CustomReferenceAngles/CMakeLists.txt
===================================================================
--- tags/latest/demos/Skeletons/CustomReferenceAngles/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/Skeletons/CustomReferenceAngles/CMakeLists.txt	(revision 209)
@@ -0,0 +1,34 @@
+PROJECT(CustomReferenceAngles)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/MyApp.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/Skeletons/CustomReferenceAngles/README
===================================================================
--- tags/latest/demos/Skeletons/CustomReferenceAngles/README	(revision 209)
+++ tags/latest/demos/Skeletons/CustomReferenceAngles/README	(revision 209)
@@ -0,0 +1,8 @@
+CustomReferenceAngles
+
+This is a minimal skeleton to use the UavStateMachine class.
+It shows how to set custom reference angles, and use the default control laws.
+
+The custom reference angle mode is activated by clicking on the "start CustomReferenceAngles" button on ground station, or with R1 button on the Dualshock 3.
+The custom reference angle mode is deactivated by clicking on the "stop CustomReferenceAngles" button on ground station, or with X button on the Dualshock 3.
+
Index: tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.cpp
===================================================================
--- tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.cpp	(revision 209)
+++ tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.cpp	(revision 209)
@@ -0,0 +1,108 @@
+//  created:    2015/10/27
+//  filename:   MyApp.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    skeleton to use UavStateMachine with custom reference angles only
+//
+//
+/*********************************************************************/
+
+//include files, add yours
+#include "MyApp.h"
+#include <GridLayout.h>
+#include <PushButton.h>
+#include <MetaDualShock3.h>
+#include <FrameworkManager.h>
+#include <AhrsData.h>
+#include <Ahrs.h>
+#include <Uav.h>
+
+//namespaces, add others if necessary (filter, sensor, actuator)
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+MyApp::MyApp(TargetController *controller): UavStateMachine(controller), behaviourMode(BehaviourMode_t::Default) {
+    start_CustomAngles=new PushButton(GetButtonsLayout()->NewRow(),"start CustomReferenceAngles");
+    stop_CustomAngles=new PushButton(GetButtonsLayout()->NewRow(),"stop CustomReferenceAngles");
+
+    customReferenceOrientation= new AhrsData(this,"reference");
+    GetUav()->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow);
+    AddDataToControlLawLog(customReferenceOrientation);
+}
+
+MyApp::~MyApp() {
+}
+
+//this method is called by UavStateMachine::Run (main loop) when OrientationMode is Custom
+AhrsData *MyApp::GetReferenceOrientation(void) {
+    //compute the reference angles (for example depending on a position error)
+    //reference angular speed is set to 0
+
+    Euler refAngles;
+    //refAngles.roll=;
+    //refAngles.pitch=;
+    //refAngles.yaw=;
+
+    customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0));
+
+    return customReferenceOrientation;
+}
+
+void MyApp::SignalEvent(Event_t event) {
+    UavStateMachine::SignalEvent(event);
+    switch(event) {
+    case Event_t::TakingOff:
+        //always take off in default mode
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    case Event_t::EnteringFailSafeMode:
+        //return to default mode
+        Thread::Info("CustomReferenceAngles: stop\n");
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    }
+}
+
+void MyApp::ExtraCheckPushButton(void) {
+    if(start_CustomAngles->Clicked() && (behaviourMode!=BehaviourMode_t::CustomReferenceAngles)) {
+        StartCustomAngles();
+    }
+
+    if(stop_CustomAngles->Clicked() && (behaviourMode==BehaviourMode_t::CustomReferenceAngles)) {
+        StopCustomAngles();
+    }
+}
+
+void MyApp::ExtraCheckJoystick(void) {
+    //R1
+    if(GetJoystick()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomReferenceAngles)) {
+        StartCustomAngles();
+    }
+
+    //stop is not managed here, it is done in UavStateMachine with cross button
+    //pushing cross button will enter fail safe mode and signal the EnteringFailSafeMode event
+}
+
+void MyApp::StartCustomAngles(void) {
+    //ask UavStateMachine to enter in custom orientation mode
+    if (SetOrientationMode(OrientationMode_t::Custom)) {
+        Thread::Info("CustomReferenceAngles: start\n");
+    } else {
+        Thread::Warn("CustomReferenceAngles: could not start\n");
+        return;
+    }
+
+    behaviourMode=BehaviourMode_t::CustomReferenceAngles;
+}
+
+void MyApp::StopCustomAngles(void) {
+    //just ask to enter fail safe mode
+    EnterFailSafeMode();
+}
Index: tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.h
===================================================================
--- tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.h	(revision 209)
+++ tags/latest/demos/Skeletons/CustomReferenceAngles/src/MyApp.h	(revision 209)
@@ -0,0 +1,55 @@
+//  created:    2015/10/27
+//  filename:   MyApp.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    skeleton to use UavStateMachine with custom reference angles only
+//
+//
+/*********************************************************************/
+
+#ifndef MYAPP_H
+#define MYAPP_H
+
+#include <UavStateMachine.h>
+
+namespace flair {
+    namespace core {
+        class AhrsData;
+    }
+    namespace gui {
+        class PushButton;
+    }
+    namespace sensor {
+        class TargetController;
+    }
+}
+
+class MyApp : public flair::meta::UavStateMachine {
+    public:
+        MyApp(flair::sensor::TargetController *controller);
+        ~MyApp();
+
+    private:
+        enum class BehaviourMode_t {
+            Default,
+            CustomReferenceAngles
+        };
+
+        BehaviourMode_t behaviourMode;
+
+        void StartCustomAngles(void);
+        void StopCustomAngles(void);
+        void ExtraCheckPushButton(void);
+        void ExtraCheckJoystick(void);
+        flair::core::AhrsData *GetReferenceOrientation(void);
+        void SignalEvent(Event_t event);
+
+        flair::gui::PushButton *start_CustomAngles,*stop_CustomAngles;
+        flair::core::AhrsData *customReferenceOrientation;
+};
+
+#endif // MYAPP_H
Index: tags/latest/demos/Skeletons/CustomReferenceAngles/src/main.cpp
===================================================================
--- tags/latest/demos/Skeletons/CustomReferenceAngles/src/main.cpp	(revision 209)
+++ tags/latest/demos/Skeletons/CustomReferenceAngles/src/main.cpp	(revision 209)
@@ -0,0 +1,96 @@
+//  created:    2015/10/27
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code uav
+//
+//
+/*********************************************************************/
+
+#include "MyApp.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <TargetEthController.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+    manager->SetupLogger(log_path);
+
+    Uav* drone=CreateUav(name,uav_type);
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    MyApp* app=new MyApp(controller);
+
+    app->Start();
+    app->Join();
+
+    delete manager;
+}
+
+void parseOptions(int argc, char** argv) {
+	try {
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, x4_simu, x8_simu or x4_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        uav_type=typeArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e) { // catch any exceptions
+        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+	}
+}
Index: tags/latest/demos/Skeletons/CustomTorques/CMakeLists.txt
===================================================================
--- tags/latest/demos/Skeletons/CustomTorques/CMakeLists.txt	(revision 209)
+++ tags/latest/demos/Skeletons/CustomTorques/CMakeLists.txt	(revision 209)
@@ -0,0 +1,34 @@
+PROJECT(CustomTorques)
+cmake_minimum_required(VERSION 2.8)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+SET(FLAIR_USE_FILTER TRUE)
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+SET(FLAIR_USE_VISION_FILTER TRUE)
+SET(FLAIR_USE_META TRUE)
+
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+include(${FLAIR_USE_FILE})
+
+SET(SRC_FILES
+	${CMAKE_SOURCE_DIR}/src/main.cpp
+	${CMAKE_SOURCE_DIR}/src/MyApp.cpp
+)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+)
+
+#real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_rt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
+
+#non real time executable
+ADD_EXECUTABLE(${PROJECT_NAME}_nrt
+	${SRC_FILES}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
Index: tags/latest/demos/Skeletons/CustomTorques/README
===================================================================
--- tags/latest/demos/Skeletons/CustomTorques/README	(revision 209)
+++ tags/latest/demos/Skeletons/CustomTorques/README	(revision 209)
@@ -0,0 +1,8 @@
+CustomTorques
+
+This is a minimal skeleton to use the UavStateMachine class.
+It shows how to set custom torques, to use our own control laws.
+
+The custom torque mode is activated by clicking on the "start CustomTorques" button on ground station, or with R1 button on the Dualshock 3.
+The custom torque mode is deactivated by clicking on the "stop CustomTorques" button on ground station, or with X button on the Dualshock 3.
+
Index: tags/latest/demos/Skeletons/CustomTorques/src/MyApp.cpp
===================================================================
--- tags/latest/demos/Skeletons/CustomTorques/src/MyApp.cpp	(revision 209)
+++ tags/latest/demos/Skeletons/CustomTorques/src/MyApp.cpp	(revision 209)
@@ -0,0 +1,95 @@
+//  created:    2015/10/29
+//  filename:   Uav.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    skeleton to use UavStateMachine with custom torques only
+//
+//
+/*********************************************************************/
+
+//include files, add yours
+#include "MyApp.h"
+#include <GridLayout.h>
+#include <PushButton.h>
+#include <MetaDualShock3.h>
+#include <FrameworkManager.h>
+
+//namespaces, add others if necessary (filter, sensor, actuator)
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+MyApp::MyApp(TargetController *controller): UavStateMachine(controller), behaviourMode(BehaviourMode_t::Default) {
+    start_CustomTorques=new PushButton(GetButtonsLayout()->NewRow(),"start CustomTorques");
+    stop_CustomTorques=new PushButton(GetButtonsLayout()->NewRow(),"stop CustomTorques");
+}
+
+MyApp::~MyApp() {
+}
+
+//this method is called by UavStateMachine::Run (main loop) when TorqueMode is Custom
+void MyApp::ComputeCustomTorques(Euler &torques) {
+    //compute the torques, with your own control laws
+
+    //torques.roll=;
+    //torques.pitch=;
+    //torques.yaw=;
+}
+
+void MyApp::SignalEvent(Event_t event) {
+    UavStateMachine::SignalEvent(event);
+    switch(event) {
+    case Event_t::TakingOff:
+        //always take off in default mode
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    case Event_t::EnteringFailSafeMode:
+        //return to default mode
+        Thread::Info("CustomTorques: stop\n");
+        behaviourMode=BehaviourMode_t::Default;
+        break;
+    }
+}
+
+void MyApp::ExtraCheckPushButton(void) {
+    if(start_CustomTorques->Clicked() && (behaviourMode!=BehaviourMode_t::CustomTorques)) {
+        StartCustomTorques();
+    }
+
+    if(stop_CustomTorques->Clicked() && (behaviourMode==BehaviourMode_t::CustomTorques)) {
+        StopCustomTorques();
+    }
+}
+
+void MyApp::ExtraCheckJoystick(void) {
+    //R1
+    if(GetJoystick()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomTorques)) {
+        StartCustomTorques();
+    }
+
+    //stop is not managed here, it is done in UavStateMachine with cross button
+    //pushing cross button will enter fail safe mode and signal the EnteringFailSafeMode event
+}
+
+void MyApp::StartCustomTorques(void) {
+    //ask UavStateMachine to enter in custom torques
+    if (SetTorqueMode(TorqueMode_t::Custom)) {
+        Thread::Info("CustomTorques: start\n");
+    } else {
+        Thread::Warn("CustomTorques: could not start\n");
+        return;
+    }
+
+    behaviourMode=BehaviourMode_t::CustomTorques;
+}
+
+void MyApp::StopCustomTorques(void) {
+    //just ask to enter fail safe mode
+    EnterFailSafeMode();
+}
Index: tags/latest/demos/Skeletons/CustomTorques/src/MyApp.h
===================================================================
--- tags/latest/demos/Skeletons/CustomTorques/src/MyApp.h	(revision 209)
+++ tags/latest/demos/Skeletons/CustomTorques/src/MyApp.h	(revision 209)
@@ -0,0 +1,51 @@
+//  created:    2015/10/29
+//  filename:   MyApp.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    skeleton to use UavStateMachine with custom torques only
+//
+//
+/*********************************************************************/
+
+#ifndef MYAPP_H
+#define MYAPP_H
+
+#include <UavStateMachine.h>
+
+namespace framework {
+    namespace gui {
+        class PushButton;
+    }
+    namespace sensor {
+        class TargetController;
+    }
+}
+
+class MyApp : public flair::meta::UavStateMachine {
+    public:
+        MyApp(flair::sensor::TargetController *controller);
+        ~MyApp();
+
+    private:
+        enum class BehaviourMode_t {
+            Default,
+            CustomTorques
+        };
+
+        BehaviourMode_t behaviourMode;
+
+        void ComputeCustomTorques(flair::core::Euler &torques);
+        void StartCustomTorques(void);
+        void StopCustomTorques(void);
+        void ExtraCheckPushButton(void);
+        void ExtraCheckJoystick(void);
+        void SignalEvent(Event_t event);
+
+        flair::gui::PushButton *start_CustomTorques,*stop_CustomTorques;
+};
+
+#endif // MYAPP_H
Index: tags/latest/demos/Skeletons/CustomTorques/src/main.cpp
===================================================================
--- tags/latest/demos/Skeletons/CustomTorques/src/main.cpp	(revision 209)
+++ tags/latest/demos/Skeletons/CustomTorques/src/main.cpp	(revision 209)
@@ -0,0 +1,97 @@
+//  created:    2015/10/27
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    exemple de code uav
+//
+//
+/*********************************************************************/
+
+#include "MyApp.h"
+#include <UavFactory.h>
+#include <FrameworkManager.h>
+#include <TargetEthController.h>
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::meta;
+using namespace flair::sensor;
+
+string uav_type;
+string log_path;
+int port;
+int ds3port;
+string xml_file;
+string name;
+string address;
+
+void parseOptions(int argc, char** argv);
+
+
+int main(int argc, char* argv[]) {
+    parseOptions(argc,argv);
+
+    FrameworkManager *manager;
+    manager= new FrameworkManager(name);
+    manager->SetupConnection(address,port);
+    manager->SetupUserInterface(xml_file);
+    manager->SetupLogger(log_path);
+
+    Uav* drone=CreateUav(name,uav_type);
+    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
+    MyApp* app=new MyApp(controller);
+
+    app->Start();
+    app->Join();
+
+    delete manager;
+}
+
+void parseOptions(int argc, char** argv) {
+	try {
+
+        CmdLine cmd("Command description message", ' ', "0.1");
+
+        ValueArg<string> nameArg("n","name","uav name, also used for vrpn",true,"x4","string");
+        cmd.add( nameArg );
+
+        ValueArg<string> typeArg("t","type","uav type: ardrone2, hds_x4, hds_x8, hds_xufo, x4_simu, x8_simu or x4_simux (with x the number of the simulated uav)",true,"hds_x4","string");
+        cmd.add( typeArg );
+
+        ValueArg<string> xmlArg("x","xml","fichier xml",true,"./reglages.xml","string");
+        cmd.add( xmlArg );
+
+        ValueArg<string> logsArg("l","logs","repertoire des logs",true,"/media/ram","string");
+        cmd.add( logsArg );
+
+        ValueArg<int> portArg("p","port","port pour station sol",true,9000,"int");
+        cmd.add( portArg );
+
+        ValueArg<string> addressArg("a","address","addresse station sol",true,"127.0.0.1","string");
+        cmd.add( addressArg );
+
+        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
+        cmd.add( ds3portArg );
+
+        cmd.parse( argc, argv );
+
+        // Get the value parsed by each arg.
+        log_path = logsArg.getValue();
+        port=portArg.getValue();
+        ds3port=ds3portArg.getValue();
+        xml_file = xmlArg.getValue();
+        name=nameArg.getValue();
+        uav_type=typeArg.getValue();
+        address=addressArg.getValue();
+
+	} catch (ArgException &e) { // catch any exceptions
+        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+	}
+}
Index: tags/latest/lib/Doxyfile.in
===================================================================
--- tags/latest/lib/Doxyfile.in	(revision 209)
+++ tags/latest/lib/Doxyfile.in	(revision 209)
@@ -0,0 +1,1893 @@
+# Doxyfile 1.8.4
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should 
+# identify the project. Note that if you do not use Doxywizard you need 
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = Flair
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description 
+# for a project that appears at the top of each page and should give viewer 
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = "Framework Libre Air"
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is 
+# included in the documentation. The maximum height of the logo should not 
+# exceed 55 pixels and the maximum width should not exceed 200 pixels. 
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = $(FLAIR_ROOT)/flair-src/lib/logo_hds.png
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = $(FLAIR_ROOT)/flair-dev/doc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
+# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, 
+# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, 
+# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = YES
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip. Note that you specify absolute paths here, but also 
+# relative paths, which will be relative from the directory where doxygen is 
+# started.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful if your file system 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only). 
+# A mapping has the form "name=value". For example adding 
+# "class=itcl::class" will allow you to use the command class in the 
+# itcl::class meaning.
+
+TCL_SUBST              = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it 
+# parses. With this tag you can assign which parser to use for a given 
+# extension. Doxygen has a built-in mapping, but you can override or extend it 
+# using this tag. The format is ext=language, where ext is a file extension, 
+# and language is one of the parsers supported by doxygen: IDL, Java, 
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, 
+# C++. For instance to make doxygen treat .inc files as Fortran files (default 
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note 
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the 
+# files are not read by doxygen.
+
+EXTENSION_MAPPING      = 
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all 
+# comments according to the Markdown format, which allows for more readable 
+# documentation. See http://daringfireball.net/projects/markdown/ for details. 
+# The output of markdown processing is further processed by doxygen, so you 
+# can mix doxygen, HTML, and XML commands with Markdown formatting. 
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented 
+# classes, or namespaces to their corresponding documentation. Such a link can 
+# be prevented in individual cases by by putting a % sign in front of the word 
+# or globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also makes the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate 
+# getter and setter methods for a property. Setting this option to YES (the 
+# default) will make doxygen replace the get and set methods by a property in 
+# the documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and 
+# unions are shown inside the group in which they are included (e.g. using 
+# @ingroup) instead of on a separate page (for HTML and Man pages) or 
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and 
+# unions with only public data fields or simple typedef fields will be shown 
+# inline in the documentation of the scope in which they are defined (i.e. file, 
+# namespace, or group documentation), provided this scope is documented. If set 
+# to NO (the default), structs, classes, and unions are shown on a separate 
+# page (for HTML and Man pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This 
+# cache is used to resolve symbols given their name and scope. Since this can 
+# be an expensive process and often the same symbol appear multiple times in 
+# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too 
+# small doxygen will become slower. If the cache is too large, memory is wasted. 
+# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid 
+# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 
+# symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal 
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = NO
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = YES
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
+# will list include files with double quotes in the documentation 
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 
+# will sort the (brief and detailed) documentation of class members so that 
+# constructors and destructors are listed first. If set to NO (the default) 
+# the constructors will appear in the respective orders defined by 
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to 
+# do proper type resolution of all parameters of a function it will reject a 
+# match between the prototype and the implementation of a member function even 
+# if there is only one candidate or it is obvious which candidate to choose 
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen 
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if section-label ... \endif 
+# and \cond section-label ... \endcond blocks.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or macro consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and macros in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 
+# by doxygen. The layout file controls the global structure of the generated 
+# output files in an output format independent way. To create the layout file 
+# that represents doxygen's defaults, run doxygen with the -l option. 
+# You can optionally specify a file name after the option, if omitted 
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            = 
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files 
+# containing the references data. This must be a list of .bib files. The 
+# .bib extension is automatically appended if omitted. Using this command 
+# requires the bibtex tool to be installed. See also 
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style 
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this 
+# feature you need bibtex and perl available in the search path. Do not use 
+# file names with spaces, bibtex cannot handle them.
+
+CITE_BIB_FILES         = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = $(FLAIR_ROOT)/flair-src/lib/FlairFilter/src \
+                           $(FLAIR_ROOT)/flair-src/lib/FlairSensorActuator/src \
+                        $(FLAIR_ROOT)/flair-src/lib/FlairCore/src \
+                        $(FLAIR_ROOT)/flair-src/lib/FlairSimulator/src \
+                        $(FLAIR_ROOT)/flair-src/lib/FlairMeta/src
+
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh 
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py 
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.h \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag. 
+# Note that relative paths are relative to the directory from which doxygen is 
+# run.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or 
+# directories that are symbolic links (a Unix file system feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be ignored. 
+# Note that the filter must not add or remove lines; it is applied before the 
+# code is scanned, but not when the output code is generated. If lines are added 
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty or if 
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) 
+# and it is also possible to disable source filtering for a specific pattern 
+# using *.ext= (so without naming a filter). This option only has effect when 
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS = 
+
+# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that 
+# is part of the input, its contents will be placed on the main page 
+# (index.html). This can be useful if you have a project on for instance GitHub 
+# and want reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = 
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
+# link to the source code.  Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = Flair
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header. Note that when using a custom header you are responsible  
+# for the proper inclusion of any scripts and style sheets that doxygen 
+# needs, which is dependent on the configuration options used. 
+# It is advised to generate a default header using "doxygen -w html 
+# header.html footer.html stylesheet.css YourConfigFile" and then modify 
+# that header. Note that the header is subject to change so you typically 
+# have to redo this when upgrading to a newer version of doxygen or when 
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If left blank doxygen will 
+# generate a default style sheet. Note that it is recommended to use 
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this 
+# tag will in the future become obsolete.
+
+HTML_STYLESHEET        = 
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional 
+# user-defined cascading style sheet that is included after the standard 
+# style sheets created by doxygen. Using this option one can overrule 
+# certain style aspects. This is preferred over using HTML_STYLESHEET 
+# since it does not replace the standard style sheet and is therefor more 
+# robust against future updates. Doxygen will copy the style sheet file to 
+# the output directory.
+
+HTML_EXTRA_STYLESHEET  = 
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 
+# other source files which should be copied to the HTML output directory. Note 
+# that these files will be copied to the base HTML output directory. Use the 
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that 
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 
+# Doxygen will adjust the colors in the style sheet and background images 
+# according to this color. Hue is specified as an angle on a colorwheel, 
+# see http://en.wikipedia.org/wiki/Hue for more information. 
+# For instance the value 0 represents red, 60 is yellow, 120 is green, 
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 
+# the colors in the HTML output. For a value of 0 the output will use 
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 
+# the luminance component of the colors in the HTML output. Values below 
+# 100 gradually make the output lighter, whereas values above 100 make 
+# the output darker. The value divided by 100 is the actual gamma applied, 
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
+# page will contain the date and time when the page was generated. Setting 
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of 
+# entries shown in the various tree structured indices initially; the user 
+# can expand and collapse entries dynamically later on. Doxygen will expand 
+# the tree to such a level that at most the specified number of entries are 
+# visible (unless a fully collapsed tree already exceeds this amount). 
+# So setting the number of entries 1 will produce a full collapsed tree by 
+# default. 0 is a special value representing an infinite number of entries 
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely 
+# identify the documentation publisher. This should be a reverse domain-name 
+# style string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
+# content.
+
+CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
+# that can be used as input for Qt's qhelpgenerator to generate a 
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
+# add. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
+# custom filter to add. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> 
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
+# project's 
+# filter section matches. 
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> 
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file.
+
+QHG_LOCATION           = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
+# will be generated, which together with the HTML files, form an Eclipse help 
+# plugin. To install this plugin and make it available under the help contents 
+# menu in Eclipse, the contents of the directory containing the HTML and XML 
+# files needs to be copied into the plugins directory of eclipse. The name of 
+# the directory within the plugins directory should be the same as 
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin 
+# the directory name containing the HTML and XML files should also have 
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) 
+# at top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it. Since the tabs have the same information as the 
+# navigation tree you can set this option to NO if you already set 
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
+# structure should be generated to display hierarchical information. 
+# If the tag value is set to YES, a side panel will be generated 
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
+# Windows users are probably better off using the HTML help feature. 
+# Since the tree basically has the same information as the tab index you 
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values 
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML 
+# documentation. Note that a value of 0 will completely suppress the enum 
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = YES
+
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images 
+# generated for formulas are transparent PNGs. Transparent PNGs are 
+# not supported properly for IE 6.0, but are supported on all modern browsers. 
+# Note that when changing this option you need to delete any form_*.png files 
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax 
+# (see http://www.mathjax.org) which uses client side Javascript for the 
+# rendering instead of using prerendered bitmaps. Use this if you do not 
+# have LaTeX installed or if you want to formulas look prettier in the HTML 
+# output. When enabled you may also need to install MathJax separately and 
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for 
+# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and 
+# SVG. The default value is HTML-CSS, which is slower, but has the best 
+# compatibility.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the 
+# HTML output directory using the MATHJAX_RELPATH option. The destination 
+# directory should contain the MathJax.js script. For instance, if the mathjax 
+# directory is located at the same level as the HTML output directory, then 
+# MATHJAX_RELPATH should be ../mathjax. The default value points to 
+# the MathJax Content Delivery Network so you can quickly see the result without 
+# installing MathJax.  However, it is strongly recommended to install a local 
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension 
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     = 
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript 
+# pieces of code that will be used on startup of the MathJax code.
+
+MATHJAX_CODEFILE       = 
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box 
+# for the HTML output. The underlying search engine uses javascript 
+# and DHTML and should work on any modern browser. Note that when using 
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 
+# (GENERATE_DOCSET) there is already a search function so this one should 
+# typically be disabled. For large projects the javascript based search engine 
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be 
+# implemented using a web server instead of a web client using Javascript. 
+# There are two flavours of web server based search depending on the 
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for 
+# searching and an index file used by the script. When EXTERNAL_SEARCH is 
+# enabled the indexing and searching needs to be provided by external tools. 
+# See the manual for details.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP 
+# script for searching. Instead the search results are written to an XML file 
+# which needs to be processed by an external indexer. Doxygen will invoke an 
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain 
+# the search results. Doxygen ships with an example indexer (doxyindexer) and 
+# search engine (doxysearch.cgi) which are based on the open source search 
+# engine library Xapian. See the manual for configuration details.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server 
+# which will returned the search results when EXTERNAL_SEARCH is enabled. 
+# Doxygen ships with an example search engine (doxysearch) which is based on 
+# the open source search engine library Xapian. See the manual for configuration 
+# details.
+
+SEARCHENGINE_URL       = 
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed 
+# search data is written to a file for indexing by an external tool. With the 
+# SEARCHDATA_FILE tag the name of this file can be specified.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the 
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is 
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple 
+# projects and redirect the results back to the right project.
+
+EXTERNAL_SEARCH_ID     = 
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen 
+# projects other than the one defined by this configuration file, but that are 
+# all added to the same external search index. Each project needs to have a 
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id 
+# of to a relative location where the documentation can be found. 
+# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+
+EXTRA_SEARCH_MAPPINGS  = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name. 
+# Note that when enabling USE_PDFLATEX this option is only used for 
+# generating bitmaps for formulas in the HTML output, but not in the 
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, letter, legal and 
+# executive. If left blank a4 will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for 
+# the generated latex document. The footer should contain everything after 
+# the last chapter. If it is left blank doxygen will generate a 
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           = 
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images 
+# or other source files which should be copied to the LaTeX output directory. 
+# Note that the files will be copied as-is; there are no commands or markers 
+# available.
+
+LATEX_EXTRA_FILES      = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include 
+# source code with syntax highlighting in the LaTeX output. 
+# Note that which sources are shown also depends on other settings 
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the 
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See 
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files 
+# that can be used to generate PDF.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in 
+# front of it. If left blank docbook will be used as the default path.
+
+DOCBOOK_OUTPUT         = docbook
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition that 
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all references to function-like macros 
+# that are alone on a line, have an all uppercase name, and do not end with a 
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each 
+# tag file the location of the external documentation should be added. The 
+# format of a tag file without this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths 
+# or URLs. Note that each tag file must have a unique name (where the name does 
+# NOT include the path). If a tag file is not located in the directory in which 
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = $(FLAIR_ROOT)/flair-dev/doc/qt.tag=http://qt-project.org/doc/qt-4.8
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = NO
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed 
+# in the related pages index. If set to NO, only the current project's 
+# pages will be listed.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option also works with HAVE_DOT disabled, but it is recommended to 
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
+# default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 
+# allowed to run in parallel. When set to 0 (the default) doxygen will 
+# base this on the number of processors available in the system. You can set it 
+# explicitly to a value larger than 0 to get control over the balance 
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that 
+# doxygen generates. When you want a differently looking font you can specify 
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find 
+# the font, which can be done by putting it in a standard location or by setting 
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the 
+# directory containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font. 
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to 
+# set the path where dot can find it.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside 
+# the class node. If there are many fields or methods and many nodes the 
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS 
+# threshold limits the number of items for each type to make the size more 
+# manageable. Set this to 0 for no limit. Note that the threshold may be 
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include 
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are svg, png, jpg, or gif. 
+# If left blank png will be used. If you choose svg you need to set 
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to 
+# enable generation of interactive SVG images that allow zooming and panning. 
+# Note that this requires a modern browser other than Internet Explorer. 
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you 
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that 
+# contain msc files that are included in the documentation (see the 
+# \mscfile command).
+
+MSCFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
Index: tags/latest/lib/FlairCore/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairCore/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairCore/CMakeLists.txt	(revision 209)
@@ -0,0 +1,43 @@
+PROJECT(FlairCore)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+FILE(GLOB FLAIRCORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_SYSROOT}/usr/include/opencv
+	${CMAKE_SYSROOT}/usr/include/udt
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+)
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/nrt)
+if(NOT WIN32)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rt)
+endif()
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(FlairCore_rt compile_info)
+add_dependencies(FlairCore_nrt compile_info)
Index: tags/latest/lib/FlairCore/nrt/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairCore/nrt/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairCore/nrt/CMakeLists.txt	(revision 209)
@@ -0,0 +1,12 @@
+PROJECT(FlairCore_nrt)
+
+ADD_DEFINITIONS(-D_GNU_SOURCE -D_REENTRANT)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${FLAIRCORE_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
Index: tags/latest/lib/FlairCore/rt/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairCore/rt/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairCore/rt/CMakeLists.txt	(revision 209)
@@ -0,0 +1,20 @@
+PROJECT(FlairCore_rt)
+
+find_package(Xenomai REQUIRED)
+ADD_DEFINITIONS(${XENOMAI_DEFINITIONS})
+
+INCLUDE_DIRECTORIES(
+	${XENOMAI_INCLUDE_DIR}
+)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${FLAIRCORE_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../src/*.h")
+INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/FlairCore)
Index: tags/latest/lib/FlairCore/src/AhrsData.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/AhrsData.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/AhrsData.cpp	(revision 209)
@@ -0,0 +1,253 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/03/01
+//  filename:   AhrsData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class defining ahrs datas
+//
+//
+/*********************************************************************/
+
+#include "AhrsData.h"
+#include "Euler.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+/*! \class AhrsDataElement
+    */
+class AhrsDataElement : public IODataElement {
+public:
+  AhrsDataElement(const AhrsData *inAhrsData, string name,
+                  AhrsData::PlotableData_t inPlotableData)
+      : IODataElement(inAhrsData, name), ahrsData(inAhrsData),
+        plotableData(inPlotableData) {
+
+    size = sizeof(float);
+  }
+
+  ~AhrsDataElement() {}
+
+  void CopyData(char *destination) const {
+    float data;
+    Vector3Df angularRates;
+    Euler eulerAngles;
+    Quaternion quaternion;
+    ahrsData->GetQuaternionAndAngularRates(quaternion, angularRates);
+    quaternion.ToEuler(eulerAngles);
+    switch (plotableData) {
+    case AhrsData::Roll:
+      data = eulerAngles.roll;
+      break;
+    case AhrsData::Pitch:
+      data = eulerAngles.pitch;
+      break;
+    case AhrsData::Yaw:
+      data = eulerAngles.yaw;
+      break;
+    case AhrsData::RollDeg:
+      data = Euler::ToDegree(eulerAngles.roll);
+      break;
+    case AhrsData::PitchDeg:
+      data = Euler::ToDegree(eulerAngles.pitch);
+      break;
+    case AhrsData::YawDeg:
+      data = Euler::ToDegree(eulerAngles.yaw);
+      break;
+    case AhrsData::Q0:
+      data = quaternion.q0;
+      break;
+    case AhrsData::Q1:
+      data = quaternion.q1;
+      break;
+    case AhrsData::Q2:
+      data = quaternion.q2;
+      break;
+    case AhrsData::Q3:
+      data = quaternion.q3;
+      break;
+    case AhrsData::Wx:
+      data = angularRates.x;
+      break;
+    case AhrsData::Wy:
+      data = angularRates.y;
+      break;
+    case AhrsData::Wz:
+      data = angularRates.z;
+      break;
+    case AhrsData::WxDeg:
+      data = Euler::ToDegree(angularRates.x);
+      break;
+    case AhrsData::WyDeg:
+      data = Euler::ToDegree(angularRates.y);
+      break;
+    case AhrsData::WzDeg:
+      data = Euler::ToDegree(angularRates.z);
+      break;
+    default:
+      ahrsData->Err("data type unavailable.\n");
+      data = 0;
+      break;
+    }
+    memcpy(destination, &data, sizeof(float));
+  }
+
+  const FloatType &GetDataType(void) const { return dataType; }
+
+private:
+  const AhrsData *ahrsData;
+  AhrsData::PlotableData_t plotableData;
+  FloatType dataType;
+};
+
+AhrsData::AhrsData(const Object *parent, std::string name, int n)
+    : io_data(parent, name, n), dataType(floatType) {
+  if (n > 1)
+    Warn("n>1 not supported\n");
+
+  AppendLogDescription("q0", floatType);
+  AppendLogDescription("q1", floatType);
+  AppendLogDescription("q2", floatType);
+  AppendLogDescription("q3", floatType);
+
+  AppendLogDescription("wx", floatType);
+  AppendLogDescription("wy", floatType);
+  AppendLogDescription("wz", floatType);
+}
+
+AhrsData::~AhrsData() {}
+
+Quaternion AhrsData::GetQuaternion(void) const {
+  Quaternion out;
+  GetMutex();
+  out = quaternion;
+  ReleaseMutex();
+  return out;
+}
+
+Vector3Df AhrsData::GetAngularRates(void) const {
+  Vector3Df out;
+  GetMutex();
+  out = angularRates;
+  ReleaseMutex();
+  return out;
+}
+
+void AhrsData::GetQuaternionAndAngularRates(Quaternion &outQuaternion,
+                                            Vector3Df &outAngularRates) const {
+  GetMutex();
+  outQuaternion = quaternion;
+  outAngularRates = angularRates;
+  ReleaseMutex();
+}
+
+void AhrsData::SetQuaternionAndAngularRates(const Quaternion &inQuaternion,
+                                            const Vector3Df &inAngularRates) {
+  GetMutex();
+  quaternion = inQuaternion;
+  angularRates = inAngularRates;
+  ReleaseMutex();
+}
+
+void AhrsData::SetQuaternion(const Quaternion &inQuaternion) {
+  GetMutex();
+  quaternion = inQuaternion;
+  ReleaseMutex();
+}
+
+void AhrsData::SetAngularRates(const Vector3Df &inAngularRates) {
+  GetMutex();
+  angularRates = inAngularRates;
+  ReleaseMutex();
+}
+
+IODataElement *AhrsData::Element(PlotableData_t plotableData) const {
+  string name;
+  switch (plotableData) {
+  case AhrsData::Roll:
+    name = "Roll";
+    break;
+  case AhrsData::Pitch:
+    name = "Pitch";
+    break;
+  case AhrsData::Yaw:
+    name = "Yaw";
+    break;
+  case AhrsData::RollDeg:
+    name = "Roll degree";
+    break;
+  case AhrsData::PitchDeg:
+    name = "Pitch degree";
+    break;
+  case AhrsData::YawDeg:
+    name = "Yaw degree";
+    break;
+  case AhrsData::Q0:
+    name = "Q0";
+    break;
+  case AhrsData::Q1:
+    name = "Q1";
+    break;
+  case AhrsData::Q2:
+    name = "Q2";
+    break;
+  case AhrsData::Q3:
+    name = "Q3";
+    break;
+  case AhrsData::Wx:
+    name = "Wx";
+    break;
+  case AhrsData::Wy:
+    name = "Wy";
+    break;
+  case AhrsData::Wz:
+    name = "Wz";
+    break;
+  case AhrsData::WxDeg:
+    name = "Wx degree";
+    break;
+  case AhrsData::WyDeg:
+    name = "Wy degree";
+    break;
+  case AhrsData::WzDeg:
+    name = "Wz degree";
+    break;
+  default:
+    Err("data type unavailable.\n");
+  }
+
+  return new AhrsDataElement(this, name, plotableData);
+}
+
+void AhrsData::CopyDatas(char *dst) const {
+  GetMutex();
+  Queue(&dst, &quaternion.q0, sizeof(quaternion.q0));
+  Queue(&dst, &quaternion.q1, sizeof(quaternion.q1));
+  Queue(&dst, &quaternion.q2, sizeof(quaternion.q2));
+  Queue(&dst, &quaternion.q3, sizeof(quaternion.q3));
+
+  Queue(&dst, &angularRates.x, sizeof(angularRates.x));
+  Queue(&dst, &angularRates.y, sizeof(angularRates.y));
+  Queue(&dst, &angularRates.z, sizeof(angularRates.z));
+  ReleaseMutex();
+}
+
+void AhrsData::Queue(char **dst, const void *src, size_t size) const {
+  memcpy(*dst, src, size);
+  *dst += size;
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/AhrsData.h
===================================================================
--- tags/latest/lib/FlairCore/src/AhrsData.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/AhrsData.h	(revision 209)
@@ -0,0 +1,192 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AhrsData.h
+ * \brief Class defining AHRS datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/03/01
+ * \version 4.0
+ */
+#ifndef AHRSDATA_H
+#define AHRSDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+#include <Quaternion.h>
+
+namespace flair {
+namespace core {
+
+/*! \class AhrsData
+*
+* \brief Class defining AHRS datas
+*
+* AHRS datas consist of quaternion and rotational angles values. \n
+*
+*/
+class AhrsData : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    Type(const ScalarType &inElementDataType)
+        : elementDataType(inElementDataType) {}
+    const ScalarType &GetElementDataType() const { return elementDataType; }
+    std::string GetDescription() const { return "ahrs data"; }
+    size_t GetSize() const { return 7 * elementDataType.GetSize(); }
+
+  private:
+    const ScalarType &elementDataType;
+  };
+
+  /*!
+  \enum PlotableData_t
+  \brief Datas wich can be plotted in a DataPlot1D
+  */
+  typedef enum {
+    Roll /*! roll */,
+    Pitch /*! pitch */,
+    Yaw /*! yaw */,
+    RollDeg /*! roll degree*/,
+    PitchDeg /*! pitch degree */,
+    YawDeg /*! yaw degree */,
+    Q0 /*! quaternion 0 */,
+    Q1 /*! quaternion 1 */,
+    Q2 /*! quaternion 2 */,
+    Q3 /*! quaternion 3 */,
+    Wx /*! x filtered angular rate */,
+    Wy /*! y filtered angular rate */,
+    Wz /*! z filtered angular rate */,
+    WxDeg /*! x filtered angular rate degree*/,
+    WyDeg /*! y filtered angular rate degree*/,
+    WzDeg /*! z filtered angular rate degree*/,
+  } PlotableData_t;
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing AHRS datas. \n
+  *
+  * \param parent parent
+  * \param name name
+  * \param n number of samples
+  */
+  AhrsData(const Object *parent, std::string name = "", int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~AhrsData();
+
+  /*!
+  * \brief Element
+  *
+  * Get a pointer to a specific element. This pointer can be used for plotting.
+  *
+  * \param plotableData data type
+  *
+  * \return pointer to the element
+  */
+  IODataElement *Element(PlotableData_t plotableData) const;
+
+  /*!
+  * \brief Set quaternion
+  *
+  * This method is mutex protected.
+  *
+  * \param quaternion quaternion
+  *
+  */
+  void SetQuaternion(const Quaternion &quaternion);
+
+  /*!
+  * \brief Get quaternion
+  *
+  * This method is mutex protected.
+  *
+  * \return quaternion
+  *
+  */
+  Quaternion GetQuaternion(void) const;
+
+  /*!
+  * \brief Set angular rates
+  *
+  * This method is mutex protected.
+  *
+  * \param angularRates angular rates
+  *
+  */
+  void SetAngularRates(const Vector3Df &angularRates);
+
+  /*!
+  * \brief Get angular rates
+  *
+  * This method is mutex protected.
+  *
+  * \return angular rates
+  *
+  */
+  Vector3Df GetAngularRates(void) const;
+
+  /*!
+  * \brief Get both quaternion and angular rates
+  *
+  * This method is mutex protected.
+  *
+  * \param quaternion quaternion
+  * \param angularRates angular rates
+  *
+  */
+  void GetQuaternionAndAngularRates(Quaternion &quaternion,
+                                    Vector3Df &angularRates) const;
+
+  /*!
+  * \brief Set both quaternion and angular rates
+  *
+  * This method is mutex protected.
+  *
+  * \param quaternion quaternion
+  * \param angularRates angular rates
+  *
+  */
+  void SetQuaternionAndAngularRates(const Quaternion &quaternion,
+                                    const Vector3Df &angularRates);
+
+  const Type &GetDataType() const { return dataType; }
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+
+  void Queue(char **dst, const void *src, size_t size) const;
+
+  /*!
+  * \brief %Quaternion
+  *
+  */
+  Quaternion quaternion;
+
+  /*!
+  * \brief Angular rates
+  *
+  */
+  Vector3Df angularRates;
+
+  Type dataType;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // AHRSDATA_H
Index: tags/latest/lib/FlairCore/src/Box.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Box.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Box.cpp	(revision 209)
@@ -0,0 +1,60 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/28
+//  filename:   Box.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display a box on the ground station
+//
+//
+/*********************************************************************/
+#include "Box.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+Box::Box(const LayoutPosition *position, string name, string type)
+    : Widget(position->getLayout(), name, type) {
+  value_changed = true;
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  delete position;
+}
+
+Box::~Box() { core::Object::ObjectName(); }
+
+bool Box::ValueChanged(void) {
+  bool ret;
+
+  GetMutex();
+  if (value_changed == true) {
+    value_changed = false;
+    ret = true;
+  } else {
+    ret = false;
+  }
+  ReleaseMutex();
+
+  return ret;
+}
+
+void Box::SetValueChanged(void) {value_changed = true; }
+
+void Box::GetMutex(void) const { ((Layout *)Parent())->mutex->GetMutex(); }
+
+void Box::ReleaseMutex(void) const {
+  ((Layout *)Parent())->mutex->ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Box.h
===================================================================
--- tags/latest/lib/FlairCore/src/Box.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Box.h	(revision 209)
@@ -0,0 +1,110 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Box.h
+ * \brief Abstract class to display a box on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/28
+ * \version 4.0
+ */
+
+#ifndef BOX_H
+#define BOX_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class Layout;
+class LayoutPosition;
+
+/*! \class Box
+*
+* \brief Abstract class to display a box on the ground station
+*
+* This is an abstract class to display boxes (like CheckBox, SpinBox, etc). \n
+* To access reimplemented box's value, use Box::GetMutex and Box::ReleaseMutex.
+*\n
+* Note that this mutex is in reality the one from the parent Layout. To minimize
+*memory
+* footprint, each Box does not have its own Mutex.
+*/
+class Box : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Box. \n
+  * Type must agree with predifined (hard coded) types
+  * in ground station code. \n
+  * The Box will automatically be child of position->getLayout() Layout. After
+  *calling this method,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position
+  * \param name name
+  * \param type type
+  */
+  Box(const LayoutPosition *position, std::string name, std::string type);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Box();
+
+  /*!
+  * \brief Has the value changed since last call?
+  *
+  * This method returns the value of an internal flag
+  * which is set through SetValueChanged(). \n
+  * After calling this method, the internal flag is
+  * set to false.
+  *
+  * \return true is valued has changed since last call
+  */
+  bool ValueChanged(void);
+
+protected:
+  /*!
+  * \brief Set the value changed flag
+  *
+  * The reimplemented class must call this method when Box's value is changed.
+  *\n
+  * This method must be called with Mutex locked. Indeed, as reimplemented class
+  * also has to lock the Mutex to change the Box value, this mecanism avoid two
+  *successives
+  * lock and unlock.
+  *
+  */
+  void SetValueChanged(void);
+
+  /*!
+  * \brief Get Mutex
+  *
+  * This method must be called before changing Box's value or
+  * calling SetValueChanged().
+  *
+  */
+  void GetMutex(void) const;
+
+  /*!
+  * \brief Release Mutex
+  *
+   * This method must be called after changing Box's value or
+  *  calling SetValueChanged().
+  *
+  */
+  void ReleaseMutex(void) const;
+
+private:
+  bool value_changed;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // BOX_H
Index: tags/latest/lib/FlairCore/src/CheckBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/CheckBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/CheckBox.cpp	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   CheckBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QCheckBox on the ground station
+//
+//
+/*********************************************************************/
+#include "CheckBox.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+CheckBox::CheckBox(const LayoutPosition *position, string name,
+                   bool default_value)
+    : Box(position, name, "CheckBox") {
+  // update value from xml file
+  box_value = default_value;
+
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", Value());
+  SendXml();
+}
+
+CheckBox::~CheckBox() {}
+
+bool CheckBox::IsChecked(void) const {
+  bool tmp;
+
+  GetMutex();
+  tmp = box_value;
+  ReleaseMutex();
+
+  return tmp;
+}
+
+int CheckBox::Value(void) const {
+  if (IsChecked() == true)
+    return 1;
+  else
+    return 0;
+}
+
+void CheckBox::XmlEvent(void) {
+  GetMutex();
+  if (GetPersistentXmlProp("value", box_value))
+    SetValueChanged();
+  ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/CheckBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/CheckBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/CheckBox.h	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file CheckBox.h
+ * \brief Class displaying a QCheckBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef CHECKBOX_H
+#define CHECKBOX_H
+
+#include <Box.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class CheckBox
+*
+* \brief Class displaying a QCheckBox on the ground station
+*
+*/
+class CheckBox : public Box {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QCheckBox at given position.
+  *
+  * \param position position to display the QCheckBox
+  * \param name name
+  * \param default_value default value if not in the xml config file
+  */
+  CheckBox(const LayoutPosition *position, std::string name,
+           bool default_value = true);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~CheckBox();
+
+  /*!
+  * \brief Is checked?
+  *
+  * \return true if checked
+  */
+  bool IsChecked(void) const;
+
+  /*!
+  * \brief Value
+  *
+  * \return 1 if checked, 0 otherwise
+  */
+  int Value(void) const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  bool box_value;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // CHECKBOX_H
Index: tags/latest/lib/FlairCore/src/ComboBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ComboBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ComboBox.cpp	(revision 209)
@@ -0,0 +1,59 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   ComboBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QComboBox on the ground station
+//
+//
+/*********************************************************************/
+#include "ComboBox.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+ComboBox::ComboBox(const LayoutPosition *position, string name)
+    : Box(position, name, "ComboBox") {
+  // update value from xml file
+  box_value = 0;
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", box_value);
+
+  SendXml();
+}
+
+ComboBox::~ComboBox() {}
+
+void ComboBox::AddItem(string name) {
+  SetVolatileXmlProp("item", name);
+  SendXml();
+}
+
+int ComboBox::CurrentIndex(void) const {
+  int tmp;
+
+  GetMutex();
+  tmp = box_value;
+  ReleaseMutex();
+
+  return tmp;
+}
+
+void ComboBox::XmlEvent(void) {
+  GetMutex();
+  if (GetPersistentXmlProp("value", box_value))
+    SetValueChanged();
+  ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/ComboBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/ComboBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/ComboBox.h	(revision 209)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ComboBox.h
+ * \brief Class displaying a QComboBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef COMBOBOX_H
+#define COMBOBOX_H
+
+#include <Box.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class ComboBox
+*
+* \brief Class displaying a QComboBox on the ground station
+*
+*/
+class ComboBox : public Box {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QComboBox at given position.
+  *
+  * \param position position to display the QComboBox
+  * \param name name
+  */
+  ComboBox(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ComboBox();
+
+  /*!
+ * \brief Add an item
+ *
+ * Add an item to the end of the list.
+ *
+ * \param name item nam
+ */
+  void AddItem(std::string name);
+
+  /*!
+  * \brief Currend index
+  *
+  * Index of the currently selected item. Items are numbered starting to 0.
+  *
+  * \return index number
+  */
+  int CurrentIndex(void) const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  int box_value;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // COMBOBOX_H
Index: tags/latest/lib/FlairCore/src/ConditionVariable.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ConditionVariable.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ConditionVariable.cpp	(revision 209)
@@ -0,0 +1,42 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   ConditionVariable.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a condition variable
+//
+//
+/*********************************************************************/
+
+#include "ConditionVariable.h"
+#include "ConditionVariable_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+ConditionVariable::ConditionVariable(const Object *parent, string name)
+    : Mutex(parent, name) {
+  pimpl_ = new ConditionVariable_impl(this);
+}
+
+ConditionVariable::~ConditionVariable() { delete pimpl_; }
+
+void ConditionVariable::CondWait(void) { pimpl_->CondWait(); }
+
+bool ConditionVariable::CondWaitUntil(Time date) {
+  return pimpl_->CondWaitUntil(date);
+}
+
+void ConditionVariable::CondSignal(void) { pimpl_->CondSignal(); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/ConditionVariable.h
===================================================================
--- tags/latest/lib/FlairCore/src/ConditionVariable.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/ConditionVariable.h	(revision 209)
@@ -0,0 +1,95 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConditionVariable.h
+ * \brief Class defining a condition variable
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef CONDITIONVARIABLE_H
+#define CONDITIONVARIABLE_H
+
+#include <Mutex.h>
+
+class ConditionVariable_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class ConditionVariable
+*
+* \brief Class defining a condition variable
+*
+*/
+
+class ConditionVariable : public Mutex {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a condition variable with its associated mutex.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  ConditionVariable(const Object *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ConditionVariable();
+
+  /*!
+  * \brief Block on the condition variable
+  *
+  * This method must be called with mutex locked (see Mutex::GetMutex) by the
+  *calling thread or undefined behaviour will result. \n
+  * It atomically releases mutex and causes the calling thread to block on the
+  *condition variable. \n
+  * Only one thread can be blocked at the same time. \n
+  * Upon successful return, the mutex has been locked and is owned by the
+  *calling thread which should unlock it (see Mutex::ReleaseMutex).
+  */
+  void CondWait(void);
+
+  /*!
+  * \brief Block on the condition variable with a timeout
+  *
+  * This method must be called with mutex locked (see Mutex::GetMutex) by the
+  *calling thread or undefined behaviour will result. \n
+  * It atomically releases mutex and causes the calling thread to block on the
+  *condition variable. \n
+  * Only one thread can be blocked at the same time. \n
+  * Upon successful return, the mutex has been locked and is owned by the
+  *calling thread which should unlock it (see Mutex::ReleaseMutex).
+  *
+  * \param date absolute date
+  * \return true if the condition variable is signaled before the date specified
+  *in parameter elapses, false otherwise
+  */
+  bool CondWaitUntil(Time date);
+
+  /*!
+  * \brief Unblock threads blocked on the condition variable
+  *
+  * This method should be called with mutex locked (see Mutex::GetMutex) by the
+  *calling thread. \n
+  * In this case, upon return, the calling thread should unlock the mutex (see
+  *Mutex::ReleaseMutex).
+  *
+  */
+  void CondSignal(void);
+
+private:
+  class ConditionVariable_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CONDITIONVARIABLE_H
Index: tags/latest/lib/FlairCore/src/ConditionVariable_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ConditionVariable_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ConditionVariable_impl.cpp	(revision 209)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   ConditionVariable_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a condition variable
+//
+//
+/*********************************************************************/
+
+#include "ConditionVariable_impl.h"
+#include "ConditionVariable.h"
+#include "Mutex_impl.h"
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+ConditionVariable_impl::ConditionVariable_impl(ConditionVariable *self) {
+  this->self = self;
+  int status;
+
+#ifdef __XENO__
+  status = rt_cond_create(&m_ResumeCond, NULL);
+#else
+  status = pthread_cond_init(&m_ResumeCond, 0);
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("error creating condition variable (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+}
+
+ConditionVariable_impl::~ConditionVariable_impl() {
+  int status;
+
+#ifdef __XENO__
+  status = rt_cond_delete(&m_ResumeCond);
+#else
+  status = pthread_cond_destroy(&m_ResumeCond);
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("error destroying condition variable (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+}
+
+void ConditionVariable_impl::CondWait(void) {
+  int status;
+#ifdef __XENO__
+  status =
+      rt_cond_wait(&m_ResumeCond, &self->Mutex::pimpl_->mutex, TM_INFINITE);
+#else
+  status = pthread_cond_wait(&m_ResumeCond, &self->Mutex::pimpl_->mutex);
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+}
+
+bool ConditionVariable_impl::CondWaitUntil(Time date) {
+  int status;
+#ifdef __XENO__
+  status = rt_cond_wait_until(&m_ResumeCond, &self->Mutex::pimpl_->mutex, date);
+#else
+  struct timespec restrict;
+  restrict.tv_sec = date / 1000000000;
+  restrict.tv_nsec = date % 1000000000;
+  status = pthread_cond_timedwait(&m_ResumeCond, &self->Mutex::pimpl_->mutex,
+                                  &restrict);
+#endif
+  if (status == 0)
+    return true;
+  if (status != ETIMEDOUT) {
+		char errorMsg[256];
+    self->Err("error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+  return false;
+}
+
+void ConditionVariable_impl::CondSignal(void) {
+  int status;
+#ifdef __XENO__
+  status = rt_cond_signal(&m_ResumeCond);
+#else
+  status = pthread_cond_signal(&m_ResumeCond);
+#endif
+	if (status != 0) {
+		char errorMsg[256];
+    self->Err("error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+}
Index: tags/latest/lib/FlairCore/src/ConnectedSocket.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ConnectedSocket.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ConnectedSocket.cpp	(revision 209)
@@ -0,0 +1,122 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/21
+//  filename:   ConnectedSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a connected socket
+//
+//
+/*********************************************************************/
+#include "ConnectedSocket.h"
+#include <string.h>
+#include <stdexcept>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+ConnectedSocket::ConnectedSocket(const Object *parent, const std::string name)
+    : Object(parent, name){};
+
+ConnectedSocket::~ConnectedSocket(){};
+
+uint16_t ConnectedSocket::ReadUInt16(Time const &timeout) {
+  char buffer[sizeof(uint16_t)];
+  size_t alreadyReceived = 0;
+  Time remainingTimeout = timeout; // ms
+  do {
+    Time beforeTime = GetTime(); // ns
+    ssize_t received =
+        RecvMessage(buffer + alreadyReceived,
+                    sizeof(uint16_t) - alreadyReceived, remainingTimeout);
+    remainingTimeout -= (GetTime() - beforeTime) / 100000;
+    if ((received < 0) || (remainingTimeout < 0))
+      throw std::runtime_error("Timeout");
+    alreadyReceived += received;
+  } while (alreadyReceived != sizeof(uint16_t));
+  uint16_t *dataInNetworkEndianness = (uint16_t *)buffer;
+  uint16_t myinteger = NetworkToHost16(*dataInNetworkEndianness);
+  return myinteger;
+}
+
+void ConnectedSocket::WriteUInt16(uint16_t const &data, Time const &timeout) {
+  uint16_t dataInNetworkEndianness = HostToNetwork16(data);
+  char *buffer = (char *)&dataInNetworkEndianness;
+  size_t alreadySent = 0;
+  Time remainingTimeout = timeout; // ms
+  do {
+    Time beforeTime = GetTime(); // ns
+    ssize_t sent = SendMessage(
+        buffer + alreadySent, sizeof(uint16_t) - alreadySent, remainingTimeout);
+    remainingTimeout -= (GetTime() - beforeTime) / 100000;
+    if ((sent < 0) || (remainingTimeout < 0))
+      throw std::runtime_error("Timeout");
+    alreadySent += sent;
+  } while (alreadySent != sizeof(uint16_t));
+}
+
+uint32_t ConnectedSocket::ReadUInt32(Time const &timeout) {
+  char buffer[sizeof(uint32_t)];
+  size_t alreadyReceived = 0;
+  Time remainingTimeout = timeout; // ms
+  do {
+    Time beforeTime = GetTime(); // ns
+    ssize_t received =
+        RecvMessage(buffer + alreadyReceived,
+                    sizeof(uint32_t) - alreadyReceived, remainingTimeout);
+    remainingTimeout -= (GetTime() - beforeTime) / 100000;
+    if ((received < 0) || (remainingTimeout < 0))
+      throw std::runtime_error("Timeout");
+    alreadyReceived += received;
+  } while (alreadyReceived != sizeof(uint32_t));
+  uint32_t *dataInNetworkEndianness = (uint32_t *)buffer;
+  uint32_t myinteger = NetworkToHost32(*dataInNetworkEndianness);
+  return myinteger;
+}
+
+void ConnectedSocket::WriteUInt32(uint32_t const &data, Time const &timeout) {
+  uint32_t dataInNetworkEndianness = HostToNetwork32(data);
+  char *buffer = (char *)&dataInNetworkEndianness;
+  size_t alreadySent = 0;
+  Time remainingTimeout = timeout; // ms
+  do {
+    Time beforeTime = GetTime(); // ns
+    ssize_t sent = SendMessage(
+        buffer + alreadySent, sizeof(uint32_t) - alreadySent, remainingTimeout);
+    remainingTimeout -= (GetTime() - beforeTime) / 100000;
+    if ((sent < 0) || (remainingTimeout < 0))
+      throw std::runtime_error("Timeout");
+    alreadySent += sent;
+  } while (alreadySent != sizeof(uint32_t));
+}
+
+string ConnectedSocket::ReadString(const size_t &stringSize, Time timeout) {
+  char buffer[stringSize + 1];
+  size_t alreadyReceived = 0;
+  Time remainingTimeout = timeout; // ms
+  do {
+    Time beforeTime = GetTime(); // ns
+    ssize_t received =
+        RecvMessage(buffer + alreadyReceived, stringSize - alreadyReceived,
+                    remainingTimeout);
+    remainingTimeout -= (GetTime() - beforeTime) / 100000;
+    if ((received < 0) || (remainingTimeout < 0))
+      throw std::runtime_error("Timeout");
+    alreadyReceived += received;
+  } while (alreadyReceived != stringSize);
+  buffer[stringSize] = '\0';
+
+  string mystring = buffer;
+  return mystring;
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/ConnectedSocket.h
===================================================================
--- tags/latest/lib/FlairCore/src/ConnectedSocket.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/ConnectedSocket.h	(revision 209)
@@ -0,0 +1,112 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConnectedSocket.h
+ * \brief Class defining a socket working in connected mode
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/21
+ * \version 4.0
+ */
+
+#ifndef CONNECTEDSOCKET_H
+#define CONNECTEDSOCKET_H
+
+#include <Object.h>
+
+namespace flair {
+namespace core {
+
+/*! \class ConnectedSocket
+*
+* \brief Interface class encapsulating a connected socket. Preserves packets
+*order and guaranty delivery.
+*
+*/
+class ConnectedSocket : public Object {
+public:
+  /*!
+  * \brief Constructor
+  *
+  */
+  ConnectedSocket(const Object *parent, const std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ConnectedSocket();
+
+  /*!
+  * \brief Returns a socket which listens on a specific port/address
+  *
+  * \param const Object* parentObject
+  * \param const string name
+  * \param unsigned int port
+  * \param const localAddress (defaults to any)
+  */
+  virtual void Listen(const unsigned int port,
+                      const std::string localAddress = "ANY") = 0;
+
+  /*!
+  * \brief Returns a socket on a new incoming connexion
+  *
+  * \param ConnectedSocket &listeningSocket
+  */
+  virtual ConnectedSocket *Accept(
+      Time timeout) = 0; // should throw an exception if not a listening socket
+
+  /*!
+  * \brief Returns a socket connected to a distant host
+  *
+  * \param const Object* parentObject
+  * \param const string name
+  * \param unsigned int port
+  * \param const distantAddress
+  * \param timeout timeout (in milliseconds)
+  */
+  virtual bool Connect(const unsigned int port,
+                       const std::string distantAddress, Time timeout) = 0;
+
+  /*!
+  * \brief Send a message
+  *
+  * \param message message
+  * \param message_len message length
+  * \param timeout timeout (in milliseconds)
+  */
+  virtual ssize_t SendMessage(const char *message, size_t message_len,
+                              Time timeout) = 0;
+
+  /*!
+  * \brief Receive a message
+  *
+  * Receive a message and wait up to timeout. \n
+  *
+  * \param buf buffer to put the message
+  * \param buf_len buffer length
+  * \param timeout timeout (in milliseconds)
+  *
+  * \return size of the received message
+  */
+  virtual ssize_t RecvMessage(char *buf, size_t buf_len, Time timeout) = 0;
+
+  std::string ReadString(const size_t &stringLength, Time timeout);
+  uint16_t ReadUInt16(Time const &timeout);
+  void WriteUInt16(uint16_t const &data, Time const &timeout);
+  uint32_t ReadUInt32(Time const &timeout);
+  void WriteUInt32(uint32_t const &data, Time const &timeout);
+
+  //!! See Socket.h for a more generic implementation of network/host endianness
+  // conversion
+  virtual uint16_t NetworkToHost16(uint16_t data) = 0;
+  virtual uint16_t HostToNetwork16(uint16_t data) = 0;
+  virtual uint32_t NetworkToHost32(uint32_t data) = 0;
+  virtual uint32_t HostToNetwork32(uint32_t data) = 0;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CONNECTEDSOCKET_H
Index: tags/latest/lib/FlairCore/src/DataPlot.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot.cpp	(revision 209)
@@ -0,0 +1,88 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/10
+//  filename:   DataPlot.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display plots on ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot.h"
+#include "DataPlot_impl.h"
+#include "LayoutPosition.h"
+#include "IODataElement.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+using namespace core;
+
+void RGBFromColor(DataPlot::Color_t color, uint8_t &r, uint8_t &g, uint8_t &b) {
+  switch (color) {
+  case DataPlot::Red:
+    r = 255;
+    g = 0;
+    b = 0;
+    break;
+  case DataPlot::Blue:
+    r = 0;
+    g = 0;
+    b = 255;
+    break;
+  case DataPlot::Green:
+    r = 0;
+    g = 255;
+    b = 0;
+    break;
+  case DataPlot::Yellow:
+    r = 255;
+    g = 255;
+    b = 0;
+    break;
+  case DataPlot::Black:
+    r = 0;
+    g = 0;
+    b = 0;
+    break;
+  case DataPlot::White:
+    r = 255;
+    g = 255;
+    b = 255;
+    break;
+  }
+}
+
+DataPlot::DataPlot(const LayoutPosition *position, string name, string type)
+    : SendData(position, name, type) {
+  pimpl_ = new DataPlot_impl();
+}
+
+DataPlot::~DataPlot() { delete pimpl_; }
+
+void DataPlot::AddDataToSend(const IODataElement *element) {
+  pimpl_->tosend.push_back(element);
+
+  SetSendSize(SendSize() + element->Size());
+}
+
+void DataPlot::CopyDatas(char *buf) const {
+  int buf_size = 0;
+
+  for (size_t i = 0; i < pimpl_->tosend.size(); i++) {
+    pimpl_->tosend[i]->CopyData(buf + buf_size);
+    buf_size += pimpl_->tosend[i]->Size();
+  }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/DataPlot.h
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot.h	(revision 209)
@@ -0,0 +1,113 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot.h
+ * \brief Abstract class to display plots on ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/10
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT_H
+#define DATAPLOT_H
+
+#include <SendData.h>
+
+class DataPlot_impl;
+
+namespace flair {
+namespace core {
+class IODataElement;
+}
+}
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class DataPlot
+*
+* \brief Abstract class to display plots on ground station
+*
+*/
+class DataPlot : public SendData {
+public:
+  /*!
+  \enum Color_t
+  \brief Types of colors
+  */
+  typedef enum {
+    Red /*! red  */,
+    Blue /*! blue  */,
+    Green /*! green  */,
+    Yellow /*! yellow  */,
+    Black /*! black  */,
+    White /*! white  */,
+  } Color_t;
+
+  /*!
+  * \brief Constructor
+  *
+  * Type must agree with predifined (hard coded) types
+  * in ground station code. After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  * The DataPlot will automatically be child of position->getLayout() Layout.
+  *
+  * \param position position
+  * \param name nom
+  * \param type type
+  */
+  DataPlot(const LayoutPosition *position, std::string name, std::string type);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~DataPlot();
+
+protected:
+  /*!
+  * \brief Add an IODataElement to the plot.
+  *
+  * This method registers element for sending.
+  *
+  * \param element element to plot
+  */
+  void AddDataToSend(const core::IODataElement *element);
+
+private:
+  /*!
+  * \brief Copy datas to specified buffer
+  *
+  * Reimplemented from SendData.
+  *
+  * \param buf output buffer
+  */
+  void CopyDatas(char *buf) const;
+
+  /*!
+  * \brief Extra Xml event
+  *
+  * Reimplemented from SendData.
+  */
+  void ExtraXmlEvent(void){};
+
+  class DataPlot_impl *pimpl_;
+};
+
+/*!
+* \brief Get RGB components from color type
+*
+*
+* \param color input color
+* \param r output component
+* \param g output component
+* \param b output component
+*/
+void RGBFromColor(DataPlot::Color_t color, uint8_t &r, uint8_t &g, uint8_t &b);
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT_H
Index: tags/latest/lib/FlairCore/src/DataPlot1D.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot1D.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot1D.cpp	(revision 209)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   DataPlot1D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 1D plot on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot1D.h"
+#include "LayoutPosition.h"
+#include "IODataElement.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+using namespace core;
+
+DataPlot1D::DataPlot1D(const LayoutPosition *position, string name, float ymin,
+                       float ymax)
+    : DataPlot(position, name, "DataPlot1D") {
+  SetVolatileXmlProp("min", ymin);
+  SetVolatileXmlProp("max", ymax);
+  SendXml();
+}
+
+DataPlot1D::~DataPlot1D() {}
+
+void DataPlot1D::AddCurve(const core::IODataElement *element, uint8_t r,
+                          uint8_t g, uint8_t b, string curve_name) {
+  if (curve_name != "") {
+    SetVolatileXmlProp("curve", curve_name);
+  } else {
+    SetVolatileXmlProp("curve", element->Parent()->ObjectName() + "\\" +
+                                    element->ObjectName());
+  }
+  SetVolatileXmlProp("type", element->GetDataType().GetDescription());
+  SetVolatileXmlProp("r", r);
+  SetVolatileXmlProp("g", g);
+  SetVolatileXmlProp("b", b);
+
+  SendXml();
+
+  // save data information
+  AddDataToSend(element);
+}
+
+void DataPlot1D::AddCurve(const core::IODataElement *element, Color_t color,
+                          string curve_name) {
+  uint8_t r, g, b;
+  RGBFromColor(color, r, g, b);
+  AddCurve(element, r, g, b, curve_name);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/DataPlot1D.h
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot1D.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot1D.h	(revision 209)
@@ -0,0 +1,86 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot1D.h
+ * \brief Class displaying a 1D plot on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT1D_H
+#define DATAPLOT1D_H
+
+#include <DataPlot.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class IODataElement;
+}
+
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class DataPlot1D
+*
+* \brief Class displaying a 1D plot on the ground station
+*
+*/
+class DataPlot1D : private DataPlot {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a 1D plot at given position.
+  *
+  * \param position position to display the plot
+  * \param name name
+  * \param ymin default ymin of the plot
+  * \param ymax default ymax of the plot
+  */
+  DataPlot1D(const LayoutPosition *position, std::string name, float ymin,
+             float ymax);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~DataPlot1D();
+
+  /*!
+  * \brief Add a curve from an IODataElement to the plot.
+  *
+  * Curve's color can be selected by its name.
+  *
+  * \param element element to plot
+  * \param color color of the curve
+  * \param curve_name name of the curve for the legend, if unspecified,
+  *element->ObjectName() will be used
+  */
+  void AddCurve(const core::IODataElement *element, Color_t color,
+                std::string curve_name = "");
+
+  /*!
+  * \brief Add a curve from an IODataElement to the plot.
+  *
+  * Curve's color can be selected by its RGB components.
+  *
+  * \param element element to plot
+  * \param r red component of the curve
+  * \param g green component of the curve
+  * \param b blue component of the curve
+  * \param curve_name name of the curve for the legend, if unspecified,
+  *element->ObjectName() will be used
+  */
+  void AddCurve(const core::IODataElement *element, uint8_t r = 255,
+                uint8_t g = 0, uint8_t b = 0, std::string curve_name = "");
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT1D_H
Index: tags/latest/lib/FlairCore/src/DataPlot2D.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot2D.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot2D.cpp	(revision 209)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   DataPlot2D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 2D plot on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot2D.h"
+#include "LayoutPosition.h"
+#include "IODataElement.h"
+#include <typeinfo>
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+DataPlot2D::DataPlot2D(const LayoutPosition *position, string name,
+                       string x_name, float xmin, float xmax, string y_name,
+                       float ymin, float ymax)
+    : DataPlot(position, name, "DataPlot2D") {
+  SetVolatileXmlProp("xmin", xmin);
+  SetVolatileXmlProp("xmax", xmax);
+  SetVolatileXmlProp("ymin", ymin);
+  SetVolatileXmlProp("ymax", ymax);
+  SetVolatileXmlProp("x_name", x_name);
+  SetVolatileXmlProp("y_name", y_name);
+  SendXml();
+}
+
+DataPlot2D::~DataPlot2D() {}
+
+void DataPlot2D::AddCurve(const core::IODataElement *x_element,
+                          const core::IODataElement *y_element, Color_t color,
+                          string curve_name) {
+  uint8_t r, g, b;
+  RGBFromColor(color, r, g, b);
+  AddCurve(x_element, y_element, r, g, b, curve_name);
+}
+
+void DataPlot2D::AddCurve(const core::IODataElement *x_element,
+                          const core::IODataElement *y_element, uint8_t r,
+                          uint8_t g, uint8_t b, string curve_name) {
+  if (typeid(x_element->GetDataType()) != typeid(y_element->GetDataType())) {
+    Err("x_element type is different from y_element type (%i-%i)\n",
+        x_element->GetDataType().GetDescription().c_str(),
+        y_element->GetDataType().GetDescription().c_str());
+    // gerer erreur
+    return;
+  }
+
+  if (curve_name != "") {
+    SetVolatileXmlProp("curve", curve_name);
+  } else {
+    SetVolatileXmlProp("curve", x_element->Parent()->ObjectName() + "\\" +
+                                    x_element->ObjectName() + "\\" +
+                                    y_element->ObjectName());
+  }
+  SetVolatileXmlProp("type", x_element->GetDataType().GetDescription());
+  SetVolatileXmlProp("r", r);
+  SetVolatileXmlProp("g", g);
+  SetVolatileXmlProp("b", b);
+
+  SendXml();
+
+  // save data information
+  AddDataToSend(x_element);
+  AddDataToSend(y_element);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/DataPlot2D.h
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot2D.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot2D.h	(revision 209)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot2D.h
+ * \brief Class displaying a 2D plot on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT2D_H
+#define DATAPLOT2D_H
+
+#include <DataPlot.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class IODataElement;
+}
+}
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class DataPlot2D
+*
+* \brief Class displaying a 2D plot on the ground station
+*
+*/
+class DataPlot2D : private DataPlot {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a 2D plot at given place position.
+  *
+  * \param position position to display the plot
+  * \param name name
+  * \param x_name name of x axis
+  * \param xmin default xmin of the plot
+  * \param xmax default xmax of the plot
+  * \param y_name name of y axis
+  * \param ymin default ymin of the plot
+  * \param ymax default ymax of the plot
+  */
+  DataPlot2D(const LayoutPosition *position, std::string name,
+             std::string x_name, float xmin, float xmax, std::string y_name,
+             float ymin, float ymax);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~DataPlot2D();
+
+  /*!
+  * \brief Add a curve from elements to the plot.
+  *
+  * Curve's color can be selected by its name.
+  *
+  * \param x_element element to plot for x coordinate
+  * \param y_element element to plot for y coordinate
+  * \param color color of the curve
+  * \param curve_name name of the curve ofr the legend
+  */
+  void AddCurve(const core::IODataElement *x_element,
+                const core::IODataElement *y_element, Color_t color,
+                std::string curve_name = "");
+
+  /*!
+  * \brief Add a curve from elements to the plot.
+  *
+  * Curve's color can be selected by its RGB components.
+  *
+  * \param x_element element to plot for x coordinate
+  * \param y_element element to plot for y coordinate
+  * \param r red component of the curve
+  * \param g green component of the curve
+  * \param b blue component of the curve
+  * \param curve_name name of the curve ofr the legend
+  */
+  void AddCurve(const core::IODataElement *x_element,
+                const core::IODataElement *y_element, uint8_t r = 255,
+                uint8_t g = 0, uint8_t b = 0, std::string curve_name = "");
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT2D_H
Index: tags/latest/lib/FlairCore/src/DataPlot_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/DataPlot_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/DataPlot_impl.cpp	(revision 209)
@@ -0,0 +1,22 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/10
+//  filename:   DataPlot_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base pour les DataPlot_impl
+//
+//
+/*********************************************************************/
+
+#include "DataPlot_impl.h"
+
+DataPlot_impl::DataPlot_impl() {}
+
+DataPlot_impl::~DataPlot_impl() {}
Index: tags/latest/lib/FlairCore/src/DoubleSpinBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/DoubleSpinBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/DoubleSpinBox.cpp	(revision 209)
@@ -0,0 +1,88 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   DoubleSpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QDoubleSpinBox on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DoubleSpinBox.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+DoubleSpinBox::DoubleSpinBox(const LayoutPosition *position, string name,
+                             double min, double max, double step, int decimals,
+                             double default_value)
+    : Box(position, name, "DoubleSpinBox") {
+  // update value from xml file
+  if (default_value < min)
+    default_value = min;
+  if (default_value > max)
+    default_value = max;
+  box_value = default_value;
+
+  SetVolatileXmlProp("min", min);
+  SetVolatileXmlProp("max", max);
+  SetVolatileXmlProp("step", step);
+  SetVolatileXmlProp("decimals", decimals);
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", box_value);
+
+  SendXml();
+}
+
+DoubleSpinBox::DoubleSpinBox(const LayoutPosition *position, string name,
+                             string suffix, double min, double max, double step,
+                             int decimals, double default_value)
+    : Box(position, name, "DoubleSpinBox") {
+  // update value from xml file
+  if (default_value < min)
+    default_value = min;
+  if (default_value > max)
+    default_value = max;
+  box_value = default_value;
+
+  SetVolatileXmlProp("suffix", suffix);
+  SetVolatileXmlProp("min", min);
+  SetVolatileXmlProp("max", max);
+  SetVolatileXmlProp("step", step);
+  SetVolatileXmlProp("decimals", decimals);
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", box_value);
+
+  SendXml();
+}
+
+DoubleSpinBox::~DoubleSpinBox() {}
+
+double DoubleSpinBox::Value(void) const {
+  double tmp;
+
+  GetMutex();
+  tmp = box_value;
+  ReleaseMutex();
+
+  return tmp;
+}
+
+void DoubleSpinBox::XmlEvent(void) {
+  GetMutex();
+  if (GetPersistentXmlProp("value", box_value))
+    SetValueChanged();
+  ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/DoubleSpinBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/DoubleSpinBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/DoubleSpinBox.h	(revision 209)
@@ -0,0 +1,95 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DoubleSpinBox.h
+ * \brief Class displaying a QDoubleSpinBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DOUBLESPINBOX_H
+#define DOUBLESPINBOX_H
+
+#include <Box.h>
+
+namespace flair {
+namespace gui {
+
+class Layout;
+
+/*! \class DoubleSpinBox
+*
+* \brief Class displaying a QDoubleSpinBox on the ground station
+*
+*/
+class DoubleSpinBox : public Box {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QDoubleSpinBox at given position. \n
+  * The QDoubleSpinBox is saturated to min and max values.
+  *
+  * \param position position to display the QDoubleSpinBox
+  * \param name name
+  * \param min minimum value
+  * \param max maximum value
+  * \param step step
+  * \param decimals number of decimals
+  * \param default_value default value if not in the xml config file
+  */
+  DoubleSpinBox(const LayoutPosition *position, std::string name, double min,
+                double max, double step, int decimals = 2,
+                double default_value = 0);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QDoubleSpinBox at given position. \n
+  * The QDoubleSpinBox is saturated to min and max values.
+  *
+  * \param position position to display the QDoubleSpinBox
+  * \param name name
+  * \param suffix suffix for the value (eg unit)
+  * \param min minimum value
+  * \param max maximum value
+  * \param step step
+  * \param decimals number of decimals
+  * \param default_value default value if not in the xml config file
+  */
+  DoubleSpinBox(const LayoutPosition *position, std::string name,
+                std::string suffix, double min, double max, double step,
+                int decimals = 2, double default_value = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~DoubleSpinBox();
+
+  /*!
+  * \brief Value
+  *
+  * \return value
+  */
+  double Value(void) const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  double box_value;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DOUBLESPINBOX_H
Index: tags/latest/lib/FlairCore/src/Euler.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Euler.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Euler.cpp	(revision 209)
@@ -0,0 +1,124 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Euler.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining euler angles
+//
+//
+/*********************************************************************/
+
+#include "Euler.h"
+#include "Quaternion.h"
+#include <math.h>
+
+#define PI ((float)3.14159265358979323846)
+#define PI_D ((double)3.14159265358979323846)
+
+namespace flair {
+namespace core {
+
+Euler::Euler(float inRoll, float inPitch, float inYaw)
+    : roll(inRoll), pitch(inPitch), yaw(inYaw) {}
+
+Euler::~Euler() {}
+
+Euler &Euler::operator=(const Euler &euler) {
+  roll = euler.roll;
+  pitch = euler.pitch;
+  yaw = euler.yaw;
+  return (*this);
+}
+/*
+void Euler::RotateX(float value) {
+    float pitch_tmp;
+    pitch_tmp=pitch*cosf(value)+yaw*sinf(value);
+    yaw=-pitch*sinf(value)+yaw*cosf(value);
+    pitch=pitch_tmp;
+    roll+=value;
+    if(roll<-PI) roll+=2*PI;
+    if(roll>PI) roll-=2*PI;
+}
+
+void Euler::RotateXDeg(float value) {
+    RotateX(ToRadian(value));
+}
+
+void Euler::RotateY(float value) {
+    float roll_tmp;
+    roll_tmp=roll*cosf(value)-yaw*sinf(value);
+    yaw=roll*sinf(value)+yaw*cosf(value);
+    roll=roll_tmp;
+    pitch+=value;
+    if(pitch<-PI) pitch+=2*PI;
+    if(pitch>PI) pitch-=2*PI;
+}
+
+void Euler::RotateYDeg(float value) {
+    RotateY(ToRadian(value));
+}
+
+void Euler::RotateZ(float value) {
+    float roll_tmp;
+    roll_tmp=roll*cosf(value)+pitch*sinf(value);
+    pitch=-roll*sinf(value)+pitch*cosf(value);
+    roll=roll_tmp;
+    yaw+=value;
+    if(yaw<-PI) yaw+=2*PI;
+    if(yaw>PI) yaw-=2*PI;
+}
+
+void Euler::RotateZDeg(float value) {
+    RotateZ(ToRadian(value));
+}
+*/
+void Euler::ToQuaternion(Quaternion &quaternion) const {
+  quaternion.q0 = cos(yaw / 2) * cos(pitch / 2) * cos(roll / 2) +
+                  sin(yaw / 2) * sin(pitch / 2) * sin(roll / 2);
+
+  quaternion.q1 = cos(yaw / 2) * cos(pitch / 2) * sin(roll / 2) -
+                  sin(yaw / 2) * sin(pitch / 2) * cos(roll / 2);
+
+  quaternion.q2 = cos(yaw / 2) * sin(pitch / 2) * cos(roll / 2) +
+                  sin(yaw / 2) * cos(pitch / 2) * sin(roll / 2);
+
+  quaternion.q3 = sin(yaw / 2) * cos(pitch / 2) * cos(roll / 2) -
+                  cos(yaw / 2) * sin(pitch / 2) * sin(roll / 2);
+}
+
+Quaternion Euler::ToQuaternion(void) const {
+  Quaternion quaternion;
+  ToQuaternion(quaternion);
+  return quaternion;
+}
+
+float Euler::ToDegree(float radianValue) { return radianValue * 180.0f / PI; }
+
+float Euler::ToRadian(float degreeValue) { return degreeValue / 180.0f * PI; }
+
+float Euler::YawDistanceFrom(float angle) const {
+  float rot1, rot2;
+  if (angle > yaw) {
+    rot1 = angle - yaw;
+    rot2 = 2 * PI - angle + yaw;
+  } else {
+    rot1 = 2 * PI + angle - yaw;
+    rot2 = yaw - angle;
+  }
+  
+  if (rot2 < rot1) rot1 = -rot2;
+  
+  rot1 = -rot1; // pour avoir rot1=yaw-angle
+
+  return rot1;
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Euler.h
===================================================================
--- tags/latest/lib/FlairCore/src/Euler.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Euler.h	(revision 209)
@@ -0,0 +1,152 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Euler.h
+ * \brief Class defining euler angles
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+
+#ifndef EULER_H
+#define EULER_H
+
+namespace flair {
+namespace core {
+class Quaternion;
+
+/*! \class Euler
+*
+* \brief Class defining euler angles
+*
+* Euler angles are expressed in radians.
+*
+*/
+class Euler {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct euler angles using specified values.
+  *
+  * \param roll roll value
+  * \param pitch pitch value
+  * \param yaw yaw value
+  */
+  Euler(float roll = 0, float pitch = 0, float yaw = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Euler();
+
+  /*!
+  * \brief x axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  // todo: passer par un quaternion
+  // void RotateX(float value);
+
+  /*!
+  * \brief x axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  // void RotateXDeg(float value);
+
+  /*!
+  * \brief y axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  // void RotateY(float value);
+
+  /*!
+  * \brief y axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  // void RotateYDeg(float value);
+
+  /*!
+  * \brief z axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  // void RotateZ(float value);
+
+  /*!
+  * \brief z axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  // void RotateZDeg(float value);
+
+  /*!
+  * \brief Convert to quaternion
+  *
+  * \param quaternion output quaternion
+  */
+  void ToQuaternion(Quaternion &quaternion) const;
+
+  /*!
+  * \brief Convert to quaternion
+  *
+  * \return quaternion
+  */
+  Quaternion ToQuaternion(void) const;
+  /*!
+  * \brief Convert from radian to degree
+  *
+  * \param radianValue value in radian
+  *
+  * \return value in degree
+  */
+  static float ToDegree(float radianValue);
+
+  /*!
+  * \brief Convert from degree to radian
+  *
+  * \param degreeValue value in degree
+  *
+  * \return value in radian
+  */
+  static float ToRadian(float degreeValue);
+
+  /*!
+  * \brief Compute yaw distance
+  *
+  * Compute yaw distance from given angle. This is the minimum distance.
+  *
+  * \param angle starting angle
+  *
+  * \return value distance in radian
+  */
+  float YawDistanceFrom(float angle) const;
+
+  /*!
+  * \brief roll value
+  */
+  float roll;
+
+  /*!
+  * \brief pitch value
+  */
+  float pitch;
+
+  /*!
+  * \brief yaw value
+  */
+  float yaw;
+
+  Euler &operator=(const Euler &euler);
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // EULER_H
Index: tags/latest/lib/FlairCore/src/FindArgument.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/FindArgument.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/FindArgument.cpp	(revision 209)
@@ -0,0 +1,19 @@
+#include "FindArgument.h"
+
+std::string FindArgument(std::string args,std::string arg,bool recquired) {
+	size_t position=args.find (arg);
+	
+	if(position!=std::string::npos) {
+		size_t endPosition=args.find(" ",position);
+		size_t len;
+		if(endPosition!=std::string::npos) {
+			len=endPosition-position-arg.size();
+		} else {
+			len=std::string::npos;
+		}
+		return args.substr(position+arg.size(),len);
+	} else {
+		if(recquired) printf("no %s statement in arguments (%s)\n",arg.c_str(),args.c_str());
+		return "";
+	}
+}
Index: tags/latest/lib/FlairCore/src/FindArgument.h
===================================================================
--- tags/latest/lib/FlairCore/src/FindArgument.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/FindArgument.h	(revision 209)
@@ -0,0 +1,8 @@
+#ifndef FINDARGUMENT
+#define FINDARGUMENT
+
+#include <string>
+
+std::string FindArgument(std::string args,std::string arg,bool recquired);
+
+#endif // FINDARGUMENT
Index: tags/latest/lib/FlairCore/src/FrameworkManager.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/FrameworkManager.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/FrameworkManager.cpp	(revision 209)
@@ -0,0 +1,199 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/31
+//  filename:   FrameworkManager.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Main class of the Framework library
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "IODevice.h"
+#include "config.h"
+#include "compile_info.h"
+
+using std::string;
+using std::vector;
+using namespace flair::gui;
+
+namespace {
+  flair::core::FrameworkManager *frameworkmanager = NULL;
+}
+
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairCore");
+}
+
+
+namespace flair {
+namespace core {
+
+FrameworkManager *getFrameworkManager(void) { return frameworkmanager; }
+
+bool IsBigEndian(void) {
+  union {
+    uint32_t i;
+    char c[4];
+  } bint = {0x01020304};
+
+  if (bint.c[0] == 1) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+FrameworkManager::FrameworkManager(string name)
+    : Object(NULL, name, XML_ROOT_TYPE) {
+  if (frameworkmanager != NULL) {
+    Err("FrameworkManager should be instanced only one time\n");
+    return;
+  }
+
+  frameworkmanager = this;
+  pimpl_ = new FrameworkManager_impl(this, name);
+}
+
+FrameworkManager::~FrameworkManager() {
+  // Printf("destruction FrameworkManager\n");
+
+  // stop ui_com thread (which sends datas for graphs), we do not need it as
+  // graphs will be destroyed
+  if (getUiCom() != NULL) {
+    getUiCom()->SafeStop();
+    getUiCom()->Join();
+  }
+
+  // we start by deleting threads (except pimpl which must be deleted at last)
+  // (before deleting objects that could be used by the threads)
+  // Printf("delete Threads\n");
+  for (vector<const Object *>::iterator it = Childs()->begin();
+       it < Childs()->end(); it++) {
+     //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
+    if ((*it)->ObjectType() == "Thread") {
+      if (*it != pimpl_) {
+        // Printf("del\n");
+        delete (Thread *)(*it);
+        // Childs() vector has been modified, we start from beginning again
+        // it will be incremented by the loop, so in fact we start again at
+        // begin()+1
+        // it is not a problem since begin is pimpl
+        it = Childs()->begin();
+        // Printf("del ok\n");
+      }
+    }
+  }
+
+  // next we delete IODevice
+  // (before deleting objects that could be used by the IODevice)
+  // Printf("delete IODevices\n");
+  for (vector<const Object *>::iterator it = Childs()->begin();
+       it < Childs()->end(); it++) {
+     //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
+    if ((*it)->ObjectType() == "IODevice") {
+      // Printf("del\n");
+      delete (IODevice *)*it;
+      // Printf("del ok\n");
+      // Childs() vector has been modified, we start from beginning again
+      // it will be incremented by the loop, so in fact we start again at
+      // begin()+1
+      // it is not a problem since begin is pimpl (not an IODevice)
+      it = Childs()->begin();
+      // Printf("del ok\n");
+    }
+  }
+
+  // Printf("delete childs\n");
+  // on efface les enfants en commencant par la fin
+  // le ui_com puis FrameworkManager_impl est détruit en dernier
+  // permet de garder l'uicom pour notifer des destructions
+  while (Childs()->size() != 0) {
+     //Printf("child %i %s %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str());
+    if (Childs()->back() != NULL)
+      delete Childs()->back();
+  }
+
+  // childs.clear();
+
+  // Printf("destruction FrameworkManager ok\n");
+}
+
+void FrameworkManager::SetupConnection(string address, uint16_t port,Time watchdogTimeout,
+                                       size_t rcv_buf_size) {
+  pimpl_->SetupConnection(address, port, watchdogTimeout,rcv_buf_size);
+}
+
+void FrameworkManager::SetupUserInterface(string xml_file) {
+  pimpl_->SetupUserInterface(xml_file);
+}
+
+gui::TabWidget *FrameworkManager::GetTabWidget(void) const {
+  if(pimpl_->tabwidget==NULL) Err("SetupUserInterface must be called before\n");
+  return pimpl_->tabwidget;
+}
+
+void FrameworkManager::UpdateSendData(const SendData *obj) {
+  if (getUiCom() != NULL)
+    getUiCom()->UpdateSendData(obj);
+}
+
+void FrameworkManager::BlockCom(void) {
+  if (getUiCom() != NULL)
+    getUiCom()->Block();
+}
+
+void FrameworkManager::UnBlockCom(void) {
+  if (getUiCom() != NULL)
+    getUiCom()->UnBlock();
+}
+
+bool FrameworkManager::ConnectionLost(void) const {
+  if (getUiCom() != NULL) {
+    return (getUiCom()->ConnectionLost() | pimpl_->connection_lost);
+  } else {
+    return false;
+  }
+}
+
+void FrameworkManager::SetupLogger(string log_path) {
+  pimpl_->SetupLogger(log_path);
+}
+
+string FrameworkManager::GetLogPath(void) const {
+	return pimpl_->log_path;
+}
+void FrameworkManager::AddDeviceToLog(IODevice *device) {
+  pimpl_->AddDeviceToLog(device);
+}
+
+bool FrameworkManager::IsDeviceLogged(const IODevice *device) const {
+	return pimpl_->IsDeviceLogged(device);
+}
+
+void FrameworkManager::StartLog(void) { pimpl_->StartLog(); }
+
+void FrameworkManager::StopLog(void) { pimpl_->StopLog(); }
+
+bool FrameworkManager::IsLogging(void) const { return pimpl_->is_logging; }
+
+void FrameworkManager::DisableErrorsDisplay(bool value) {
+  pimpl_->disable_errors = value;
+}
+
+bool FrameworkManager::IsDisplayingErrors(void) const {
+  return !(pimpl_->disable_errors);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/FrameworkManager.h
===================================================================
--- tags/latest/lib/FlairCore/src/FrameworkManager.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/FrameworkManager.h	(revision 209)
@@ -0,0 +1,251 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file FrameworkManager.h
+ * \brief Main class of the Framework library
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/31
+ * \version 4.0
+ */
+
+#ifndef FRAMEWORKMANAGER_H
+#define FRAMEWORKMANAGER_H
+
+#include <Object.h>
+
+class FrameworkManager_impl;
+
+namespace flair {
+  namespace gui {
+    class TabWidget;
+    class SendData;
+  }
+}
+namespace flair {
+namespace core {
+class IODevice;
+
+/*! \class FrameworkManager
+*
+* \brief Main class of the Framework library
+*
+* This is the main class of the library. Only one instance of this class is
+*allowed
+* by program. Morevoer, its name must be unique if more than one program using
+*this class
+* is running on the same system (a control and a simlator for example). \n
+* This class allows: \n
+* -connexion with ground station, \n
+* -creation of a QTabWidget on ground station, \n
+* -handling of xml files, used for default values of Widgets, \n
+* -logging of datas.
+*/
+class FrameworkManager : public Object {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a FrameworkManager. \n
+  * Call SetupConnection method just after this constructor to setup the
+  *conection with a ground station.
+  *
+  * \param name name, must be unique
+  */
+  FrameworkManager(std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  * Calling it will automatically destruct all childs. \n
+  * Destruction implies destruction of the QTabWidget on ground station.
+  *
+  */
+  ~FrameworkManager();
+
+  /*!
+  * \brief Setup the connection with ground station
+  *
+  * Call this method just after the constructor of this class. If this method is
+  * not called, the program will run headless.
+  * If this method is called, SetupUserInterface must also be called after this.
+  *
+  * \param address address of ground station
+  * \param port port of ground station
+  * \param watchdogTimeout watchdog timeout for the connection, passing TIME_INFINITE will disable the watchdog
+  * \param rcv_buf_size receive buffer size
+  */
+  void SetupConnection(std::string address, uint16_t port,Time watchdogTimeout=(Time)1000000000,
+                       size_t rcv_buf_size = 10000);
+
+  /*!
+  * \brief Setup the user interface
+  *
+  * If this method is called after SetupConnection, Widgets will be displayed in
+  * the ground station.
+  * If this method is called and SetupConnection was not called, it will run headless but default values of Widgets will be taken
+  * from the xml file.
+  * If this method is not called, Widgets will not be available. Constructing an object based on Widget class will fail.
+  *
+  * \param xml_file xml file for default values of Widgets
+  */
+  void SetupUserInterface(std::string xml_file);
+
+  /*!
+  * \brief Get TabWidget
+  *
+  * \return TabWidget
+  */
+  gui::TabWidget *GetTabWidget(void) const;
+
+  /*!
+  * \brief Logger setup
+  *
+  * Setup path of log files. \n
+  * No logging will be performed if this method is not called. \n
+  *
+  * \param log_path path to store logs
+  */
+  void SetupLogger(std::string log_path);
+	
+	/*!
+  * \brief Get log path
+  *
+	* get the path defined by SetupLogger
+  *
+  * \return log path
+  */
+  std::string GetLogPath(void) const;
+
+  /*!
+  * \brief Add log element
+  *
+  * The added element will be automatically logged once
+  * logging started (see StartLog()). \n
+  * This element must define on its side the io_data
+  * to log, trough IODevice::SetDataToLog method.
+  *
+  * \param device IODevice to add
+  */
+  void AddDeviceToLog(IODevice *device);
+	
+	/*!
+  * \brief Is device logged
+  *
+  * Check if AddDeviceToLog was called for an IODevice
+  *
+  * \param device IODevice to check
+  * \return true if AddDeviceToLog was called for this IODevice
+  */
+  bool IsDeviceLogged(const IODevice *device) const;
+
+  /*!
+  * \brief Start logging
+  *
+  * All IODevice added through AddDeviceToLog() method
+  * will automatically be logged. \n
+  * SetupLogger() must have been called before.
+  */
+  void StartLog(void);
+
+  /*!
+  * \brief Stop logging
+  *
+  * Logs will automatically be sent to ground station.
+  */
+  void StopLog(void);
+
+  /*!
+  * \brief Is logging?
+  *
+  * \return true if is logging
+  */
+  bool IsLogging(void) const;
+
+  /*!
+  * \brief Notify that SendData's period has changed
+  *
+  * This funtion must be called when the period has changed. \n
+  * Normally, it occurs in the Widget::XmlEvent method. \n
+  * This method must be called with communication blocked (see BlockCom()).
+  *
+  * \param obj SendData which changed
+  */
+  void UpdateSendData(const gui::SendData *obj);
+
+  /*!
+  * \brief Block communication
+  *
+  * This funtion blocks the communication beetween the program and ground
+  *station. \n
+  * It must be called before changing datas or parameters exchanged between the
+  *program
+  * and the ground station.
+  *
+  */
+  void BlockCom(void);
+
+  /*!
+ * \brief Unblock communication
+ *
+ * This funtion unblocks the communication beetween the program and ground
+ *station. \n
+ * It must be called after changing datas or parameters exchanged between the
+ *program
+ * and the ground station.
+ *
+ */
+  void UnBlockCom(void);
+
+  /*!
+  * \brief Is connection lost?
+  *
+  * Once this method returns true, it will never return false back. \n
+  * Note that this method return false if no connection is defined (see
+  *SetupConnection).
+  *
+  * \return true if connection with ground station is lost
+  */
+  bool ConnectionLost(void) const;
+
+  /*!
+  * \brief Disable errors display
+  *
+  * Disable errors display, if you do not want to saturate console for exemple.
+  * By defaults errors disply is enabled.
+  *
+  * \param value true to disable errors display
+  */
+  void DisableErrorsDisplay(bool value);
+
+  /*!
+  * \brief Is displaying errors?
+  *
+  *
+  * \return true if errors display is enabled
+  */
+  bool IsDisplayingErrors(void) const;
+
+private:
+  class FrameworkManager_impl *pimpl_;
+};
+
+/*!
+* \brief get FrameworkManager
+*
+* \return the FrameworkManager
+*/
+FrameworkManager *getFrameworkManager(void);
+
+/*!
+* \brief is big endian?
+*
+* \return true if big endian, false if little endian
+*/
+bool IsBigEndian(void);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // FRAMEWORKMANAGER_H
Index: tags/latest/lib/FlairCore/src/FrameworkManager_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 209)
@@ -0,0 +1,933 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/31
+//  filename:   FrameworkManager.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Classe de base de la librairie
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager_impl.h"
+#include "FrameworkManager.h"
+#include "Widget_impl.h"
+#include <unistd.h>
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "TabWidget.h"
+#include "Layout.h"
+#include "PushButton.h"
+#include "communication.h"
+#include "config.h"
+#include "Watchdog.h"
+#include <errno.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <sys/mman.h>
+#include <execinfo.h>
+#include <signal.h>
+#include <fcntl.h>
+#ifdef __XENO__
+#include <native/task.h>
+#include <rtdk.h>
+#endif
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+ui_com *FrameworkManager_impl::com = NULL;
+FrameworkManager_impl *FrameworkManager_impl::_this = NULL;
+
+namespace {
+#ifdef __XENO__
+
+#ifdef SIGDEBUG
+static const char *reason_str[] = {
+    "undefined", "received signal", "invoked syscall", "triggered fault",
+    "affected by priority inversion", "missing mlockall", "runaway thread",
+};
+
+void warn_upon_switch(int sig, siginfo_t *si, void *context) {
+  unsigned int reason = si->si_value.sival_int;
+  void *bt[32];
+  int nentries;
+#ifdef SIGDEBUG_WATCHDOG
+  printf("\nSIGDEBUG received, reason %d: %s\n", reason,
+         reason <= SIGDEBUG_WATCHDOG ? reason_str[reason] : "<unknown>");
+#endif
+  // Dump a backtrace of the frame which caused the switch to secondary mode:
+  nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
+  backtrace_symbols_fd(bt, nentries, fileno(stdout));
+}
+#else  // SIGDEBUG
+void warn_upon_switch(int sig __attribute__((unused))) {
+  void *bt[32];
+  int nentries;
+
+  /* Dump a backtrace of the frame which caused the switch to
+     secondary mode: */
+  nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
+  backtrace_symbols_fd(bt, nentries, fileno(stdout));
+}
+#endif // SIGDEBUG
+#endif //__XENO__
+void seg_fault(int sig __attribute__((unused))) {
+  void *bt[32];
+  int nentries;
+
+  printf("Segmentation fault:\n");
+  /* Dump a backtrace of the frame which caused the segfault: */
+  nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
+  backtrace_symbols_fd(bt, nentries, fileno(stdout));
+
+  exit(1);
+}
+}
+
+FrameworkManager_impl::FrameworkManager_impl(FrameworkManager *self,
+                                             string name)
+    : Thread(self, "FrameworkManager", FRAMEWORK_TASK_PRIORITY) {
+  this->self = self;
+  is_logging = false;
+  logger_defined = false;
+  disable_errors = false;
+  ui_defined = false;
+  rcv_buf = NULL;
+  gcs_watchdog = NULL;
+  _this = this;
+  tabwidget=NULL;
+
+  // Avoids memory swapping for this program
+  mlockall(MCL_CURRENT | MCL_FUTURE);
+
+  // catch segfault
+  signal(SIGSEGV, seg_fault);
+
+// catch primary->secondary switch
+#ifdef __XENO__
+#ifdef SIGDEBUG
+  struct sigaction sa;
+  sigemptyset(&sa.sa_mask);
+  sa.sa_sigaction = warn_upon_switch;
+  sa.sa_flags = SA_SIGINFO;
+  sigaction(SIGDEBUG, &sa, NULL);
+#else //SIGDEBUG
+  signal(SIGXCPU, warn_upon_switch);
+#endif //SIGDEBUG
+  string task_name = "Framework_" + name;
+
+  // Perform auto-init of rt_print buffers if the task doesn't do so
+  rt_print_auto_init(1);
+  // Initialise the rt_print buffer for this task explicitly
+  rt_print_init(512, task_name.c_str());
+
+  int status = rt_task_shadow(NULL, task_name.c_str(), 10, 0);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("rt_task_shadow error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+
+#endif //__XENO__
+}
+
+void FrameworkManager_impl::ConnectionLost(void) {
+  Err("connection lost\n");
+  gcs_watchdog->SafeStop();
+  connection_lost = true;
+}
+
+FrameworkManager_impl::~FrameworkManager_impl() {
+  // Printf("destruction FrameworkManager_impl\n");
+  int status;
+	char errorMsg[256];
+	
+  SafeStop();
+  Join();
+
+  if (rcv_buf != NULL)
+    free(rcv_buf);
+
+  if (logger_defined == true) {
+    continuer = false;
+    (void)pthread_join(log_th, NULL);
+
+    status = DeletePipe(&cmd_pipe);
+    if (status != 0) {
+      Err("Error deleting pipe (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+    status = DeletePipe(&data_pipe);
+    if (status != 0) {
+      Err("Error deleting pipe (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+
+#ifdef __XENO__
+    status = rt_heap_delete(&log_heap);
+    if (status != 0) {
+      Err("rt_heap_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+#endif
+
+    logs.clear();
+  }
+
+  if (file_doc != NULL)
+    xmlFreeDoc(file_doc);
+
+  if (ui_defined)
+    delete top_layout;
+
+  if (com != NULL) {
+    delete com;
+    status = UDT::close(com_sock);
+    if (status != 0)
+      Printf("Error udt::close %s", UDT::getlasterror().getErrorMessage());
+
+    status = UDT::close(file_sock);
+    if (status != 0)
+      Printf("Error udt::close %s", UDT::getlasterror().getErrorMessage());
+
+    SleepMS(200); // a revoir, sinon UDT::cleanup bloque en RT
+    UDT::cleanup();
+  }
+
+  // Printf("destruction FrameworkManager_impl ok\n");
+}
+
+void FrameworkManager_impl::SetupConnection(string address, uint16_t port,Time watchdogTimeout,
+                                            size_t rcv_buf_size) {
+  if (com != NULL) {
+    Err("SetupConnection should be called only one time\n");
+    return;
+  }
+																							
+	UDT::startup();
+  this->rcv_buf_size = rcv_buf_size;
+
+  // socket file_socket, doit être créé en premier, cf station sol
+  Printf("Connecting to %s:%i\n", address.c_str(), port);
+  file_sock = GetSocket(address, port);
+  com_sock = GetSocket(address, port);
+
+  // receive buffer allocation
+  rcv_buf = (char *)malloc(rcv_buf_size);
+  if (rcv_buf == NULL) {
+    Err("receive buffer malloc error\n");
+  }
+
+  com = new ui_com(this, com_sock);
+
+  // file managment
+  bool blocking = true;
+  UDT::setsockopt(file_sock, 0, UDT_SNDSYN, &blocking, sizeof(bool));
+  UDT::setsockopt(file_sock, 0, UDT_RCVSYN, &blocking, sizeof(bool));
+
+  int timeout = 100; // ms
+  UDT::setsockopt(com_sock, 0, UDT_RCVTIMEO, &timeout, sizeof(int));
+
+  Start();
+
+  // watchdog for connection with ground station
+  connection_lost = false;
+  gcs_watchdog = new Watchdog(
+      this, std::bind(&FrameworkManager_impl::ConnectionLost, this),
+      watchdogTimeout);
+  gcs_watchdog->Start();
+}
+
+void FrameworkManager_impl::SetupUserInterface(string xml_file) {
+  ui_defined = true;
+  this->xml_file = xml_file;
+
+  // top_layout=new Layout(NULL,XML_ROOT_ELEMENT,XML_ROOT_TYPE);
+  top_layout = new Layout(NULL, self->ObjectName(), XML_ROOT_TYPE);
+
+  // xml setup of the main widget
+  if (xml_file != "") {
+    xmlNodePtr *file_node = &(((Widget *)(top_layout))->pimpl_->file_node);
+    file_doc = xmlParseFile(xml_file.c_str());
+    if (file_doc == NULL) {
+      self->Warn("XML document not parsed successfully. Creating a new one.\n");
+      file_doc = xmlNewDoc((xmlChar *)"1.0");
+      *file_node = xmlNewNode(NULL, (xmlChar *)XML_ROOT_TYPE);
+      xmlSetProp(*file_node, (xmlChar *)"name",
+                 (xmlChar *)ObjectName().c_str());
+      xmlDocSetRootElement(file_doc, *file_node);
+      // PrintXml();
+    } else {
+      *file_node = xmlDocGetRootElement(file_doc);
+      if (xmlStrcmp((*file_node)->name, (xmlChar *)XML_ROOT_TYPE)) {
+        self->Warn("%s, no match found in xml file\n", XML_ROOT_TYPE);
+        *file_node = xmlNewNode(NULL, (xmlChar *)XML_ROOT_TYPE);
+        xmlSetProp(*file_node, (xmlChar *)"name",
+                   (xmlChar *)ObjectName().c_str());
+        xmlDocSetRootElement(file_doc, *file_node);
+      }
+    }
+  } else {
+    self->Err("xml file not defined\n");
+  }
+
+  // gui
+  tabwidget =
+      new TabWidget(top_layout->At(0, 0), XML_MAIN_TABWIDGET, TabWidget::North);
+  save_button =
+      new PushButton(top_layout->At(1, 0),
+                     "save config on target (" + self->ObjectName() + ")");
+  // load_button=new PushButton(top_layout->At(1,1),"load config on target (" +
+  // self->ObjectName() + ")");
+}
+
+// in case of RT, this thread switches to secondary mode when calling
+// com->Receive
+// it switches back to RT in ProcessXML when mutex are locked
+void FrameworkManager_impl::Run(void) {
+  while (!ToBeStopped()) {
+    ssize_t bytesRead;
+
+    bytesRead = com->Receive(rcv_buf, rcv_buf_size);
+
+    if (bytesRead == (ssize_t)rcv_buf_size)
+      Err("FrameworkManager max receive size, augmenter le buffer size!\n");
+
+    if (bytesRead > 0) {
+      // printf("recu %ld, trame %x\n",bytesRead,(uint8_t)rcv_buf[0]);
+      // rcv_buf[bytesRead-1]=0;//pour affichage
+      // printf("%s\n",rcv_buf);
+
+      switch ((uint8_t)rcv_buf[0]) {
+      case XML_HEADER: {
+        xmlDoc *doc;
+        rcv_buf[bytesRead] = 0;
+ //Printf("%s\n",rcv_buf);
+        doc = xmlReadMemory(rcv_buf, (int)bytesRead, "include.xml",
+                            "ISO-8859-1", 0);
+        xmlNode *cur_node = NULL;
+
+        for (cur_node = xmlDocGetRootElement(doc); cur_node;
+             cur_node = cur_node->next) {
+          if (cur_node->type == XML_ELEMENT_NODE) {
+            if (!xmlStrcmp(cur_node->name, (xmlChar *)XML_ROOT_TYPE)) {
+#ifdef __XENO__
+              WarnUponSwitches(
+                  true); // ProcessXML should not switch to secondary mode
+#endif
+              top_layout->Widget::pimpl_->ProcessXML(cur_node->children);
+#ifdef __XENO__
+              WarnUponSwitches(false); // other parts of this thread can switch
+                                       // to secondary mode
+#endif
+              break;
+            }
+          }
+        }
+
+        xmlFreeDoc(doc);
+
+        if (save_button->Clicked())
+          SaveXml();
+
+        SaveXmlChange(rcv_buf);
+
+        break;
+      }
+      case WATCHDOG_HEADER: {
+        gcs_watchdog->Touch();
+        break;
+      }
+      default:
+        Err("unknown id: %x\n", (uint8_t)rcv_buf[0]);
+        break;
+      }
+    } else {
+      if (com->ConnectionLost())
+        SleepMS(10); // avoid infinite loop in this case
+    }
+  }
+}
+
+void FrameworkManager_impl::SaveXml(void) {
+  if (ui_defined)
+    xmlSaveFormatFile(xml_file.c_str(), file_doc, 1);
+}
+
+void FrameworkManager_impl::SaveXmlChange(char *buf) {
+  if (is_logging == true) {
+    FILE *xml_change;
+    char filename[256];
+    Time time = GetTime();
+
+    sprintf(filename, "%s/changes_at_%lld.xml", log_path.c_str(), time);
+
+    xml_change = fopen(filename, "a");
+    fprintf(xml_change, "%s", buf);
+    fclose(xml_change);
+
+    sprintf(filename, "changes_at_%lld.xml", time);
+    xml_changes.push_back(filename);
+  }
+}
+
+void FrameworkManager_impl::SendFile(string path, string name) {
+  char *buf, *more_buf;
+  int size;
+  filebuf *pbuf;
+  ssize_t nb_write;
+  string filename = path + "/" + name;
+
+  // open the file
+  fstream ifs(filename.c_str(), ios::in | ios::binary);
+  ifs.seekg(0, ios::end);
+  size = ifs.tellg();
+  ifs.seekg(0, ios::beg);
+  pbuf = ifs.rdbuf();
+
+  if (size <= 0) {
+    Err("error opening file %s\n", filename.c_str());
+    return;
+  }
+
+  buf = (char *)malloc(sizeof(uint8_t) + sizeof(int) + name.size());
+  if (buf == NULL) {
+    Err("malloc error, not sending file\n");
+    return;
+  }
+
+  if (IsBigEndian()) {
+    buf[0] = FILE_INFO_BIG_ENDIAN;
+  } else {
+    buf[0] = FILE_INFO_LITTLE_ENDIAN;
+  }
+
+  memcpy(buf + 1, &size, sizeof(int));
+  memcpy(buf + 1 + sizeof(int), name.c_str(), name.size());
+  Printf("sending %s, size: %i\n", filename.c_str(), size);
+  // send file information
+  UDT::sendmsg(file_sock, buf, sizeof(uint8_t) + sizeof(int) + name.size(), -1,
+               true);
+
+  more_buf = (char *)realloc((void *)buf, size);
+  if (more_buf == NULL) {
+    Err("realloc error, not sending file\n");
+    free(buf);
+    return;
+  } else {
+    buf = more_buf;
+  }
+
+  pbuf->sgetn(buf, size);
+  // send the file
+  nb_write = UDT::sendmsg(file_sock, buf, size, -1, true);
+
+  if (nb_write < 0) {
+    Err("UDT::sendmsg error (%s)\n", UDT::getlasterror().getErrorMessage());
+  } else if (nb_write != size) {
+    Err("UDT::sendmsg error, sent %ld/%i\n", nb_write, size);
+  }
+
+  ifs.close();
+  free(buf);
+}
+
+void FrameworkManager_impl::FinishSending() {
+  char rm_cmd[256];
+
+  // send orignal xml
+  SendFile(log_path, "setup.xml");
+  sprintf(rm_cmd, "rm %s/setup.xml", log_path.c_str());
+  system(rm_cmd);
+
+  // send xml changes
+  for (size_t i = 0; i < xml_changes.size(); i++) {
+    // Printf("%s\n",xml_changes.at(i).c_str());
+    SendFile(log_path, xml_changes.at(i).c_str());
+    sprintf(rm_cmd, "rm %s/%s", log_path.c_str(), xml_changes.at(i).c_str());
+    system(rm_cmd);
+  }
+  xml_changes.clear();
+
+  // end notify
+  char buf = END;
+  int nb_write = UDT::sendmsg(file_sock, &buf, 1, -1, true);
+
+  if (nb_write < 0) {
+    Err("UDT::sendmsg error (%s)\n", UDT::getlasterror().getErrorMessage());
+  } else if (nb_write != 1) {
+    Err("UDT::sendmsg error, sent %i/%i\n", nb_write, 1);
+  }
+
+    //wait end ACK
+    int nb_read = UDT::recvmsg(file_sock,&buf,1);
+    if(nb_read<0) {
+    Err("UDT::recvmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+    } else if (nb_read != 1)  {
+    Err("UDT::recvmsg error, sent %i/%i\n",nb_read,1);
+    }
+}
+
+UDTSOCKET FrameworkManager_impl::GetSocket(string address, uint16_t port) {
+  while (1) {
+    UDTSOCKET new_fd;
+    new_fd = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+    if (new_fd == UDT::INVALID_SOCK) {
+      Err("socket error: %s\n", UDT::getlasterror().getErrorMessage());
+      return 0;
+    }
+
+    sockaddr_in serv_addr;
+    serv_addr.sin_family = AF_INET;
+    serv_addr.sin_port = htons(short(port));
+
+    if (inet_pton(AF_INET, address.c_str(), &serv_addr.sin_addr) <= 0) {
+      Err("incorrect network address\n");
+      return 0;
+    }
+
+    memset(&(serv_addr.sin_zero), '\0', 8);
+
+    if (UDT::ERROR ==
+        UDT::connect(new_fd, (sockaddr *)&serv_addr, sizeof(serv_addr))) {
+      // Printf("connect error: %s
+      // %i\n",UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode());
+      UDT::close(new_fd);
+      if (UDT::getlasterror().getErrorCode() != 1001 &&
+          UDT::getlasterror().getErrorCode() != 1002) {
+        Err("connect error: %s\n", UDT::getlasterror().getErrorMessage());
+        return 0;
+      }
+    } else {
+      // printf("connected to
+      // %s:%i\n",inet_ntoa(serv_addr.sin_addr),serv_addr.sin_port);
+      return new_fd;
+    }
+  }
+}
+
+#ifdef __XENO__
+int FrameworkManager_impl::CreatePipe(RT_PIPE *fd, string name) {
+  name = self->ObjectName() + "-" + name;
+  // xenomai limitation
+  if (name.size() > 31)
+    self->Err("rt_pipe_create error (%s is too long)\n", name.c_str());
+// start log writter
+#ifdef RT_PIPE_SIZE
+  return rt_pipe_create(fd, name.c_str(), P_MINOR_AUTO, RT_PIPE_SIZE);
+#else
+  return rt_pipe_create(fd, name.c_str(), P_MINOR_AUTO, 0);
+#endif
+}
+#else
+int FrameworkManager_impl::CreatePipe(int (*fd)[2], string name) {
+  // if(pipe2(fd[0],O_NONBLOCK) == -1)
+  if (pipe(fd[0]) == -1) {
+    return errno;
+  } else {
+    int attr = fcntl((*fd)[0], F_GETFL, 0);
+    if (attr == -1) {
+      return errno;
+    }
+    if (fcntl((*fd)[0], F_SETFL, attr | O_NONBLOCK) == -1) {
+      return errno;
+    }
+    attr = fcntl((*fd)[1], F_GETFL, 0);
+    if (attr == -1) {
+      return errno;
+    }
+    if (fcntl((*fd)[1], F_SETFL, attr | O_NONBLOCK) == -1) {
+      return errno;
+    }
+
+    return 0;
+  }
+}
+#endif
+
+#ifdef __XENO__
+int FrameworkManager_impl::DeletePipe(RT_PIPE *fd) {
+  return rt_pipe_delete(fd);
+}
+#else
+int FrameworkManager_impl::DeletePipe(int (*fd)[2]) {
+  int status1 = close((*fd)[0]);
+  int status2 = close((*fd)[1]);
+  if (status1 == 0 && status2 == 0)
+    return 0;
+  if (status1 != 0)
+    return status1;
+  if (status2 != 0)
+    return status2;
+}
+#endif
+
+void FrameworkManager_impl::SetupLogger(string log_path) {
+  char errorMsg[256];
+	
+	if (logger_defined == true) {
+    Warn("SetupLogger() was already called.\n");
+    return;
+  }
+
+  this->log_path = log_path;
+
+  int status = CreatePipe(&cmd_pipe, "log_cmd");
+  if (status != 0) {
+    Err("Error creating pipe (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    return;
+  }
+
+  status = CreatePipe(&data_pipe, "log_data");
+  if (status != 0) {
+    Err("Error creating pipe (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    return;
+  }
+
+#ifdef __XENO__
+  string tmp_name;
+  tmp_name = self->ObjectName() + "-log_heap";
+  status = rt_heap_create(&log_heap, tmp_name.c_str(), LOG_HEAP, H_FIFO);
+  if (status != 0) {
+    Err("rt_heap_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    return;
+  }
+#endif //__XENO__
+
+  continuer = true;
+
+#ifdef NRT_STACK_SIZE
+  // Initialize thread creation attributes
+  pthread_attr_t attr;
+  if (pthread_attr_init(&attr) != 0) {
+    Err("pthread_attr_init error\n");
+    return;
+  }
+
+  if (pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0) {
+    Err("pthread_attr_setstacksize error\n");
+    return;
+  }
+
+  if (pthread_create(&log_th, &attr, write_log_user, (void *)this) < 0)
+#else
+  if (pthread_create(&log_th, NULL, write_log_user, (void *)this) < 0)
+#endif
+  {
+    Err("pthread_create error\n");
+    return;
+  }
+#ifdef NRT_STACK_SIZE
+  if (pthread_attr_destroy(&attr) != 0) {
+    Err("pthread_attr_destroy error\n");
+    return;
+  }
+#endif
+
+  logger_defined = true;
+}
+
+void FrameworkManager_impl::AddDeviceToLog(IODevice *device) {
+  if (logger_defined == false) {
+    Warn("SetupLogger() was not called, not adding to log\n");
+    return;
+  }
+
+  if (is_logging == false) {
+    if (!device->pimpl_->IsSetToBeLogged()) {
+			device->pimpl_->SetToBeLogged();
+      log_desc_t tmp;
+      tmp.device = device;
+      logs.push_back(tmp);
+    } else {
+      Warn("not adding it twice\n");
+    }
+  } else {
+    Err("impossible while logging\n");
+  }
+}
+
+bool FrameworkManager_impl::IsDeviceLogged(const IODevice *device) const {
+	return device->pimpl_->IsSetToBeLogged();
+}
+
+void FrameworkManager_impl::StartLog(void) {
+  if (logger_defined == false) {
+    Err("SetupLogger() was not called, not starting log\n");
+    return;
+  }
+
+  ssize_t written;
+  size_t nb_err = 0;
+
+  if (logs.size() == 0) {
+    Warn("Not starting log: nothing to log!\n");
+    return;
+  }
+
+  if (is_logging == false) {
+    for (size_t i = 0; i < logs.size(); i++) {
+
+      logs.at(i).running = true;
+      logs.at(i).dbtFile = NULL;
+      logs.at(i).size = logs.at(i).device->pimpl_->LogSize();
+#ifdef __XENO__
+      written =
+          rt_pipe_write(&cmd_pipe, &logs.at(i), sizeof(log_desc_t), P_NORMAL);
+#else
+      written = write(cmd_pipe[1], &logs.at(i), sizeof(log_desc_t));
+#endif
+
+      if (written < 0) {
+				char errorMsg[256];
+        Err("write pipe error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg)));
+        nb_err++;
+        logs.at(i).running = false;
+      } else if (written != sizeof(log_desc_t)) {
+        Err("write pipe error %ld/%ld\n", written, sizeof(log_desc_t));
+        nb_err++;
+        logs.at(i).running = false;
+      }
+    }
+
+    if (nb_err != logs.size())
+      is_logging = true;
+  } else {
+    Warn("Already logging\n");
+  }
+}
+
+void FrameworkManager_impl::StopLog(void) {
+  ssize_t written;
+
+  if (is_logging == true) {
+    for (size_t i = 0; i < logs.size(); i++) {
+      logs.at(i).running = false;
+    }
+// send only one running false condition, user thread will stop and send all
+#ifdef __XENO__
+    written =
+        rt_pipe_write(&cmd_pipe, &logs.at(0), sizeof(log_desc_t), P_NORMAL);
+#else
+    written = write(cmd_pipe[1], &logs.at(0), sizeof(log_desc_t));
+#endif
+
+    if (written < 0) {
+			char errorMsg[256];
+      Err("write pipe error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg)));
+      return;
+    } else if (written != sizeof(log_desc_t)) {
+      Err("write pipe error %ld/%ld\n", written, sizeof(log_desc_t));
+      return;
+    }
+
+    is_logging = false;
+  } else {
+    Warn("Not logging\n");
+  }
+}
+
+char *FrameworkManager_impl::GetBuffer(size_t sz) {
+// Printf("alloc %i\n",sz);
+#ifdef __XENO__
+  void *ptr;
+  int status = rt_heap_alloc(&log_heap, sz, TM_NONBLOCK, &ptr);
+  if (status != 0) {
+		char errorMsg[256];
+    Err("rt_heap_alloc error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    ptr = NULL;
+  }
+  return (char *)ptr;
+#else
+  return (char *)malloc(sz);
+#endif
+}
+
+void FrameworkManager_impl::ReleaseBuffer(char *buf) {
+#ifdef __XENO__
+  int status = rt_heap_free(&log_heap, buf);
+
+  if (status != 0) {
+		char errorMsg[256];
+    Err("rt_heap_free error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+#else
+  free(buf);
+#endif
+}
+
+void FrameworkManager_impl::WriteLog(const char *buf, size_t size) {
+  ssize_t written;
+
+#ifdef __XENO__
+  written = rt_pipe_write(&data_pipe, buf, size, P_NORMAL);
+#else
+  written = write(data_pipe[1], buf, size);
+#endif
+
+  if (written < 0) {
+		char errorMsg[256];
+    Err("error write pipe (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg)));
+  } else if (written != (ssize_t)size) {
+    Err("error write pipe %ld/%ld\n", written, size);
+  }
+}
+
+void *FrameworkManager_impl::write_log_user(void *arg) {
+  int cmd_pipe = -1;
+  int data_pipe = -1;
+  string filename;
+  fd_set set;
+  struct timeval timeout;
+  FrameworkManager_impl *caller = (FrameworkManager_impl *)arg;
+  int rv;
+
+  vector<log_desc_t> logs;
+
+#ifdef __XENO__
+	char errorMsg[256];
+  filename = NRT_PIPE_PATH + caller->self->ObjectName() + "-log_cmd";
+  while (cmd_pipe < 0) {
+    cmd_pipe = open(filename.c_str(), O_RDWR);
+    if (cmd_pipe < 0 && errno != ENOENT)
+      caller->self->Err("open rt_pipe error: %s %s\n", filename.c_str(), strerror_r(errno, errorMsg, sizeof(errorMsg)));
+    usleep(1000);
+  }
+  filename = NRT_PIPE_PATH + caller->self->ObjectName() + "-log_data";
+  while (data_pipe < 0) {
+    data_pipe = open(filename.c_str(), O_RDWR);
+    if (data_pipe < 0 && errno != ENOENT)
+      caller->self->Err("open rt_pipe error: %s %s\n", filename.c_str(), strerror_r(errno, errorMsg, sizeof(errorMsg)));
+    usleep(1000);
+  }
+#else
+  cmd_pipe = caller->cmd_pipe[0];
+  data_pipe = caller->data_pipe[0];
+#endif
+
+  while (caller->continuer == true) {
+    FD_ZERO(&set);
+    FD_SET(cmd_pipe, &set);
+    FD_SET(data_pipe, &set);
+
+    timeout.tv_sec = 0;
+    timeout.tv_usec = SELECT_TIMEOUT_MS * 1000;
+    rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+    if (rv == -1) {
+      caller->Err("select error\n"); // an error accured
+    } else if (rv == 0) {
+      // printf("timeout write_log_user %s\n",caller->ObjectName().c_str()); //
+      // a timeout occured
+    } else {
+      if (FD_ISSET(cmd_pipe, &set)) {
+        log_desc_t tmp;
+        read(cmd_pipe, &tmp, sizeof(log_desc_t));
+
+        if (tmp.running == true) // start logging
+        {
+          filename = caller->log_path + "/" + caller->FileName(tmp.device) + ".dbt";
+          printf("Creating log file %s (log size %i)\n", filename.c_str(), (int)tmp.size);
+          tmp.dbtFile = inithdFile((char *)filename.c_str(), UAV, tmp.size);
+          logs.push_back(tmp);
+
+          if (logs.size() == 1) {
+            filename = caller->log_path + "/setup.xml";
+            xmlSaveFile(filename.c_str(), caller->file_doc);
+          }
+        } else // stop logging
+        {
+            //disable watchdog temporarly
+            //this is necessary because GCS is no longer sending the heartbeat when receiving files...
+            //TODO: add a thread in GCS for receiving file
+            //but be careful that with a xbee modem for exemple, sending files can saturate communication and
+            //avoid the heartbeat to be received... so disabling watchdog is not a so bad option...
+            if(caller->gcs_watchdog!=NULL) {
+                caller->gcs_watchdog->SafeStop();
+                caller->gcs_watchdog->Join();
+            }
+          for (size_t i = 0; i < logs.size(); i++) {
+            if (logs.at(i).dbtFile != NULL) {
+              close_hdfile(logs.at(i).dbtFile);
+
+              filename = caller->FileName(logs.at(i).device) + ".dbt";
+              caller->SendFile(caller->log_path, filename);
+
+              fstream txt_file;
+              filename = caller->FileName(logs.at(i).device) + ".txt";
+              txt_file.open((caller->log_path + "/" + filename).c_str(),
+                            fstream::out);
+              txt_file << "1: time (us)\n2: time (ns)\n";
+              int index = 3;
+              logs.at(i).device->pimpl_->WriteLogsDescriptors(txt_file, &index);
+              txt_file.close();
+
+              caller->SendFile(caller->log_path, filename);
+            }
+          }
+          // a revoir celui ci est le xml enregistré et pas forcement l'actuel
+          // if(caller->xml_file!="") caller->SendFile(caller->xml_file);
+          caller->FinishSending();
+
+          logs.clear();
+            //enable watchdog again
+            if(caller->gcs_watchdog!=NULL) {
+                caller->gcs_watchdog->Start();
+            }
+        }
+      }
+
+      if (FD_ISSET(data_pipe, &set)) {
+        log_header_t header;
+        read(data_pipe, &header, sizeof(log_header_t));
+
+        for (size_t i = 0; i < logs.size(); i++) {
+          if (logs.at(i).device == header.device) {
+            char *buf = (char *)malloc(header.size);
+            read(data_pipe, buf, header.size);
+            // printf("%s \n",header.device->ObjectName().c_str());
+            // for(int i=0;i<header.size;i++) printf("%x ",buf[i]);
+            // printf("\n");
+            if (logs.at(i).size == header.size) {
+              if (logs.at(i).dbtFile != NULL) {
+                write_hdfile(
+                    logs.at(i).dbtFile, buf, (road_time_t)(header.time / 1000),
+                    (road_timerange_t)(header.time % 1000), header.size);
+              } else {
+                printf("err\n");
+              }
+            } else {
+              caller->self->Err("%s log size is not correct %i/%i\n",
+                                header.device->ObjectName().c_str(),
+                                header.size, logs.at(i).size);
+            }
+            free(buf);
+          }
+        }
+      }
+    }
+  }
+
+#ifdef __XENO__
+  close(cmd_pipe);
+  close(data_pipe);
+#endif
+
+  pthread_exit(0);
+}
+
+string FrameworkManager_impl::FileName(IODevice *device) {
+  return getFrameworkManager()->ObjectName() + "_" + device->ObjectName();
+}
+
+void FrameworkManager_impl::PrintXml(void) const {
+  xmlChar *xmlbuff;
+  int buffersize;
+  xmlDocDumpFormatMemory(file_doc, &xmlbuff, &buffersize, 1);
+  Printf("xml:\n%s\n", xmlbuff);
+  xmlFree(xmlbuff);
+}
Index: tags/latest/lib/FlairCore/src/GeoCoordinate.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/GeoCoordinate.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/GeoCoordinate.cpp	(revision 209)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/07/29
+//  filename:   GeoCoordinate.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a point by its lla coordinates
+//
+//
+/*********************************************************************/
+
+#include "GeoCoordinate.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+GeoCoordinate::GeoCoordinate(const Object *parent, string name,
+                             const GeoCoordinate *point, int n)
+    : io_data(parent, name, n) {
+  if (n > 1)
+    Warn("n>1 not supported\n");
+  CopyFrom(point);
+}
+
+GeoCoordinate::GeoCoordinate(const Object *parent, string name, double latitude,
+                             double longitude, double altitude, int n)
+    : io_data(parent, name, n) {
+  this->latitude = latitude;
+  this->longitude = longitude;
+  this->altitude = altitude;
+}
+
+GeoCoordinate::~GeoCoordinate() {}
+
+void GeoCoordinate::CopyFrom(const GeoCoordinate *point) {
+  double latitude, longitude, altitude;
+  point->GetCoordinates(&latitude, &longitude, &altitude);
+  GetMutex();
+  this->latitude = latitude;
+  this->longitude = longitude;
+  this->altitude = altitude;
+  ReleaseMutex();
+}
+
+void GeoCoordinate::SetCoordinates(double latitude, double longitude,
+                                   double altitude) {
+  GetMutex();
+  this->latitude = latitude;
+  this->longitude = longitude;
+  this->altitude = altitude;
+  ReleaseMutex();
+}
+
+void GeoCoordinate::GetCoordinates(double *latitude, double *longitude,
+                                   double *altitude) const {
+  GetMutex();
+  *latitude = this->latitude;
+  *longitude = this->longitude;
+  *altitude = this->altitude;
+  ReleaseMutex();
+}
+
+void GeoCoordinate::CopyDatas(char *ptr) const { Warn("a ecrire"); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/GeoCoordinate.h
===================================================================
--- tags/latest/lib/FlairCore/src/GeoCoordinate.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/GeoCoordinate.h	(revision 209)
@@ -0,0 +1,116 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GeoCoordinate.h
+ * \brief Class defining a point by its lla coordinates
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/07/29
+ * \version 4.0
+ */
+#ifndef GEOCOORDINATE_H
+#define GEOCOORDINATE_H
+
+#include <io_data.h>
+
+namespace flair {
+namespace core {
+
+/*! \class GeoCoordinate
+*
+* \brief Class defining a point by its lla coordinates
+*/
+class GeoCoordinate : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    size_t GetSize() const {
+      return sizeof(latitude) + sizeof(longitude) + sizeof(altitude);
+    }
+    std::string GetDescription() const { return "lla"; }
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct GeoCoordinate using values from another class.
+  *
+  * \param parent parent
+  * \param name name
+  * \param point class to copy
+  * \param n number of samples
+  */
+  GeoCoordinate(const Object *parent, std::string name,
+                const GeoCoordinate *point, int n = 1);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct GeoCoordinate using specified values.
+  *
+  * \param parent parent
+  * \param name name
+  * \param latitude latitude
+  * \param longitude longitude
+  * \param altitude altitude
+  * \param n number of samples
+  */
+  GeoCoordinate(const Object *parent, std::string name, double latitude,
+                double longitude, double altitude, int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~GeoCoordinate();
+
+  /*!
+  * \brief Copy
+  *
+  * \param point class to copy
+  */
+  void CopyFrom(const GeoCoordinate *point);
+
+  /*!
+  * \brief Set coordinates
+  *
+  * \param latitude latitude
+  * \param longitude longitude
+  * \param altitude altitude
+  */
+  void SetCoordinates(double latitude, double longitude, double altitude);
+
+  /*!
+  * \brief Get coordinates
+  *
+  * \param latitude latitude
+  * \param longitude longitude
+  * \param altitude altitude
+  */
+  void GetCoordinates(double *latitude, double *longitude,
+                      double *altitude) const;
+
+  Type const &GetDataType() const { return dataType; }
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *ptr) const;
+
+  double latitude;
+  double longitude;
+  double altitude;
+  Type dataType;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // GEOCOORDINATE_H
Index: tags/latest/lib/FlairCore/src/GpsData.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/GpsData.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/GpsData.cpp	(revision 209)
@@ -0,0 +1,326 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/07/01
+//  filename:   GpsData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class defining gps datas
+//
+//
+/*********************************************************************/
+
+#include "GpsData.h"
+#include "Euler.h"
+#include "IODataElement.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+/*! \class GpsDataElement
+    */
+class GpsDataElement : public IODataElement {
+public:
+  GpsDataElement(const GpsData *inGpsdata, string name,
+                 GpsData::PlotableData_t inPlotableData)
+      : IODataElement(inGpsdata, name) {
+    gpsdata = inGpsdata;
+    plotableData = inPlotableData;
+
+    switch (plotableData) {
+    case GpsData::Latitude:
+    case GpsData::Longitude:
+      size = 8;
+      break;
+    case GpsData::Altitude:
+    case GpsData::East:
+    case GpsData::North:
+    case GpsData::Up:
+    case GpsData::EastVelocity:
+    case GpsData::NorthVelocity:
+    case GpsData::Pdop:
+    case GpsData::Hdop:
+    case GpsData::Vdop:
+      size=4;
+      break;
+    case GpsData::NumberOfSatellites:
+    case GpsData::FixQuality:
+      size=1;
+      break;
+    }
+  }
+
+  ~GpsDataElement() {}
+
+  void CopyData(char *dst) const {
+    double latitude,longitude;
+    float altitude,east,north,up,eastVelocity,northVelocity,pDop,hDop,vDop;
+
+    gpsdata->GetLla(latitude,longitude,altitude);
+    uint8_t numberOfSatellites=gpsdata->GetNumberOfSatellites();
+    GpsData::FixQuality_t fixQuality=gpsdata->GetFixQuality();
+    gpsdata->GetEnu(east,north,up);
+    gpsdata->GetVelocity(eastVelocity,northVelocity);
+    gpsdata->GetDop(pDop,hDop,vDop);
+
+    switch (plotableData) {
+    case GpsData::Latitude:
+      memcpy(dst, &latitude, sizeof(latitude));
+      break;
+    case GpsData::Longitude:
+      memcpy(dst, &longitude, sizeof(longitude));
+      break;
+    case GpsData::Altitude:
+      memcpy(dst, &altitude, sizeof(altitude));
+      break;
+    case GpsData::NumberOfSatellites:
+      memcpy(dst, &numberOfSatellites, sizeof(numberOfSatellites));
+      break;
+    case GpsData::FixQuality:
+      memcpy(dst, &fixQuality, sizeof(fixQuality));
+      break;
+    case GpsData::East:
+      memcpy(dst, &east, sizeof(east));
+      break;
+    case GpsData::North:
+      memcpy(dst, &north, sizeof(north));
+      break;
+    case GpsData::Up:
+      memcpy(dst, &up, sizeof(up));
+      break;
+     case GpsData::EastVelocity:
+      memcpy(dst, &eastVelocity, sizeof(eastVelocity));
+      break;
+    case GpsData::NorthVelocity:
+      memcpy(dst, &northVelocity, sizeof(northVelocity));
+      break;
+    case GpsData::Pdop:
+      memcpy(dst, &pDop, sizeof(pDop));
+      break;
+    case GpsData::Hdop:
+      memcpy(dst, &hDop, sizeof(hDop));
+      break;
+    case GpsData::Vdop:
+      memcpy(dst, &vDop, sizeof(vDop));
+      break;
+    default:
+      gpsdata->Err("data type unavailable.\n");
+      break;
+    }
+  }
+
+  DataType const &GetDataType(void) const {
+    switch (plotableData) {
+    case GpsData::Latitude:
+    case GpsData::Longitude:
+      return doubleType;
+      break;
+    case GpsData::Altitude:
+    case GpsData::East:
+    case GpsData::North:
+    case GpsData::Up:
+    case GpsData::EastVelocity:
+    case GpsData::NorthVelocity:
+    case GpsData::Pdop:
+    case GpsData::Hdop:
+    case GpsData::Vdop:
+      return floatType;
+      break;
+    case GpsData::NumberOfSatellites:
+    case GpsData::FixQuality:
+      return UInt8Type;
+      break;
+    default:
+      return dummyType;
+    }
+  }
+
+private:
+  const GpsData *gpsdata;
+  GpsData::PlotableData_t plotableData;
+};
+
+GpsData::GpsData(const Object *parent, std::string name, int n)
+    : io_data(parent, name, n), dataType() {
+  if (n > 1)
+    Warn("n>1 not supported\n");
+
+  AppendLogDescription("latitude", doubleType);
+  AppendLogDescription("longitude", doubleType);
+  AppendLogDescription("altitude", floatType);
+  AppendLogDescription("nb_sat",UInt8Type);
+  AppendLogDescription("fix quality",UInt8Type);
+  AppendLogDescription("east", floatType);
+  AppendLogDescription("north", floatType);
+  AppendLogDescription("up", floatType);
+  AppendLogDescription("east velocity", floatType);
+  AppendLogDescription("north velocity", floatType);
+  AppendLogDescription("pdop", floatType);
+  AppendLogDescription("hdop", floatType);
+  AppendLogDescription("vdop", floatType);
+
+  numberOfSatellites=0;
+  fixQuality=FixQuality_t::Invalid;
+}
+
+GpsData::~GpsData() {}
+
+void GpsData::GetLla(double &outLatitude, double &outLongitude, float &outAltitude) const {
+  GetMutex();
+  outLatitude=latitude;
+  outLongitude=longitude;
+  outAltitude=altitude;
+  ReleaseMutex();
+}
+
+void GpsData::SetLla(double inLatitude,double inLongitude,float inAltitude) {
+  GetMutex();
+  latitude=inLatitude;
+  longitude=inLongitude;
+  altitude=inAltitude;
+  ReleaseMutex();
+}
+
+void GpsData::GetEnu(float &outEast, float &outNorth,float &outUp) const {
+  GetMutex();
+  outEast=east;
+  outNorth=north;
+  outUp=up;
+  ReleaseMutex();
+}
+
+void GpsData::SetEnu(float inEast, float inNorth,float inUp) {
+  GetMutex();
+  east=inEast;
+  north=inNorth;
+  up=inUp;
+  ReleaseMutex();
+}
+
+
+void GpsData::GetVelocity(float &outEastVelocity, float &outNorthVelocity) const {
+  GetMutex();
+  outEastVelocity=eastVelocity;
+  outNorthVelocity=northVelocity;
+  ReleaseMutex();
+}
+
+void GpsData::SetVelocity(float inEastVelocity, float inNorthVelocity) {
+  GetMutex();
+  eastVelocity=inEastVelocity;
+  northVelocity=inNorthVelocity;
+  ReleaseMutex();
+}
+
+uint8_t GpsData::GetNumberOfSatellites(void) const {
+  return numberOfSatellites;
+}
+
+void GpsData::SetNumberOfSatellites(uint8_t inNumberOfSatellites) {
+  numberOfSatellites=inNumberOfSatellites;
+}
+
+GpsData::FixQuality_t GpsData::GetFixQuality(void) const {
+  return fixQuality;
+}
+
+void GpsData::SetFixQuality(FixQuality_t inFixQuality) {
+  fixQuality=inFixQuality;
+}
+
+void GpsData::GetDop(float &inPdop, float &inHdop,float &inVdop) const {
+  inPdop=pDop;
+  inHdop=hDop;
+  inVdop=vDop;
+}
+
+void GpsData::SetDop(float inPdop, float inHdop,float inVdop) {
+  pDop=inPdop;
+  hDop=inHdop;
+  vDop=inVdop;
+}
+  
+IODataElement *GpsData::Element(PlotableData_t data_type) const {
+  string name;
+  switch (data_type) {
+  case GpsData::Latitude:
+    name = "Latitude";
+    break;
+  case GpsData::Longitude:
+    name = "Longitude";
+    break;
+  case GpsData::Altitude:
+    name = "Altitude";
+    break;
+  case GpsData::NumberOfSatellites:
+    name = "NumberOfSatellites";
+    break;
+  case GpsData::FixQuality:
+    name = "FixQuality";
+    break;
+  case GpsData::East:
+    name = "East";
+    break;
+  case GpsData::North:
+    name = "North";
+    break;
+  case GpsData::Up:
+    name = "Up";
+    break;
+  case GpsData::EastVelocity:
+    name = "EastVelocity";
+    break;
+  case GpsData::NorthVelocity:
+    name = "NorthVelocity";
+    break;
+  case GpsData::Pdop:
+    name = "Pdop";
+    break;
+  case GpsData::Hdop:
+    name = "Hdop";
+    break;
+  case GpsData::Vdop:
+    name = "Vdop";
+    break;
+  }
+
+  return new GpsDataElement(this, name, data_type);
+}
+
+void GpsData::CopyDatas(char *dst) const {
+  GetMutex();
+
+  Queue(&dst, &latitude, sizeof(latitude));
+  Queue(&dst, &longitude, sizeof(longitude));
+  Queue(&dst, &altitude, sizeof(altitude));
+  Queue(&dst, &numberOfSatellites, sizeof(numberOfSatellites));
+  Queue(&dst, &fixQuality, sizeof(FixQuality_t));
+  Queue(&dst, &east, sizeof(east));
+  Queue(&dst, &north, sizeof(north));
+  Queue(&dst, &up, sizeof(up));
+  Queue(&dst, &eastVelocity, sizeof(eastVelocity));
+  Queue(&dst, &northVelocity, sizeof(northVelocity));
+  Queue(&dst, &pDop, sizeof(pDop));
+  Queue(&dst, &hDop, sizeof(hDop));
+  Queue(&dst, &vDop, sizeof(vDop));
+
+  ReleaseMutex();
+}
+
+void GpsData::Queue(char **dst, const void *src, size_t size) const {
+  memcpy(*dst, src, size);
+  *dst += size;
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/GpsData.h
===================================================================
--- tags/latest/lib/FlairCore/src/GpsData.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/GpsData.h	(revision 209)
@@ -0,0 +1,270 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GpsData.h
+ * \brief Class defining gps datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/07/01
+ * \version 4.0
+ */
+#ifndef GPSDATA_H
+#define GPSDATA_H
+
+#include <io_data.h>
+
+namespace flair {
+namespace core {
+
+  class IODataElement;
+
+/*! \class GpsData
+*
+* \brief Class defining gps datas
+*
+* GPS datas consist of
+*
+*
+*/
+class GpsData : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    Type(void){}
+    std::string GetDescription() const { return "gps data"; }
+    size_t GetSize() const {
+      size_t size = 0;
+      size += 2*doubleType.GetSize(); // Latitude, Longitude
+      size += floatType.GetSize(); // Altitude
+      size += UInt8Type.GetSize(); // NumberOfSatellites
+      size += UInt8Type.GetSize(); // FixQuality_t
+      size += 5*floatType.GetSize();//e,n,u,ve,vn
+      size += 3*floatType.GetSize();//pdop,hdop,vdop
+      return size;
+    }
+
+  private:
+  };
+
+  /*!
+  \enum PlotableData_t
+  \brief Datas wich can be plotted in a DataPlot1D
+  */
+  typedef enum {
+    Latitude /*! latitude in degrees */,
+    Longitude /*! longitude in degrees */,
+    Altitude /*! altitude */,
+    NumberOfSatellites /*! number of satellites */,
+    FixQuality /*! fix quality */,
+    East /*! east */,
+    North /*! north */,
+    Up /*! up */,
+    EastVelocity /*! east velocity*/,
+    NorthVelocity /*! north velocity*/,
+    Pdop /* dilution of precision*/,
+    Hdop /* horizontal dilution of precision*/,
+    Vdop /* vertical dilution of precision*/,
+  } PlotableData_t;
+
+  /*!
+  \enum FixQuality_t
+  \brief Fix qualty indicators
+  */
+  enum class FixQuality_t : uint8_t {
+    Invalid = 0,    /*!< invalid */
+    Gps = 1,        /*!< Gps */
+    DGps = 2,       /*!< Differential Gps */
+    Pps = 3,        /*!< Pps */
+    Rtk = 4,        /*!< RTK */
+    RtkFloat = 5,   /*!< RTK float */
+    Estimated = 6,  /*!< Estimated */
+    Manual = 7,     /*!< Manual */
+    Simulation = 8, /*!< Simulation */
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing GPS datas. \n
+  *
+  * \param parent parent
+  * \param name name
+  * \param n number of samples
+  */
+  GpsData(const Object *parent, std::string name = "", int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~GpsData();
+
+  /*!
+  * \brief Element
+  *
+  * Get a pointer to a specific element. This pointer can be used for plotting.
+  *
+  * \param data_type data type
+  *
+  * \return pointer to the element
+  */
+  IODataElement *Element(PlotableData_t data_type) const;
+
+  /*!
+  * \brief Get latitude, longitude and altitude
+  *
+  * This method is mutex protected.
+  *
+  * \param latitude latitude
+  * \param longitude longitude
+  * \param altitude altitude
+  *
+  */
+  void GetLla(double &latitude, double &longitude,
+                          float &altitude) const;
+
+  /*!
+  * \brief Set latitude, longitude and altitude
+  *
+  * This method is mutex protected.
+  *
+  * \param latitude latitude
+  * \param longitude longitude
+  * \param altitude altitude
+  *
+  */
+  void SetLla(double latitude,double longitude,
+                          float altitude);
+
+
+  /*!
+  * \brief Get east, north and up
+  *
+  * This method is mutex protected.
+  *
+  * \param east east
+  * \param north north
+  * \param up up
+  *
+  */
+  void GetEnu(float &east, float &north,
+                          float &up) const;
+
+  /*!
+  * \brief Set east, north and up
+  *
+  * This method is mutex protected.
+  *
+  * \param east east
+  * \param north north
+  * \param up up
+  *
+  */
+  void SetEnu(float east, float north,
+                          float up);
+
+  /*!
+  * \brief Get east and north velocities
+  *
+  * This method is mutex protected.
+  *
+  * \param eastVelocity east velocity
+  * \param northVelocity north velocity
+  *
+  */
+  void GetVelocity(float &eastVelocity, float &northVelocity) const;
+
+  /*!
+  * \brief Set east and north velocities
+  *
+  * This method is mutex protected.
+  *
+  * \param eastVelocity east velocity
+  * \param northVelocity north velocity
+  *
+  */
+  void SetVelocity(float eastVelocity, float northVelocity);
+
+  /*!
+  * \brief Get number of satellites
+  *
+  * \return number of satellites
+  *
+  */
+  uint8_t GetNumberOfSatellites(void) const;
+
+  /*!
+  * \brief Set number of satellites
+  *
+  * \param numberOfSatellites number of satellites
+  *
+  */
+  void SetNumberOfSatellites(uint8_t numberOfSatellites);
+
+  /*!
+  * \brief Get fix quality
+  *
+  * \return fix quality
+  *
+  */
+  FixQuality_t GetFixQuality(void) const;
+
+  /*!
+  * \brief Set fix quality
+  *
+  * \param fixQuality fix quality
+  *
+  */
+  void SetFixQuality(FixQuality_t fixQuality);
+  
+  /*!
+  * \brief Get dilution of precision
+  *
+  * This method is mutex protected.
+  *
+  * \param pDop dilution of precision
+  * \param hDop horizontal dilution of precision
+  * \param vDop vertical dilution of precision
+  *
+  */
+  void GetDop(float &pDop, float &hDop,float &vDop) const;
+
+  /*!
+  * \brief Set dilution of precision
+  *
+  * This method is mutex protected.
+  *
+  * \param pDop dilution of precision
+  * \param hDop horizontal dilution of precision
+  * \param vDop vertical dilution of precision
+  *
+  */
+  void SetDop(float pDop, float hDop,float vDop);
+
+  Type const &GetDataType() const { return dataType; }
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+
+  void Queue(char **dst, const void *src, size_t size) const;
+  Type dataType;
+  double latitude,longitude;
+  float altitude;
+  uint8_t numberOfSatellites;
+  FixQuality_t fixQuality;
+  float east,north,up,eastVelocity,northVelocity,pDop,hDop,vDop;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // GPSDATA_H
Index: tags/latest/lib/FlairCore/src/GridLayout.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/GridLayout.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/GridLayout.cpp	(revision 209)
@@ -0,0 +1,37 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   GridLayout.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QGridLayout on the ground station
+//
+//
+/*********************************************************************/
+#include "GridLayout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+GridLayout::GridLayout(const LayoutPosition *position, string name)
+    : Layout(position->getLayout(), name, "GridLayout") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  SendXml();
+
+  delete position;
+}
+
+GridLayout::~GridLayout() {}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/GridLayout.h
===================================================================
--- tags/latest/lib/FlairCore/src/GridLayout.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/GridLayout.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GridLayout.h
+ * \brief Class displaying a QGridLayout on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef GRIDLAYOUT_H
+#define GRIDLAYOUT_H
+
+#include <Layout.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class GridLayout
+*
+* \brief Class displaying a QGridLayout on the ground station
+*
+*/
+class GridLayout : public Layout {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QCheckBox at given position. \n
+  * The GridLayout will automatically be child of position->getLayout() Layout.
+  After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param parent parent
+  * \param name name
+
+  */
+  GridLayout(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~GridLayout();
+
+private:
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // GRIDLAYOUT_H
Index: tags/latest/lib/FlairCore/src/GroupBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/GroupBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/GroupBox.cpp	(revision 209)
@@ -0,0 +1,37 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   GroupBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QGroupBox on the ground station
+//
+//
+/*********************************************************************/
+#include "GroupBox.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+GroupBox::GroupBox(const LayoutPosition *position, string name)
+    : Layout(position->getLayout(), name, "GroupBox") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  SendXml();
+
+  delete position;
+}
+
+GroupBox::~GroupBox() {}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/GroupBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/GroupBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/GroupBox.h	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GroupBox.h
+ * \brief Class displaying a QGroupBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef GROUPBOX_H
+#define GROUPBOX_H
+
+#include <Layout.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class GroupBox
+*
+* \brief Class displaying a QGroupBox on the ground station
+*
+*/
+class GroupBox : public Layout {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QGroupBox at given position. \n
+  * The GroupBox will automatically be child of position->getLayout() Layout.
+  *After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position
+  * \param name name
+  */
+  GroupBox(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~GroupBox();
+
+private:
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // GROUPBOX_H
Index: tags/latest/lib/FlairCore/src/I2cPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/I2cPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/I2cPort.h	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file I2cPort.h
+ * \brief Base class for i2c port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/24
+ * \version 4.0
+ */
+
+#ifndef I2CPORT_H
+#define I2CPORT_H
+
+#include <Mutex.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+/*! \class I2cPort
+*
+* \brief Base class for i2c port
+*
+* This class has a Mutex which must be used to protect access to the port in
+*case
+* that more than one Thread is using it. Lock the Mutex before any communication
+*(including SetSlave)
+* and release it after communication.
+*/
+class I2cPort : public Mutex {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an i2c port.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  I2cPort(const Object *parent, std::string name) : Mutex(parent, name) {}
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~I2cPort(){};
+
+  /*!
+  * \brief Set slave's address
+  *
+  * This function need to be called before any communication.
+  *
+  * \param address slave's address
+  */
+  virtual int SetSlave(uint16_t address) = 0;
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  virtual ssize_t Write(const void *buf, size_t nbyte) = 0;
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  virtual ssize_t Read(void *buf, size_t nbyte) = 0;
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting an ACK from the slave.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  virtual void SetRxTimeout(Time timeout_ns) = 0;
+
+  /*!
+  * \brief Set TX timeout
+  *
+  * Timeout for waiting an ACK from the slave.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  virtual void SetTxTimeout(Time timeout_ns) = 0;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // I2CPORT_H
Index: tags/latest/lib/FlairCore/src/IODataElement.h
===================================================================
--- tags/latest/lib/FlairCore/src/IODataElement.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/IODataElement.h	(revision 209)
@@ -0,0 +1,60 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file IODataElement.h
+ * \brief Abstract class for accessing an element of an io_data.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/11/26
+ * \version 4.0
+ */
+
+#ifndef IODATAELEMENT_H
+#define IODATAELEMENT_H
+
+#include "io_data.h"
+
+namespace flair {
+namespace core {
+
+class DataType;
+
+/*! \class IODataElement
+*
+* \brief Abstract class for accessing an element of an io_data.
+*/
+class IODataElement : public Object {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an IODataElement. \n
+  *
+  */
+  IODataElement(const io_data *parent, std::string name)
+      : Object(parent, name) {
+    this->parent = parent;
+  }
+  size_t Size() const { return size; }
+
+  virtual void CopyData(char *dst) const = 0;
+
+  /*!
+  * \brief DataType
+  *
+  * \return type of data
+  */
+  virtual DataType const &GetDataType(void) const = 0;
+
+protected:
+  size_t size;
+
+private:
+  const io_data *parent;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IODATAELEMENT_H
Index: tags/latest/lib/FlairCore/src/IODevice.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/IODevice.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/IODevice.cpp	(revision 209)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   IODevice.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for input/ouput system
+//
+//
+/*********************************************************************/
+
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "io_data.h"
+#include "io_data_impl.h"
+#include "FrameworkManager.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+IODevice::IODevice(const Object* parent,string name): Object(parent,name,"IODevice") {
+    pimpl_=new IODevice_impl(this);
+}
+
+IODevice::~IODevice() { delete pimpl_; }
+
+void IODevice::AddDeviceToLog(const IODevice *device) {
+  pimpl_->AddDeviceToLog(device);
+}
+
+void IODevice::OutputToShMem(bool enabled) { pimpl_->OutputToShMem(enabled); }
+
+void IODevice::ProcessUpdate(io_data *data) {
+  if (data != NULL)
+    data->pimpl_->SetConsistent(true);
+
+  for (size_t i = 0; i < TypeChilds()->size(); i++) {
+    ((IODevice *)TypeChilds()->at(i))->UpdateFrom(data);
+  }
+
+  if(data!=NULL) {
+    if(getFrameworkManager()->IsLogging()==true) pimpl_->WriteLog(data->DataTime());
+    data->pimpl_->Circle();
+  }
+
+  pimpl_->WriteToShMem();
+
+  pimpl_->ResumeThread();
+}
+
+void IODevice::AddDataToLog(const io_data *data) { pimpl_->AddDataToLog(data); }
+
+DataType const &IODevice::GetInputDataType() const { return dummyType; }
+
+DataType const &IODevice::GetOutputDataType() const { return dummyType; }
+
+void IODevice::SetIsReady(bool status) {
+  pimpl_->SetIsReady(status);
+}
+
+bool IODevice::IsReady(void) const {
+  return pimpl_->IsReady();
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/IODevice.h
===================================================================
--- tags/latest/lib/FlairCore/src/IODevice.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/IODevice.h	(revision 209)
@@ -0,0 +1,172 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+// ---
+/*!
+ * \file IODevice.h
+ * \brief Abstract class for input/ouput system
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef IO_DEVICE_H
+#define IO_DEVICE_H
+
+#include <Object.h>
+
+class IODevice_impl;
+class Thread_impl;
+class FrameworkManager_impl;
+
+namespace flair {
+namespace core {
+
+class io_data;
+class DataType;
+
+/*! \class IODevice
+*
+* \brief Abstract class for input/ouput system
+*
+* An input/output system is generally used to describe a sensor, an actuator or
+*a filter. \n
+* These systems can be linked (for exemple a sensor with a filter), when an
+*IODevice
+* is created with a parent of type IODevice.
+* In this case, an update of the parent's data will call an update
+* of the child's data (for exemple when a sensor gets new datas, a filter is
+*automatically called). \n
+* Output of this object can also be sent to a shared memory using the
+*OutputToShMem method; in order to use it with an
+* external program.
+*/
+class IODevice : public Object {
+  friend class ::IODevice_impl;
+  friend class ::Thread_impl;
+  friend class ::FrameworkManager_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an IODevice of Object's type "IODevice" (see Object::ObjectType).
+  *\n
+  * If parent's Object::ObjectType is also "IODevice", this IODevice will be
+  *linked to its parent
+  * (see ProcessUpdate()).
+  *
+  * \param parent parent
+  * \param name name
+  */
+  IODevice(const Object *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  virtual ~IODevice();
+
+  /*!
+  * \brief Add an IODevice to the logs
+  *
+  * The IODevice will be automatically logged among this IODevice logs,
+  * if logging is enabled (see SetDataToLog(), FrameworkManager::StartLog
+  * and FrameworkManager::AddDeviceToLog). \n
+  * Logging happens when ProcessUpdate() is called. \n
+  * Note that when an IODevice is just added for logs (ie. no parent/child
+  * link between the two IODevice),
+  * UpdateFrom() is not automatically called.
+  *
+  * \param device IODevice to log
+  */
+  void AddDeviceToLog(const IODevice *device);
+
+  /*!
+  * \brief Add an io_data to the log
+  *
+  * The io_data will be automatically logged if enabled (see
+  *FrameworkManager::StartLog
+  * and FrameworkManager::AddDeviceToLog),
+  * during call to ProcessUpdate().
+  *
+  * \param data data to log
+  */
+  void AddDataToLog(const io_data *data);
+
+  /*!
+  * \brief Send the output to a shared memory
+  *
+  * Use this method to output log datas to a shared memory.
+  * This can be usefull to get datas from an external progam. \n
+  * Output happens when ProcessUpdate() is called. \n
+  * The name and the structure of the shared memory will be displayed when
+  * this method is called with true as argument. \n
+  * By default it is not enabled.
+  *
+  *
+  * \param enabled true to enable the output, false otherwise
+  */
+  void OutputToShMem(bool enabled);
+  
+  /*!
+  * \brief is device ready
+  *
+  * Use it check if a device is ready or not.
+  * See also setIsReady.
+  *
+  * \return true if device is ready
+  */
+  bool IsReady(void) const;
+
+  // TODO: these 2 method should be pure virtual
+  virtual DataType const &GetInputDataType() const;
+  virtual DataType const &GetOutputDataType() const;
+
+  protected:
+    /*!
+    * \brief Process the childs of type IODevice, and log if needed
+    *
+    * This method must be called after computing datas;
+    * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n
+    * It will call UpdateFrom methods of each child of type IODevice,
+    * and log all datas (this IODevice and its childs)
+    * if logging is enabled (see SetDataToLog(), AddDeviceToLog(),
+    * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n
+    * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed.
+    *
+    * \param data data to process
+    */
+    void ProcessUpdate(io_data* data);
+    
+    /*!
+    * \brief set is ready
+    *
+    * Sets if the device is ready or not. By default the IODevice is not ready.\n
+    * See also isReady.
+    *
+    * \param status status
+    */
+    void SetIsReady(bool status);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * This method is automatically called by ProcessUpdate()
+  * of the Object::Parent's if its Object::ObjectType is "IODevice". \n
+  * This method must be reimplemented, in order to process the data from the
+  *parent.
+  *
+  * \param data data from the parent to process
+  */
+  virtual void UpdateFrom(const io_data *data) = 0;
+
+  class IODevice_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IO_DEVICE_H
Index: tags/latest/lib/FlairCore/src/IODevice_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/IODevice_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/IODevice_impl.cpp	(revision 209)
@@ -0,0 +1,243 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   IODevice.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base avec entrees sorties
+//
+//
+/*********************************************************************/
+
+#include "IODevice_impl.h"
+#include "IODevice.h"
+#include "io_data.h"
+#include "io_data_impl.h"
+#include "Thread.h"
+#include "Mutex.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "SharedMem.h"
+#include <string.h>
+
+using std::string;
+using std::fstream;
+using namespace flair::core;
+
+IODevice_impl::IODevice_impl(const IODevice *self) {
+  this->self = self;
+  thread_to_wake = NULL;
+  wake_mutex = new Mutex(self);
+  framework_impl = ::getFrameworkManagerImpl();
+  framework = getFrameworkManager();
+  tobelogged = false;
+  outputtoshm = false;
+  isReady=false;
+}
+
+IODevice_impl::~IODevice_impl() {}
+
+void IODevice_impl::OutputToShMem(bool enabled) {
+  if (framework->IsLogging()) {
+    self->Err("impossible while logging\n");
+  } else {
+    if (LogSize() == 0) {
+      self->Warn("log size is null, not enabling output to shared memory.");
+      return;
+    }
+
+    if (enabled) {
+      string dev_name =
+          getFrameworkManager()->ObjectName() + "-" + self->ObjectName();
+      shmem = new SharedMem(self, dev_name.c_str(), LogSize());
+      outputtoshm = true;
+
+      Printf("Created %s shared memory for object %s; size: %i\n",
+             dev_name.c_str(), self->ObjectName().c_str(), LogSize());
+      PrintLogsDescriptors();
+    } else {
+      outputtoshm = false;
+      delete shmem;
+    }
+  }
+}
+
+void IODevice_impl::PrintLogsDescriptors(void) {
+  // own logs
+  for (size_t i = 0; i < datasToLog.size(); i++)
+    datasToLog.at(i)->pimpl_->PrintLogDescriptor();
+  // childs logs
+  for (size_t i = 0; i < self->TypeChilds()->size(); i++)
+    ((IODevice *)self->TypeChilds()->at(i))->pimpl_->PrintLogsDescriptors();
+  // manually added logs
+  for (size_t i = 0; i < devicesToLog.size(); i++)
+    devicesToLog.at(i)->pimpl_->PrintLogsDescriptors();
+}
+
+void IODevice_impl::WriteToShMem(void) {
+  if (outputtoshm) {
+    size_t size = LogSize();
+
+    char *buf = framework_impl->GetBuffer(size);
+    char *buf_orig = buf;
+    if (buf == NULL) {
+      self->Err("err GetBuffer\n");
+      return;
+    }
+
+    AppendLog(&buf);
+
+    shmem->Write(buf_orig, size);
+    framework_impl->ReleaseBuffer(buf_orig);
+  }
+}
+
+void IODevice_impl::AddDeviceToLog(const IODevice *device) {
+  if (framework->IsLogging()) {
+    self->Err("impossible while logging\n");
+  } else {
+    devicesToLog.push_back(device);
+  }
+}
+
+bool IODevice_impl::IsSetToBeLogged(void) const{
+	return tobelogged;
+}
+
+void IODevice_impl::SetToBeLogged(void) {
+  if (!tobelogged) {
+    tobelogged = true;
+  } else {
+    self->Warn("already added to log\n");
+  }
+}
+
+void IODevice_impl::WriteLogsDescriptors(fstream &desc_file, int *index) {
+  //Printf("WriteLogsDescriptors %s\n",self->ObjectName().c_str());
+	// own descriptor
+  for (size_t i = 0; i < datasToLog.size(); i++)
+    datasToLog.at(i)->pimpl_->WriteLogDescriptor(desc_file, index);
+  // childs descriptors
+  for (size_t i = 0; i < self->TypeChilds()->size(); i++)
+    ((IODevice *)self->TypeChilds()->at(i))
+        ->pimpl_->WriteLogsDescriptors(desc_file, index);
+  // manually added logs
+  for (size_t i = 0; i < devicesToLog.size(); i++)
+    devicesToLog.at(i)->pimpl_->WriteLogsDescriptors(desc_file, index);
+	//Printf("WriteLogsDescriptors %s ok\n",self->ObjectName().c_str());
+}
+
+void IODevice_impl::ResumeThread(void) {
+  wake_mutex->GetMutex();
+  if (thread_to_wake != NULL) {
+    thread_to_wake->Resume();
+    thread_to_wake = NULL;
+  }
+  wake_mutex->ReleaseMutex();
+}
+
+void IODevice_impl::AddDataToLog(const io_data *data) {
+  if (framework->IsLogging()) {
+    self->Err("impossible while logging\n");
+  } else {
+    datasToLog.push_back(data);
+  }
+}
+
+size_t IODevice_impl::LogSize() const {
+  size_t value = 0;
+
+  for (size_t i = 0; i < datasToLog.size(); i++) {
+    value += datasToLog.at(i)->GetDataType().GetSize();
+  }
+
+  // childs logs
+  for (size_t i = 0; i < self->TypeChilds()->size(); i++) {
+    value += ((IODevice *)self->TypeChilds()->at(i))->pimpl_->LogSize();
+  }
+  // manually added logs
+  for (size_t i = 0; i < devicesToLog.size(); i++) {
+    value += devicesToLog.at(i)->pimpl_->LogSize();
+  }
+
+  return value;
+}
+
+void IODevice_impl::WriteLog(Time time) {
+  if (tobelogged == false)
+    return;
+
+  size_t size = LogSize();
+
+  char *buf = framework_impl->GetBuffer(
+      sizeof(FrameworkManager_impl::log_header_t) + size);
+  char *buf_orig = buf;
+  if (buf == NULL) {
+    self->Err("err GetBuffer\n");
+    return;
+  }
+
+  FrameworkManager_impl::log_header_t header;
+  header.device = self;
+  header.size = size;
+  header.time = time;
+
+  memcpy(buf, &header, sizeof(FrameworkManager_impl::log_header_t));
+  buf += sizeof(FrameworkManager_impl::log_header_t);
+  AppendLog(&buf);
+
+  framework_impl->WriteLog(buf_orig,
+                           sizeof(FrameworkManager_impl::log_header_t) + size);
+  framework_impl->ReleaseBuffer(buf_orig);
+}
+
+void IODevice_impl::AppendLog(char **ptr) {
+   //Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr);
+
+  // copy state to buf
+  for (size_t i = 0; i < datasToLog.size(); i++) {
+    // printf("copy %s\n",datasToLog.at(i)->ObjectName().c_str());
+    datasToLog.at(i)->CopyDatas(*ptr);
+    (*ptr) += datasToLog.at(i)->GetDataType().GetSize();
+  }
+
+  // copy linked states to buf
+  for (size_t i = 0; i < self->TypeChilds()->size(); i++) {
+    ((IODevice *)self->TypeChilds()->at(i))->pimpl_->AppendLog(ptr);
+  }
+  // copy manually added logs to buf
+  for (size_t i = 0; i < devicesToLog.size(); i++) {
+    devicesToLog.at(i)->pimpl_->AppendLog(ptr);
+    // devices.at(i)->DataToLog()->CopyDatas(*ptr);
+    //(*ptr)+=devices.at(i)->DataToLog()->Size();
+  }
+  // Printf("AppendLog %s ok\n",self->ObjectName().c_str());
+}
+
+int IODevice_impl::SetToWake(const Thread *thread) {
+  int status = 0;
+
+  wake_mutex->GetMutex();
+  if (thread_to_wake == NULL) {
+    thread_to_wake = (Thread *)thread;
+  } else {
+    status = -1;
+  }
+  wake_mutex->ReleaseMutex();
+
+  return status;
+}
+
+void IODevice_impl::SetIsReady(bool status) {
+  isReady=status;
+}
+
+bool IODevice_impl::IsReady(void) const {
+  return isReady;
+}
Index: tags/latest/lib/FlairCore/src/ImuData.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ImuData.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ImuData.cpp	(revision 209)
@@ -0,0 +1,252 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/15
+//  filename:   ImuData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class defining imu datas
+//
+//
+/*********************************************************************/
+
+#include "ImuData.h"
+#include "Euler.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+/*! \class ImuDataElement
+    */
+class ImuDataElement : public IODataElement {
+public:
+  ImuDataElement(const ImuData *inImudata, string name,
+                 ImuData::PlotableData_t inPlotableData)
+      : IODataElement(inImudata, name) {
+    imudata = inImudata;
+    plotableData = inPlotableData;
+
+    size = 4;
+  }
+
+  ~ImuDataElement() {}
+
+  void CopyData(char *dst) const {
+    float data;
+    Vector3Df rawAcc = imudata->GetRawAcc();
+    Vector3Df rawMag = imudata->GetRawMag();
+    Vector3Df rawGyr = imudata->GetRawGyr();
+    switch (plotableData) {
+    case ImuData::RawAx:
+      data = rawAcc.x;
+      break;
+    case ImuData::RawAy:
+      data = rawAcc.y;
+      break;
+    case ImuData::RawAz:
+      data = rawAcc.z;
+      break;
+    case ImuData::RawGx:
+      data = rawGyr.x;
+      break;
+    case ImuData::RawGy:
+      data = rawGyr.y;
+      break;
+    case ImuData::RawGz:
+      data = rawGyr.z;
+      break;
+    case ImuData::RawGxDeg:
+      data = Euler::ToDegree(rawGyr.x);
+      break;
+    case ImuData::RawGyDeg:
+      data = Euler::ToDegree(rawGyr.y);
+      break;
+    case ImuData::RawGzDeg:
+      data = Euler::ToDegree(rawGyr.z);
+      break;
+    case ImuData::RawMx:
+      data = rawMag.x;
+      break;
+    case ImuData::RawMy:
+      data = rawMag.y;
+      break;
+    case ImuData::RawMz:
+      data = rawMag.z;
+      break;
+    default:
+      imudata->Err("data type unavailable.\n");
+      data = 0;
+      break;
+    }
+
+    memcpy(dst, &data, sizeof(float));
+  }
+
+  FloatType const &GetDataType(void) const { return dataType; }
+
+private:
+  const ImuData *imudata;
+  ImuData::PlotableData_t plotableData;
+  FloatType dataType;
+};
+
+ImuData::ImuData(const Object *parent, std::string name, int n)
+    : io_data(parent, name, n), dataType(floatType) {
+  if (n > 1)
+    Warn("n>1 not supported\n");
+
+  AppendLogDescription("raw_ax", floatType);
+  AppendLogDescription("raw_ay", floatType);
+  AppendLogDescription("raw_az", floatType);
+
+  AppendLogDescription("raw_gx", floatType);
+  AppendLogDescription("raw_gy", floatType);
+  AppendLogDescription("raw_gz", floatType);
+
+  AppendLogDescription("raw_mx", floatType);
+  AppendLogDescription("raw_my", floatType);
+  AppendLogDescription("raw_mz", floatType);
+}
+
+ImuData::~ImuData() {}
+
+Vector3Df ImuData::GetRawAcc(void) const {
+  Vector3Df out;
+  GetMutex();
+  out = rawAcc;
+  ReleaseMutex();
+  return out;
+}
+
+Vector3Df ImuData::GetRawMag(void) const {
+  Vector3Df out;
+  GetMutex();
+  out = rawMag;
+  ReleaseMutex();
+  return out;
+}
+
+Vector3Df ImuData::GetRawGyr(void) const {
+  Vector3Df out;
+  GetMutex();
+  out = rawGyr;
+  ReleaseMutex();
+  return out;
+}
+
+void ImuData::GetRawAccMagAndGyr(Vector3Df &inRawAcc, Vector3Df &inRawMag,
+                                 Vector3Df &inRawGyr) const {
+  GetMutex();
+  inRawAcc = rawAcc;
+  inRawMag = rawMag;
+  inRawGyr = rawGyr;
+  ReleaseMutex();
+}
+
+void ImuData::SetRawAcc(const Vector3Df &inRawAcc) {
+  GetMutex();
+  rawAcc = inRawAcc;
+  ReleaseMutex();
+}
+
+void ImuData::SetRawMag(const Vector3Df &inRawMag) {
+  GetMutex();
+  rawMag = inRawMag;
+  ReleaseMutex();
+}
+
+void ImuData::SetRawGyr(const Vector3Df &inRawGyr) {
+  GetMutex();
+  rawGyr = inRawGyr;
+  ReleaseMutex();
+}
+
+void ImuData::SetRawAccMagAndGyr(const Vector3Df &inRawAcc,
+                                 const Vector3Df &inRawMag,
+                                 const Vector3Df &inRawGyr) {
+  GetMutex();
+  rawAcc = inRawAcc;
+  rawMag = inRawMag;
+  rawGyr = inRawGyr;
+  ReleaseMutex();
+}
+
+IODataElement *ImuData::Element(PlotableData_t data_type) const {
+  string name;
+  switch (data_type) {
+  case ImuData::RawAx:
+    name = "RawAx";
+    break;
+  case ImuData::RawAy:
+    name = "RawAy";
+    break;
+  case ImuData::RawAz:
+    name = "RawAz";
+    break;
+  case ImuData::RawGx:
+    name = "RawGx";
+    break;
+  case ImuData::RawGy:
+    name = "RawGy";
+    break;
+  case ImuData::RawGz:
+    name = "RawGz";
+    break;
+  case ImuData::RawGxDeg:
+    name = "RawGx degree";
+    break;
+  case ImuData::RawGyDeg:
+    name = "RawGy degree";
+    break;
+  case ImuData::RawGzDeg:
+    name = "RawGz degree";
+    break;
+  case ImuData::RawMx:
+    name = "RawMx";
+    break;
+  case ImuData::RawMy:
+    name = "RawMy";
+    break;
+  case ImuData::RawMz:
+    name = "RawMz";
+    break;
+  }
+
+  return new ImuDataElement(this, name, data_type);
+}
+
+void ImuData::CopyDatas(char *dst) const {
+  GetMutex();
+
+  Queue(&dst, &rawAcc.x, sizeof(rawAcc.x));
+  Queue(&dst, &rawAcc.y, sizeof(rawAcc.y));
+  Queue(&dst, &rawAcc.z, sizeof(rawAcc.z));
+
+  Queue(&dst, &rawGyr.x, sizeof(rawGyr.x));
+  Queue(&dst, &rawGyr.y, sizeof(rawGyr.y));
+  Queue(&dst, &rawGyr.z, sizeof(rawGyr.z));
+
+  Queue(&dst, &rawMag.x, sizeof(rawMag.x));
+  Queue(&dst, &rawMag.y, sizeof(rawMag.y));
+  Queue(&dst, &rawMag.z, sizeof(rawMag.z));
+
+  ReleaseMutex();
+}
+
+void ImuData::Queue(char **dst, const void *src, size_t size) const {
+  memcpy(*dst, src, size);
+  *dst += size;
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/ImuData.h
===================================================================
--- tags/latest/lib/FlairCore/src/ImuData.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/ImuData.h	(revision 209)
@@ -0,0 +1,222 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ImuData.h
+ * \brief Class defining IMU datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/15
+ * \version 4.0
+ */
+#ifndef IMUDATA_H
+#define IMUDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+
+namespace flair {
+namespace core {
+
+/*! \class ImuData
+*
+* \brief Class defining IMU datas
+*
+* IMU (inertial measurement unit) datas consist of raw accelerometer values, raw
+*gyrometer values
+* and raw magnetometer values.
+*
+*/
+class ImuData : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    Type(ScalarType const &_elementDataType)
+        : elementDataType(_elementDataType) {}
+    ScalarType const &GetElementDataType() const { return elementDataType; }
+    std::string GetDescription() const { return "imu data"; }
+    size_t GetSize() const {
+      size_t size = 0;
+      size += 3 * elementDataType.GetSize(); // RawAcc
+      size += 3 * elementDataType.GetSize(); // RawGyr
+      size += 3 * elementDataType.GetSize(); // RawMag
+      return size;
+    }
+
+  private:
+    ScalarType const &elementDataType;
+  };
+
+  /*!
+  \enum PlotableData_t
+  \brief Datas wich can be plotted in a DataPlot1D
+  */
+  typedef enum {
+    RawAx /*! x raw accelerometer */,
+    RawAy /*! y raw accelerometer */,
+    RawAz /*! z raw accelerometer */,
+    RawGx /*! x raw gyrometer */,
+    RawGy /*! y raw gyrometer */,
+    RawGz /*! z raw gyrometer */,
+    RawGxDeg /*! x raw gyrometer degree */,
+    RawGyDeg /*! y raw gyrometer degree */,
+    RawGzDeg /*! z raw gyrometer degree */,
+    RawMx /*! x raw magnetometer */,
+    RawMy /*! y raw magnetometer */,
+    RawMz /*! z raw magnetometer */
+  } PlotableData_t;
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing IMU datas. \n
+  *
+  * \param parent parent
+  * \param name name
+  * \param n number of samples
+  */
+  ImuData(const Object *parent, std::string name = "", int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ImuData();
+
+  /*!
+  * \brief Element
+  *
+  * Get a pointer to a specific element. This pointer can be used for plotting.
+  *
+  * \param data_type data type
+  *
+  * \return pointer to the element
+  */
+  IODataElement *Element(PlotableData_t data_type) const;
+
+  /*!
+  * \brief Get raw accelerations
+  *
+  * This method is mutex protected.
+  *
+  * \return raw accelerations
+  *
+  */
+  Vector3Df GetRawAcc(void) const;
+
+  /*!
+  * \brief Get raw magnetometers
+  *
+  * This method is mutex protected.
+  *
+  * \return raw magnetometers
+  *
+  */
+  Vector3Df GetRawMag(void) const;
+
+  /*!
+  * \brief Get raw angular speed
+  *
+  * This method is mutex protected.
+  *
+  * \return raw angular speed
+  *
+  */
+  Vector3Df GetRawGyr(void) const;
+
+  /*!
+  * \brief Get raw accelerations, magnetometers and angular speeds
+  *
+  * This method is mutex protected.
+  *
+  * \param rawAcc raw accelerations
+  * \param rawMag raw magnetometers
+  * \param rawGyr raw angular speeds
+  *
+  */
+  void GetRawAccMagAndGyr(Vector3Df &rawAcc, Vector3Df &rawMag,
+                          Vector3Df &rawGyr) const;
+
+  /*!
+  * \brief Set raw accelerations
+  *
+  * This method is mutex protected.
+  *
+  * \param raw accelerations
+  *
+  */
+  void SetRawAcc(const Vector3Df &rawAcc);
+
+  /*!
+  * \brief Set raw magnetometers
+  *
+  * This method is mutex protected.
+  *
+  * \param raw magnetometers
+  *
+  */
+  void SetRawMag(const Vector3Df &rawMag);
+
+  /*!
+  * \brief Set raw angular speed
+  *
+  * This method is mutex protected.
+  *
+  * \param raw angular speed
+  *
+  */
+  void SetRawGyr(const Vector3Df &rawGyr);
+
+  /*!
+  * \brief Set raw accelerations, magnetometers and angular speeds
+  *
+  * This method is mutex protected.
+  *
+  * \param rawAcc raw accelerations
+  * \param rawMag raw magnetometers
+  * \param rawGyr raw angular speeds
+  *
+  */
+  void SetRawAccMagAndGyr(const Vector3Df &rawAcc, const Vector3Df &rawMag,
+                          const Vector3Df &rawGyr);
+
+  Type const &GetDataType() const { return dataType; }
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+
+  /*!
+  * \brief Raw accelerometer
+  *
+  */
+  Vector3Df rawAcc;
+
+  /*!
+  * \brief Raw gyrometer
+  *
+  */
+  Vector3Df rawGyr;
+
+  /*!
+  * \brief Raw magnetometer
+  *
+  */
+  Vector3Df rawMag;
+
+  void Queue(char **dst, const void *src, size_t size) const;
+  Type dataType;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IMUDATA_H
Index: tags/latest/lib/FlairCore/src/Label.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Label.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Label.cpp	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/17
+//  filename:   Label.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QLabel on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Label.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+Label::Label(const LayoutPosition *position, string name, size_t buf_size)
+    : Widget(position->getLayout(), name, "Label") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+
+  SendXml();
+
+  printf_buffer = (char *)malloc(buf_size);
+  if (printf_buffer == NULL)
+    Err("erreur malloc\n");
+
+  delete position;
+}
+
+Label::~Label() {
+  if (printf_buffer != NULL)
+    free(printf_buffer);
+  printf_buffer = NULL;
+}
+
+void Label::SetText(const char *format, ...) {
+  int n;
+
+  va_list args;
+  va_start(args, format);
+  n = vsprintf(printf_buffer, format, args);
+  va_end(args);
+  if (n <= 0)
+    return;
+
+  SetVolatileXmlProp("value", printf_buffer);
+  SendXml();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Label.h
===================================================================
--- tags/latest/lib/FlairCore/src/Label.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Label.h	(revision 209)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Label.h
+ * \brief Class displaying a QLabel on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/08/17
+ * \version 4.0
+ */
+
+#ifndef LABEL_H
+#define LABEL_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class Label
+*
+* \brief Class displaying a QLabel on the ground station
+*
+*/
+class Label : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QLabel at given position. \n
+  * The Label will automatically be child of position->getLayout() Layout. After
+  *calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param parent parent
+  * \param name name
+  * \param buf_size size of the text buffer
+  */
+  Label(const LayoutPosition *position, std::string name,
+        size_t buf_size = 255);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Label();
+
+  /*!
+  * \brief Set text
+  *
+  * \param format text string to display, see standard printf
+  */
+  void SetText(const char *format, ...);
+
+private:
+  char *printf_buffer;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LABEL_H
Index: tags/latest/lib/FlairCore/src/Layout.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Layout.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Layout.cpp	(revision 209)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   Layout.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display a layout on the ground station
+//
+//
+/*********************************************************************/
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include "Mutex.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+Layout::Layout(const Widget *parent, string name, string type)
+    : Widget(parent, name, type) {
+  mutex = new core::Mutex(this, name);
+}
+
+Layout::~Layout() {}
+
+LayoutPosition *Layout::LastRowLastCol(void) const {
+  return new LayoutPosition(this, -1, 0);
+}
+
+LayoutPosition *Layout::NewRow(void) const {
+  return new LayoutPosition(this, -1, -1);
+}
+
+LayoutPosition *Layout::At(uint16_t row, uint16_t col) const {
+  return new LayoutPosition(this, row, col);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Layout.h
===================================================================
--- tags/latest/lib/FlairCore/src/Layout.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Layout.h	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Layout.h
+ * \brief Abstract class to display a layout on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef LAYOUT_H
+#define LAYOUT_H
+
+#include <Widget.h>
+#include <Mutex.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class Layout
+*
+* \brief Abstract class to display a layout on the ground station
+*
+* This is an abstract class to display layouts (like GridLayout, GroupBox, etc).
+*\n
+* A layout can contains Widgets (Box, DataPlot, Picture, etc). \n
+* Layout holds a Mutex, which can be used to protect access to Box's value for
+*example.
+*/
+class Layout : public Widget {
+  friend class Box;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Layout. Type is a predifined one, and will be
+  * interpreted by the ground station.
+  *
+  * \param parent parent
+  * \param name name
+  * \param type type of layout
+  */
+  Layout(const Widget *parent, std::string name, std::string type);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Layout();
+
+  /*!
+  * \brief Last Row and Col LayoutPosition
+  *
+  * Get a LayoutPosition at the last row and col.
+  *
+  * \return the LayoutPosition
+  */
+  LayoutPosition *LastRowLastCol(void) const;
+
+  /*!
+  * \brief New Row LayoutPosition
+  *
+  * Get a LayoutPosition at a new row and first col. This new row will be at the
+  *last position.
+  *
+  * \return the LayoutPosition
+  */
+  LayoutPosition *NewRow(void) const;
+
+  /*!
+  * \brief LayoutPosition at specified position
+  *
+  * Get a LayoutPosition at specified row and col.
+  *
+  * \param row row
+  * \param col col
+  *
+  * \return the LayoutPosition
+  */
+  LayoutPosition *At(uint16_t row, uint16_t col) const;
+
+private:
+  /*!
+  * \brief Mutex
+  *
+  * This Mutex can be used by friends class like Box to protect access
+  * to Box's value.
+  */
+  core::Mutex *mutex;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LAYOUT_H
Index: tags/latest/lib/FlairCore/src/LayoutPosition.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/LayoutPosition.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/LayoutPosition.cpp	(revision 209)
@@ -0,0 +1,37 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/12/04
+//  filename:   LayoutPosition.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class to define a position in a layout on the ground station
+//
+//
+/*********************************************************************/
+#include "LayoutPosition.h"
+
+namespace flair {
+namespace gui {
+
+LayoutPosition::LayoutPosition(const Layout *layout, int16_t row, int16_t col) {
+  this->layout = layout;
+  this->row = row;
+  this->col = col;
+}
+
+LayoutPosition::~LayoutPosition() {}
+
+const Layout *LayoutPosition::getLayout(void) const { return layout; }
+
+int16_t LayoutPosition::Row(void) const { return row; }
+
+int16_t LayoutPosition::Col(void) const { return col; }
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/LayoutPosition.h
===================================================================
--- tags/latest/lib/FlairCore/src/LayoutPosition.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/LayoutPosition.h	(revision 209)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file LayoutPosition.h
+ * \brief Class to define a position in a layout on the ground station.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/12/04
+ * \version 4.0
+ */
+
+#ifndef LAYOUTPOSITION_H
+#define LAYOUTPOSITION_H
+
+#include <stdint.h>
+
+namespace flair {
+namespace gui {
+class Layout;
+
+/*! \class LayoutPosition
+*
+* \brief Class to define a position in a layout on the ground station.
+*
+
+*/
+class LayoutPosition {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a LayoutPosition, in given Layout at given place.
+  *
+  * \param layout layout
+  * \param row row position
+  * \param col col position
+  */
+  LayoutPosition(const Layout *layout, int16_t row, int16_t col);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~LayoutPosition();
+
+  /*!
+  * \brief get Layout
+  *
+  * \return the parent Layout
+  */
+  const Layout *getLayout(void) const;
+
+  /*!
+  * \brief get row
+  *
+  * \return row position
+  */
+  int16_t Row(void) const;
+
+  /*!
+  * \brief get col
+  *
+  * \return col position
+  */
+  int16_t Col(void) const;
+
+private:
+  const Layout *layout;
+  int16_t row, col;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LAYOUTPOSITION_H
Index: tags/latest/lib/FlairCore/src/ListWidget.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ListWidget.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ListWidget.cpp	(revision 209)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/07/26
+//  filename:   ListWidget.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QListWidget on the ground station
+//
+//
+/*********************************************************************/
+#include "ListWidget.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+#include <sstream>
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+ListWidget::ListWidget(const LayoutPosition *position, string name)
+    : Widget(position->getLayout(), name, string("ListWidget")),
+    selectedItemRow(-1), selectedItemChanged(false) {
+  // load the items in the xml file and send them to the ground station
+  size_t count = 0;
+  while (1) {
+    string item;
+    std::ostringstream item_prop;
+    item_prop << "item" << count;
+    if (GetPersistentXmlProp(item_prop.str(), item)) {
+      SetVolatileXmlProp(item_prop.str(), item);
+      items.push_back(item);
+    } else {
+      break;
+    }
+    count++;
+  }
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  delete position;
+  SendXml();
+}
+
+ListWidget::~ListWidget() { core::Object::ObjectName(); }
+
+void ListWidget::AddItem(string name) {
+  items.push_back(name);
+  SetVolatileXmlProp("item", name);
+  SendXml();
+}
+
+void ListWidget::RemoveItem(void) {
+  if (selectedItemChanged) {
+    // Delete the the last item, the xml file will automatically be updated by the GUI
+    // TODO diff when the apply all xml file is received to avoid clear here
+    std::ostringstream item_prop;
+    item_prop << "item" << (items.size() - 1);
+    UnsetPersistentXmlProp(item_prop.str());
+    // Delete the item from the internal list and ask the GUI to delete it
+    selectedItemChanged = false;
+    items.erase(items.cbegin() + selectedItemRow);
+    SetVolatileXmlProp("delete", selectedItemRow);
+    SendXml();
+  }
+}
+
+void ListWidget::XmlEvent(void) {
+  if (GetPersistentXmlProp("value", selectedItemRow)) {
+    selectedItemChanged = true;
+  }
+}
+
+const std::vector<std::string> &ListWidget::GetItemList() const {
+  return items;
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/ListWidget.h
===================================================================
--- tags/latest/lib/FlairCore/src/ListWidget.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/ListWidget.h	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ListWidget.h
+ * \brief Class displaying a QListWidget on the ground station
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/07/26
+ * \version 1.0
+ */
+
+#ifndef LISTWIDGET_H
+#define LISTWIDGET_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class ListWidget
+ *
+ * \brief Class displaying a QListWidget on the ground station
+ *  
+ *  The internal list (called items) contains the same elements
+ *  as the list of the QListWidget on the ground station.
+ *  To do that, each action done on the ground station has to
+ *  applied thanks to a click on the "apply" button.
+ *
+ */
+class ListWidget : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QListWidget at given position.
+  *
+  * \param position position to display the QListWidget
+  * \param name name
+  */
+  ListWidget(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ListWidget();
+
+  /*!
+ * \brief Add an item
+ *
+ * Add an item to the end of the list.
+ *
+ * \param name item nam
+ */
+  void AddItem(std::string name);
+
+  /*!
+  * \brief Remove an item
+  *
+  * Remove the currently selected item.
+  * The item is not removed from the internal xml file,
+  * because the xml is override by the GUI.
+  */
+  void RemoveItem(void);
+
+  const std::vector<std::string> &GetItemList() const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  /**
+   * List of items displayed in the ground station.
+   */
+  std::vector<std::string> items;
+  /**
+   * Row of the item currently selected in the list.
+   */
+  uint16_t selectedItemRow;
+  /**
+   * Flag to know if the selected item has changed.
+   */
+  bool selectedItemChanged;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LISTWIDGET_H
Index: tags/latest/lib/FlairCore/src/Map.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Map.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Map.cpp	(revision 209)
@@ -0,0 +1,166 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/07/23
+//  filename:   Map.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a GPS map on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Map.h"
+#include "LayoutPosition.h"
+#include "Layout.h"
+#include "GeoCoordinate.h"
+#include <cmath>
+#include <string.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+
+namespace flair {
+namespace gui {
+
+using namespace core;
+
+Map::Map(const LayoutPosition *position, string name)
+    : SendData(position, name, "Map", 1000) {
+  size_t i = 0;
+  while (1) {
+    double latitude, longitude;
+    double altitude = 0;
+    ostringstream lat_prop, long_prop, alt_prop;
+    lat_prop << "lat" << i;
+    long_prop << "long" << i;
+    alt_prop << "alt" << i;
+    if (GetPersistentXmlProp(lat_prop.str(), latitude) &&
+        GetPersistentXmlProp(long_prop.str(), longitude)) {
+      SetVolatileXmlProp(lat_prop.str(), latitude);
+      SetVolatileXmlProp(long_prop.str(), longitude);
+      if (GetPersistentXmlProp(alt_prop.str(), altitude))
+        SetVolatileXmlProp(alt_prop.str(), altitude);
+      GeoCoordinate *checkpoint =
+          new GeoCoordinate(this, "checkpoint", latitude, longitude, altitude);
+      checkpoints.push_back(checkpoint);
+    } else {
+      break;
+    }
+    i++;
+  }
+  for (size_t i = 0; i < checkpoints.size(); i++) {
+    double latitude, longitude, altitude;
+    checkpoints.at(i)->GetCoordinates(&latitude, &longitude, &altitude);
+    // printf("%i %f %f\n",i,latitude,longitude);
+  }
+
+  SendXml();
+  /*
+      //update value from xml file
+      XmlEvent(XmlFileNode());
+      if(checkpoints_node.size()!=0) SendXml();//pour les checkpoints
+
+      //on enleve les checkpoints du xml
+      for(size_t i=0;i<checkpoints_node.size();i++)
+      {
+          xmlUnlinkNode(checkpoints_node.at(i));
+          xmlFreeNode(checkpoints_node.at(i));
+      }*/
+}
+
+Map::~Map() {}
+
+void Map::ExtraXmlEvent(void) {
+
+  // attention pas rt safe (creation/destruction checkpoint)
+  size_t i = 0;
+  while (1) {
+    double latitude, longitude;
+    double altitude = 0;
+    ostringstream lat_prop, long_prop, alt_prop;
+    lat_prop << "lat" << i;
+    long_prop << "long" << i;
+    alt_prop << "alt" << i;
+
+    if (GetPersistentXmlProp(lat_prop.str(), latitude) &&
+        GetPersistentXmlProp(long_prop.str(), longitude)) {
+      GetPersistentXmlProp(alt_prop.str(), altitude);
+
+      if (i >= checkpoints.size()) {
+        //add checkpoint
+        GeoCoordinate *checkpoint = new GeoCoordinate(
+            this, "checkpoint", latitude, longitude, altitude);
+        checkpoints.push_back(checkpoint);
+      } else if(isnan(latitude) || isnan(longitude)) {
+        //delete checkpoint
+        removeCheckpoint(i);
+        break;//si delete, la station sol n'envoit que cette info
+      } else {
+        //move checkpoint
+        checkpoints.at(i)->SetCoordinates(latitude, longitude, altitude);
+      }
+    } else {
+      if (i == checkpoints.size())
+        break;
+    }
+    i++;
+  }
+/*
+  for (size_t i = 0; i < checkpoints.size(); i++) {
+    double latitude, longitude, altitude;
+    checkpoints.at(i)->GetCoordinates(&latitude, &longitude, &altitude);
+     printf("%i %f %f\n",i,latitude,longitude);
+  }*/
+}
+
+void Map::removeCheckpoint(size_t index) {
+  //left shift
+  for (size_t i = index; i < checkpoints.size()-1; i++) {
+    double latitude, longitude, altitude;
+    checkpoints.at(i+1)->GetCoordinates(&latitude, &longitude, &altitude);
+    checkpoints.at(i)->SetCoordinates(latitude,longitude,altitude);
+  }
+
+  //remove last one
+  delete checkpoints.back();
+  checkpoints.pop_back();
+
+  //remove last one in xml
+  ostringstream lat_prop, long_prop, alt_prop;
+  lat_prop << "lat" << checkpoints.size();
+  long_prop << "long" << checkpoints.size();
+  alt_prop << "alt" << checkpoints.size();
+  UnsetPersistentXmlProp(lat_prop.str());
+  UnsetPersistentXmlProp(long_prop.str());
+  UnsetPersistentXmlProp(alt_prop.str());
+}
+
+void Map::AddPoint(const GeoCoordinate *point, string name) {
+  SetVolatileXmlProp("point", name);
+  SendXml();
+
+  to_draw.push_back(point);
+  SetSendSize(to_draw.size() * 3 * sizeof(double)); // lat,long,alt
+}
+
+void Map::CopyDatas(char *buf) const {
+  for (size_t i = 0; i < to_draw.size(); i++) {
+    double latitude, longitude, altitude;
+    to_draw.at(i)->GetCoordinates(&latitude, &longitude, &altitude);
+    memcpy(buf + i * 3 * sizeof(double), &latitude, sizeof(double));
+    memcpy(buf + sizeof(double) + i * 3 * sizeof(double), &longitude,
+           sizeof(double));
+    memcpy(buf + 2 * sizeof(double) + i * 3 * sizeof(double), &altitude,
+           sizeof(double));
+  }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Map.h
===================================================================
--- tags/latest/lib/FlairCore/src/Map.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Map.h	(revision 209)
@@ -0,0 +1,90 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Map.h
+ * \brief Class displaying a GPS map on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/07/23
+ * \version 4.0
+ */
+
+#ifndef MAP_H
+#define MAP_H
+
+#include <SendData.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class GeoCoordinate;
+}
+
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class Map
+*
+* \brief Class displaying a GPS map on the ground station
+*
+*/
+class Map : public SendData {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a map at given position. \n
+  * The Map will automatically be child of position->getLayout() Layout. After
+  *calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position to draw map
+  * \param name name
+  */
+  Map(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Map();
+
+  /*!
+  * \brief Add a point to the map
+  *
+  * \param point point to draw
+  * \param name name
+  */
+  void AddPoint(const core::GeoCoordinate *point, std::string name = "");
+
+  /*!
+  * \brief Copy datas to specified buffer
+  *
+  * Reimplemented from SendData.
+  *
+  * \param buf output buffer
+  */
+  void CopyDatas(char *buf) const;
+
+private:
+  /*!
+  * \brief Extra Xml event
+  *
+  * Reimplemented from SendData.
+  */
+  void ExtraXmlEvent(void);
+
+  void removeCheckpoint(size_t index);
+
+  std::vector<core::GeoCoordinate *> checkpoints;
+  std::vector<const core::GeoCoordinate *> to_draw;
+  // std::vector<xmlNodePtr> checkpoints_node;
+  // bool init;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // MAP_H
Index: tags/latest/lib/FlairCore/src/Mutex.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Mutex.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Mutex.cpp	(revision 209)
@@ -0,0 +1,45 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/14
+//  filename:   Mutex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a mutex
+//
+//
+/*********************************************************************/
+
+#include "Mutex.h"
+#include "Mutex_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Mutex::Mutex(const Object *parent, string name)
+    : Object(parent, name, "mutex") {
+  pimpl_ = new Mutex_impl(this);
+}
+
+Mutex::~Mutex() { delete pimpl_; }
+
+void Mutex::GetMutex(void) const { pimpl_->GetMutex(); }
+
+void Mutex::ReleaseMutex(void) const { pimpl_->ReleaseMutex(); }
+
+/*
+bool Mutex::IsLocked(void)
+{
+    return pimpl_->IsLocked();
+}
+*/
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Mutex.h
===================================================================
--- tags/latest/lib/FlairCore/src/Mutex.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Mutex.h	(revision 209)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Mutex.h
+ * \brief Class defining a mutex
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/14
+ * \version 4.0
+ */
+
+#ifndef MUTEX_H
+#define MUTEX_H
+
+#include <Object.h>
+
+class Mutex_impl;
+class ConditionVariable_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class Mutex
+*
+* \brief Class defining a mutex
+*
+*/
+class Mutex : public Object {
+  friend class ::ConditionVariable_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a mutex.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Mutex(const Object *parent, std::string name = "");
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Mutex();
+
+  /*!
+  * \brief GetMutex
+  *
+  * Lock the mutex.
+  *
+  */
+  void GetMutex(void) const;
+
+  /*!
+  * \brief ReleaseMutex
+  *
+  * Unlock the mutex.
+  *
+  */
+  void ReleaseMutex(void) const;
+
+private:
+  class Mutex_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // MUTEX_H
Index: tags/latest/lib/FlairCore/src/Mutex_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Mutex_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Mutex_impl.cpp	(revision 209)
@@ -0,0 +1,106 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/14
+//  filename:   Mutex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a mutex
+//
+//
+/*********************************************************************/
+
+#include "Mutex_impl.h"
+#include "Mutex.h"
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+Mutex_impl::Mutex_impl(Mutex *self) {
+  this->self = self;
+#ifdef __XENO__
+  int status = rt_mutex_create(&mutex, NULL);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("rt_mutex_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#else
+  // flag_locked=false;//revoir l'implementation nrt du is_locked
+  pthread_mutexattr_t attr;
+  if (pthread_mutexattr_init(&attr) != 0) {
+    self->Err("pthread_mutexattr_init error\n");
+  }
+  if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) {
+    self->Err("pthread_mutexattr_settype error\n");
+  }
+  if (pthread_mutex_init(&mutex, &attr) != 0) {
+    self->Err("pthread_mutex_init error\n");
+  }
+  if (pthread_mutexattr_destroy(&attr) != 0) {
+    self->Err("pthread_mutexattr_destroy error\n");
+  }
+#endif
+}
+
+Mutex_impl::~Mutex_impl() {
+  int status;
+	char errorMsg[256];
+	
+#ifdef __XENO__
+  status = rt_mutex_delete(&mutex);
+#else
+  status = pthread_mutex_destroy(&mutex);
+#endif
+  if (status != 0)
+    self->Err("error destroying mutex (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+}
+
+void Mutex_impl::GetMutex(void) {
+  int status;
+	char errorMsg[256];
+	
+#ifdef __XENO__
+  status = rt_mutex_acquire(&mutex, TM_INFINITE);
+#else
+  // flag_locked=true;
+  status = pthread_mutex_lock(&mutex);
+#endif
+  if (status != 0)
+    self->Err("error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+}
+
+void Mutex_impl::ReleaseMutex(void) {
+  int status;
+	
+#ifdef __XENO__
+  status = rt_mutex_release(&mutex);
+#else
+  status = pthread_mutex_unlock(&mutex);
+// flag_locked=false;
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+}
+
+/*
+bool Mutex_impl::IsLocked(void)
+{
+#ifdef __XENO__
+    RT_MUTEX_INFO info;
+    int status=rt_mutex_inquire(&mutex_rt,&info);
+    if(status!=0) mutex->Err("erreur rt_mutex_inquire (%s)\n",strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    if(info.locked>0) return true;
+    return false;
+#else
+    return flag_locked;
+#endif
+}
+*/
Index: tags/latest/lib/FlairCore/src/Object.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Object.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Object.cpp	(revision 209)
@@ -0,0 +1,145 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for all Framework's classes
+//
+//
+/*********************************************************************/
+
+#include <stdio.h>
+
+#include "Object.h"
+#include "Object_impl.h"
+#include "FrameworkManager.h"
+
+#ifdef __XENO__
+#include <native/task.h>
+#include <native/timer.h>
+#include "rtdk.h"
+#else
+#include <sys/time.h>
+#endif
+
+using std::string;
+using std::vector;
+
+namespace flair {
+namespace core {
+
+Time GetTime(void) {
+#ifdef __XENO__
+  return rt_timer_read();
+#else
+  struct timeval t;
+  gettimeofday(&t, NULL);
+  return (Time)((Time)(t.tv_sec) * 1000000 + (Time)(t.tv_usec)) * 1000;
+
+#endif
+}
+
+void Printf(const char *format, ...) {
+  va_list args;
+  va_start(args, format);
+#ifdef __XENO__
+  if (rt_task_self() != NULL) {
+    rt_vfprintf(stderr, format, args);
+  } else
+#endif
+  {
+    vfprintf(stderr, format, args);
+  }
+
+  va_end(args);
+}
+
+Object::Object(const Object *parent, string name, string type) {
+  pimpl_ = new Object_impl(this, parent, name, type);
+  if (parent != NULL)
+    parent->pimpl_->AddChild(this);
+}
+
+Object::~Object() {
+  if (pimpl_->parent != NULL)
+    pimpl_->parent->pimpl_->RemoveChild(this);
+  delete pimpl_;
+}
+
+string Object::ObjectName(void) const { return pimpl_->name; }
+
+string Object::ObjectType(void) const { return pimpl_->type; }
+
+const Object *Object::Parent(void) const { return pimpl_->parent; }
+
+vector<const Object *> *Object::TypeChilds(void) const {
+  return &(pimpl_->type_childs);
+}
+
+vector<const Object *> *Object::Childs(void) const { return &(pimpl_->childs); }
+
+void Object::ColorPrintf(color_t color, const char *function, int line,
+                         const char *format, va_list *args) const {
+#ifdef __XENO__
+  if (rt_task_self() != NULL) {
+    rt_fprintf(stderr, "\033[%dm", color);
+    if (line) {
+      rt_fprintf(stderr, "%s - line %d, %s: ", function, line,
+                 pimpl_->name.c_str());
+    } else {
+      rt_fprintf(stderr, "%s, %s: ", function, pimpl_->name.c_str());
+    }
+    rt_vfprintf(stderr, format, *args);
+    rt_fprintf(stderr, "\033[%dm", color_t::Auto);
+  } else
+#endif
+  {
+    fprintf(stderr, "\033[%dm", color);
+    if (line) {
+      fprintf(stderr, "%s - line %d, %s: ", function, line,
+              pimpl_->name.c_str());
+    } else {
+      fprintf(stderr, "%s, %s: ", function, pimpl_->name.c_str());
+    }
+    vfprintf(stderr, format, *args);
+    fprintf(stderr, "\033[%dm", color_t::Auto);
+  }
+}
+
+void Object::Information(const char *function, int line, const char *format,
+                         ...) const {
+  va_list args;
+  va_start(args, format);
+  ColorPrintf(color_t::Green, function, line, format, &args);
+  va_end(args);
+}
+
+void Object::Warning(const char *function, const char *format, ...) const {
+  va_list args;
+  va_start(args, format);
+  ColorPrintf(color_t::Orange, function, 0, format, &args);
+  va_end(args);
+}
+
+void Object::Error(const char *function, const char *format, ...) const {
+  va_list args;
+  va_start(args, format);
+  ColorPrintf(color_t::Red, function, 0, format, &args);
+  va_end(args);
+
+  pimpl_->error_occured = true;
+}
+
+bool Object::ErrorOccured(bool recursive) const {
+  return pimpl_->ErrorOccured(recursive);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Object.h
===================================================================
--- tags/latest/lib/FlairCore/src/Object.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Object.h	(revision 209)
@@ -0,0 +1,196 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Object.h
+ * \brief Base class for all Framework's classes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/07
+ * \version 4.0
+ */
+
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include <string>
+#include <vector>
+#include <stdarg.h>
+
+#define Warn(...) Warning(__PRETTY_FUNCTION__, __VA_ARGS__)
+#define Err(...) Error(__PRETTY_FUNCTION__, __VA_ARGS__)
+#define Info(...) Information(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+
+#define TIME_INFINITE 0
+#define TIME_NONBLOCK ((Time)-1)
+
+class Object_impl;
+class Widget_impl;
+
+namespace flair {
+namespace core {
+
+class FrameworkManager;
+
+class Message {
+public:
+  Message(unsigned int myBufferSize) : bufferSize(myBufferSize) {
+    buffer = new char[bufferSize];
+  }
+  ~Message() { delete buffer; }
+  char *buffer;
+  size_t bufferSize;
+};
+
+/*!
+* \brief Time definition, in ns
+*
+*/
+typedef unsigned long long Time;
+
+/*!
+* \brief Time
+*
+* \return actual time in ns (origin depends on whether the method is compiled in
+*hard real time mode or not. As a conquence, only time differences should be
+*used)
+*/
+Time GetTime(void);
+
+/*!
+* \brief Formatted print
+*
+* See standard printf for syntax.
+*
+* \param format text string to display
+*/
+void Printf(const char *format, ...);
+
+/*! \class Object
+*
+* \brief Base class for all Framework's classes
+*
+* This is the base class for all other classes. \n
+* It handles parent/child links and thus allow auto destruction of childs.
+*
+*/
+class Object {
+  friend class ::Widget_impl;
+
+public:
+  typedef enum { Auto = 0, Red = 31, Green = 32, Orange = 33 } color_t;
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Object, which is child of its parent.
+  *
+  * \param parent parent
+  * \param name name
+  * \param type type
+  */
+  Object(const Object *parent = NULL, std::string name = "",
+         std::string type = "");
+
+  /*!
+  * \brief Destructor
+  *
+  * Calling it will automatically destruct all childs.
+  *
+  */
+  virtual ~Object();
+
+  /*!
+  * \brief Name
+  *
+  * \return Object's name
+  */
+  std::string ObjectName(void) const;
+
+  /*!
+  * \brief Type
+  *
+  * \return Object's type
+  */
+  std::string ObjectType(void) const;
+
+  /*!
+  * \brief Parent
+  *
+  * \return Object's parent
+  */
+  const Object *Parent(void) const;
+
+  /*!
+  * \brief Childs of the same type
+  *
+  * \return a vector of all childs of the same type
+  */
+  std::vector<const Object *> *TypeChilds(void) const;
+
+  /*!
+  * \brief Childs
+  *
+  * \return a vector of all childs
+  */
+  std::vector<const Object *> *Childs(void) const;
+
+  /*!
+  * \brief Formatted information
+  *
+  * Green colored Printf(). \n
+  * Note that it is better to call Info macro, which automatically fills
+  *function parameter.
+  *
+  * \param function name of calling function
+  * \param line line number in calling function
+  * \param format text string to display
+  */
+  void Information(const char *function, int line, const char *format,
+                   ...) const;
+
+  /*!
+  * \brief Formatted warning
+  *
+  * Orange colored Printf(). \n
+  * Note that it is better to call Warn macro, which automatically fills
+  *function parameter.
+  *
+  * \param function name of calling function
+  * \param format text string to display
+  */
+  void Warning(const char *function, const char *format, ...) const;
+
+  /*!
+  * \brief Formatted error
+  *
+  * Red colored Printf(). \n
+  * Note that it is better to call Err macro, which automatically fills function
+  *parameter. \n
+  * After calling this method, ErrorOccured() will always return true.
+  *
+  * \param function name of calling function
+  * \param format text string to display
+  */
+  void Error(const char *function, const char *format, ...) const;
+
+  /*!
+  * \brief Has an errror occured?
+  *
+  * Check if an error occured, in fact if Error() was called at least once. \n
+  * Once Error() was called, this method will never return back false.
+  *
+  * \param recursive if true, recursively check among childs
+  * \return true if an error occured
+  */
+  bool ErrorOccured(bool recursive = true) const;
+
+private:
+  class Object_impl *pimpl_;
+  void ColorPrintf(color_t, const char *function, int line, const char *format,
+                   va_list *args) const;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // OBJECT_H
Index: tags/latest/lib/FlairCore/src/Object_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Object_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Object_impl.cpp	(revision 209)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour qobject
+//
+//
+/*********************************************************************/
+
+#include "Object.h"
+#include "Object_impl.h"
+
+using std::string;
+using std::vector;
+using namespace flair::core;
+
+Object_impl::Object_impl(const Object *self, const Object *parent, string name,
+                         string type) {
+  // Printf("Object %s\n",name.c_str());
+  this->self = self;
+  this->parent = parent;
+  this->name = name;
+  this->type = type;
+  error_occured = false;
+
+  if (parent != NULL) {
+    if (name == "")
+      this->name = parent->ObjectName();
+  }
+}
+
+Object_impl::~Object_impl() {
+  // Printf("destruction Object %s %s\n",name.c_str(),type.c_str());
+
+  while (childs.size() != 0) {
+    // Printf("child %i %s
+    // %s\n",childs.size(),childs.front()->ObjectName().c_str(),childs.front()->ObjectType().c_str());
+    // if(childs.front()!=NULL)
+    delete childs.front();
+  }
+
+  if (type_childs.size() != 0) {
+    type_childs.clear();
+    self->Warn("type_childs not cleared\n");
+  }
+
+  // Printf("destruction Object %s %s ok\n",name.c_str(),type.c_str());
+}
+
+void Object_impl::AddChild(const Object *child) {
+  childs.push_back(child);
+  // self->Printf("added Object %s %s (%s
+  // %s)\n",child->ObjectName().c_str(),child->ObjectType().c_str(),name.c_str(),type.c_str());
+  if (child->ObjectType() == type)
+    type_childs.push_back(child);
+}
+
+void Object_impl::RemoveChild(const Object *child) {
+  // self->Printf("removed Object %s %s (%s
+  // %s)\n",child->ObjectName().c_str(),child->ObjectType().c_str(),name.c_str(),type.c_str());
+
+  for (vector<const Object *>::iterator it = childs.begin(); it < childs.end();
+       it++) {
+    if (*it == child) {
+      childs.erase(it);
+      break;
+    }
+  }
+
+  for (vector<const Object *>::iterator it = type_childs.begin();
+       it < type_childs.end(); it++) {
+    if (*it == child) {
+      type_childs.erase(it);
+      break;
+    }
+  }
+}
+
+bool Object_impl::ErrorOccured(bool recursive) {
+  if (recursive == true) {
+    for (size_t i = 0; i < childs.size(); i++) {
+      if (childs[i]->ErrorOccured(true) == true) {
+        return true;
+      }
+    }
+  }
+  return error_occured;
+}
Index: tags/latest/lib/FlairCore/src/OneAxisRotation.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/OneAxisRotation.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/OneAxisRotation.cpp	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/17
+//  filename:   OneAxisRotation.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a rotation around one axis
+//
+//
+/*********************************************************************/
+
+// this "filter" is in core but it should be in filter
+// filter depends on sensoractuator
+// sensoractuators depends on oneaxisrotation
+// so if oneaxisrotation is in fiter we have a circular dependency
+// TODO: fix this!
+
+#include "OneAxisRotation.h"
+#include "OneAxisRotation_impl.h"
+#include <Euler.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+template void OneAxisRotation::ComputeRotation(core::Vector3D<float> &) const;
+template void OneAxisRotation::ComputeRotation(core::Vector3D<double> &) const;
+  
+OneAxisRotation::OneAxisRotation(const gui::LayoutPosition *position,string name,RotationType_t rotationType)
+    : gui::GroupBox(position, name) {
+  pimpl_ = new OneAxisRotation_impl(this,(int)rotationType);
+}
+
+OneAxisRotation::~OneAxisRotation() { delete pimpl_; }
+
+template <typename T> void OneAxisRotation::ComputeRotation(Vector3D<T> &vector) const {
+  pimpl_->ComputeRotation(vector);
+}
+
+void OneAxisRotation::ComputeRotation(Euler &euler) const {
+  pimpl_->ComputeRotation(euler);
+}
+
+void OneAxisRotation::ComputeRotation(Quaternion &quaternion) const {
+  pimpl_->ComputeRotation(quaternion);
+}
+
+void OneAxisRotation::ComputeRotation(RotationMatrix &matrix) const {
+  pimpl_->ComputeRotation(matrix);
+}
+
+float OneAxisRotation::GetAngle() const {
+  return Euler::ToRadian(pimpl_->GetAngle());
+}
+
+int OneAxisRotation::GetAxis() const {
+  return pimpl_->GetAxis();
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/OneAxisRotation.h
===================================================================
--- tags/latest/lib/FlairCore/src/OneAxisRotation.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/OneAxisRotation.h	(revision 209)
@@ -0,0 +1,107 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file OneAxisRotation.h
+ * \brief Class defining a rotation around one axis
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/17
+ * \version 4.0
+ */
+
+#ifndef ONEAXISROTATION_H
+#define ONEAXISROTATION_H
+
+#include <GroupBox.h>
+#include <Vector3D.h>
+
+class OneAxisRotation_impl;
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+}
+
+namespace core {
+class Euler;
+class Quaternion;
+class RotationMatrix;
+
+/*! \class OneAxisRotation
+*
+* \brief Class defining a rotation around one axis
+*
+* Axe and value of the rotation are placed in a GroupBox on ground station.
+*
+*/
+class OneAxisRotation : public gui::GroupBox {
+  public:
+  /*!
+  \enum RotationType_t
+  \brief rotation type
+  */
+  enum RotationType_t {
+    PreRotation,//rotation
+    PostRotation//frame change
+  };
+  /*!
+  * \brief Constructor
+  *
+  * Construct a OneAxisRotation at given position.
+  *
+  * \param position position to place the GroupBox
+  * \param name name
+  */
+  OneAxisRotation(const gui::LayoutPosition *position, std::string name,RotationType_t rotationType);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~OneAxisRotation();
+
+  /*!
+  * \brief Compute rotation
+  *
+  * \param vector Vector3Df to rotate
+  */
+  template <typename T> void ComputeRotation(core::Vector3D<T> &vector) const;
+
+  /*!
+  * \brief Compute rotation
+  *
+  * \param euler Euler angle to rotate
+  */
+  void ComputeRotation(core::Euler &euler) const;
+
+  /*!
+  * \brief Compute rotation
+  *
+  * \param quaternion Quaternion to rotate
+  */
+  void ComputeRotation(core::Quaternion &quaternion) const;
+
+  /*!
+  * \brief Compute rotation
+  *
+  * \param matrix RotationMatrix to rotate
+  */
+  void ComputeRotation(core::RotationMatrix &matrix) const;
+  
+  /*!
+  * \brief Get angle
+  *
+  * \return angle in radians
+  */
+  float GetAngle() const;
+  int GetAxis() const;
+
+private:
+  const class OneAxisRotation_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // ONEAXISROTATION_H
Index: tags/latest/lib/FlairCore/src/OneAxisRotation_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 209)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/17
+//  filename:   OneAxisRotation_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant pour une rotation sur un axe
+//
+//
+/*********************************************************************/
+
+#include "OneAxisRotation_impl.h"
+#include "OneAxisRotation.h"
+#include "GroupBox.h"
+#include "ComboBox.h"
+#include "DoubleSpinBox.h"
+#include <Euler.h>
+#include <Quaternion.h>
+#include <math.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+template void OneAxisRotation_impl::ComputeRotation(Vector3D<float>&) const;
+template void OneAxisRotation_impl::ComputeRotation(Vector3D<double>&) const;
+
+OneAxisRotation_impl::OneAxisRotation_impl(GroupBox *box,int rotationType) {
+  rot_value =
+      new DoubleSpinBox(box->NewRow(), "value", " deg", -180., 180., 10., 1);
+  rot_axe = new ComboBox(box->LastRowLastCol(), "axis");
+  rot_axe->AddItem("x");
+  rot_axe->AddItem("y");
+  rot_axe->AddItem("z");
+  this->rotationType=rotationType;
+}
+
+OneAxisRotation_impl::~OneAxisRotation_impl() {}
+
+void OneAxisRotation_impl::ComputeRotation(Quaternion &quat) const {
+  Quaternion rot;
+  switch (rot_axe->CurrentIndex()) {
+    case 0://x
+      rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),sinf(Euler::ToRadian(-rot_value->Value()/2)),0,0);
+      break;
+    case 1://y
+      rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),0,sinf(Euler::ToRadian(-rot_value->Value()/2)),0);
+      break;
+    case 2://z
+      rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),0,0,sinf(Euler::ToRadian(-rot_value->Value()/2)));
+      break;
+  }
+  if(rotationType==OneAxisRotation::RotationType_t::PreRotation) {
+    quat=rot*quat;
+  } else { //post rotation
+    quat=quat*rot;
+  }
+}
+
+void OneAxisRotation_impl::ComputeRotation(RotationMatrix &matrix) const {
+  Printf("not yet implemented\n");
+}
+
+// on utilise la rotation d'un vector pour faire une rotation de repere
+// d'ou le signe negatif
+template <typename T> void OneAxisRotation_impl::ComputeRotation(Vector3D<T> &vector) const {
+  switch (rot_axe->CurrentIndex()) {
+  case 0:
+    vector.RotateXDeg(-rot_value->Value());
+    break;
+  case 1:
+    vector.RotateYDeg(-rot_value->Value());
+    break;
+  case 2:
+    vector.RotateZDeg(-rot_value->Value());
+    break;
+  }
+}
+
+void OneAxisRotation_impl::ComputeRotation(Euler &euler) const {
+  Quaternion quat;
+  euler.ToQuaternion(quat);
+  ComputeRotation(quat);
+  quat.ToEuler(euler);
+}
+
+int OneAxisRotation_impl::GetAxis() const {
+  return rot_axe->CurrentIndex();
+}
+
+float OneAxisRotation_impl::GetAngle() const {
+  return rot_value->Value();
+}
+
Index: tags/latest/lib/FlairCore/src/Picture.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Picture.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Picture.cpp	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/01/30
+//  filename:   Picture.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a Picture on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Picture.h"
+#include "cvimage.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+using namespace core;
+
+Picture::Picture(const LayoutPosition *position, string name,
+                 const cvimage *image)
+    : SendData(position, name, "Picture", 200) {
+  this->image = image;
+
+  SetSendSize(image->GetDataType().GetSize());
+
+  SetVolatileXmlProp("width", image->GetDataType().GetWidth());
+  SetVolatileXmlProp("height", image->GetDataType().GetHeight());
+  SendXml();
+}
+
+Picture::~Picture() {}
+
+void Picture::CopyDatas(char *buf) const {
+  if (image != NULL) {
+    image->GetMutex();
+    memcpy(buf, image->img->imageData, image->GetDataType().GetSize());
+    image->ReleaseMutex();
+  }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Picture.h
===================================================================
--- tags/latest/lib/FlairCore/src/Picture.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Picture.h	(revision 209)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Picture.h
+ * \brief Class displaying a Picture on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/01/30
+ * \version 4.0
+ */
+
+#ifndef PICTURE_H
+#define PICTURE_H
+
+#include <SendData.h>
+#include <cxtypes.h>
+
+namespace flair {
+namespace core {
+class cvimage;
+}
+
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class Picture
+*
+* \brief Class displaying a Picture on the ground station
+*
+*/
+class Picture : public SendData {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a picture at given position. \n
+  * The Picture will automatically be child of position->getLayout() Layout.
+  *After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position to draw plot
+  * \param name name
+  * \param image image to draw
+  */
+  Picture(const LayoutPosition *position, std::string name,
+          const core::cvimage *image);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Picture();
+
+private:
+  /*!
+  * \brief Copy datas to specified buffer
+  *
+  * Reimplemented from SendData.
+  *
+  * \param buf output buffer
+  */
+  void CopyDatas(char *buf) const;
+
+  /*!
+  * \brief Extra Xml event
+  *
+  * Reimplemented from SendData.
+  */
+  void ExtraXmlEvent(void){};
+
+  const core::cvimage *image;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // PICTURE_H
Index: tags/latest/lib/FlairCore/src/PushButton.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/PushButton.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/PushButton.cpp	(revision 209)
@@ -0,0 +1,58 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   PushButton.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QPushButton on the ground station
+//
+//
+/*********************************************************************/
+
+#include "PushButton.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+PushButton::PushButton(const LayoutPosition *position, string name)
+    : Widget(position->getLayout(), name, "PushButton") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  delete position;
+
+  SendXml();
+
+  clicked = false;
+}
+
+PushButton::~PushButton() {}
+
+void PushButton::XmlEvent(void) {
+  int clic = 0;
+  GetPersistentXmlProp("value", clic);
+
+  if (clic == 1)
+    clicked = true;
+}
+
+bool PushButton::Clicked(void) {
+  if (clicked == true) {
+    clicked = false;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/PushButton.h
===================================================================
--- tags/latest/lib/FlairCore/src/PushButton.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/PushButton.h	(revision 209)
@@ -0,0 +1,75 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file PushButton.h
+ * \brief Class displaying a QPushButton on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef PUSHBUTTON_H
+#define PUSHBUTTON_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class PushButton
+*
+* \brief Class displaying a QPushButton on the ground station
+*
+*/
+class PushButton : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QPushButton at given position. \n
+  * The PushButton will automatically be child of position->getLayout() Layout.
+  *After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  PushButton(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~PushButton();
+
+  /*!
+  * \brief Has been clicled?
+  *
+  * After calling this method, the internal flag
+  * representing the state of the button is
+  * automatically set to false.
+  *
+  * \return true if button was clicked
+  */
+  bool Clicked(void);
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  bool clicked;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // PUSHBUTTON_H
Index: tags/latest/lib/FlairCore/src/Quaternion.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Quaternion.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Quaternion.cpp	(revision 209)
@@ -0,0 +1,183 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/03
+//  filename:   Quaternion.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a quaternion
+//
+//
+/*********************************************************************/
+
+#include "Quaternion.h"
+#include "Euler.h"
+#include "RotationMatrix.h"
+#include <math.h>
+#include <stdio.h>
+
+namespace flair {
+namespace core {
+
+Quaternion::Quaternion(float inQ0, float inQ1, float inQ2, float inQ3)
+    : q0(inQ0), q1(inQ1), q2(inQ2), q3(inQ3) {}
+
+Quaternion::~Quaternion() {}
+
+Quaternion &Quaternion::operator=(const Quaternion &quaternion) {
+  q0 = quaternion.q0;
+  q1 = quaternion.q1;
+  q2 = quaternion.q2;
+  q3 = quaternion.q3;
+  return (*this);
+}
+
+float Quaternion::GetNorm(void) const {
+  return sqrt(q0 * q0 + q1 * q1 + q2 * q2 + q3 * q3);
+}
+
+void Quaternion::Normalize(void) {
+  float n = GetNorm();
+  if (n != 0) {
+    q0 = q0 / n;
+    q1 = q1 / n;
+    q2 = q2 / n;
+    q3 = q3 / n;
+  }
+}
+
+void Quaternion::Conjugate(void) {
+  q1 = -q1;
+  q2 = -q2;
+  q3 = -q3;
+}
+
+Quaternion Quaternion::GetConjugate(void) {
+  return Quaternion(q0, -q1, -q2, -q3);
+}
+
+void Quaternion::GetLogarithm(Vector3Df &logarithm) {
+  Normalize();
+  float v_norm = sqrtf(q1 * q1 + q2 * q2 + q3 * q3);
+
+  if (v_norm != 0) {
+    float v_arccos = acosf(q0);
+    logarithm.x = (q1 * v_arccos) / v_norm;
+    logarithm.y = (q2 * v_arccos) / v_norm;
+    logarithm.z = (q3 * v_arccos) / v_norm;
+  } else {
+    logarithm.x = 0;
+    logarithm.y = 0;
+    logarithm.z = 0;
+  }
+}
+
+Vector3Df Quaternion::GetLogarithm(void) {
+  Vector3Df vector;
+  GetLogarithm(vector);
+  return vector;
+}
+
+Quaternion Quaternion::GetDerivative(const Vector3Df &angularSpeed) const {
+  const Quaternion Qw(0, angularSpeed.x, angularSpeed.y, angularSpeed.z);
+  return 0.5 * (*this) * Qw;
+}
+
+void Quaternion::Derivate(const Vector3Df &angularSpeed) {
+  Quaternion Q = GetDerivative(angularSpeed);
+  (*this) = Q;
+}
+
+void Quaternion::ToEuler(Euler &euler) const {
+  euler.roll = atan2(2 * (q0 * q1 + q2 * q3), 1 - 2 * (q1 * q1 + q2 * q2));
+  euler.pitch = asin(2 * (q0 * q2 - q1 * q3));
+  euler.yaw = atan2(2 * (q0 * q3 + q1 * q2), 1 - 2 * (q2 * q2 + q3 * q3));
+}
+
+Euler Quaternion::ToEuler(void) const {
+  Euler euler;
+  ToEuler(euler);
+  return euler;
+}
+
+void Quaternion::ToRotationMatrix(RotationMatrix &matrix) const {
+  float aSq = q0 * q0;
+  float bSq = q1 * q1;
+  float cSq = q2 * q2;
+  float dSq = q3 * q3;
+  matrix.m[0][0] = aSq + bSq - cSq - dSq;
+  matrix.m[0][1] = 2.0f * (q1 * q2 - q0 * q3);
+  matrix.m[0][2] = 2.0f * (q0 * q2 + q1 * q3);
+  matrix.m[1][0] = 2.0f * (q1 * q2 + q0 * q3);
+  matrix.m[1][1] = aSq - bSq + cSq - dSq;
+  matrix.m[1][2] = 2.0f * (q2 * q3 - q0 * q1);
+  matrix.m[2][0] = 2.0f * (q1 * q3 - q0 * q2);
+  matrix.m[2][1] = 2.0f * (q0 * q1 + q2 * q3);
+  matrix.m[2][2] = aSq - bSq - cSq + dSq;
+}
+
+Quaternion &Quaternion::operator+=(const Quaternion &quaternion) {
+  q0 += quaternion.q0;
+  q1 += quaternion.q1;
+  q2 += quaternion.q2;
+  q3 += quaternion.q3;
+  return (*this);
+}
+
+Quaternion &Quaternion::operator-=(const Quaternion &quaternion) {
+  q0 -= quaternion.q0;
+  q1 -= quaternion.q1;
+  q2 -= quaternion.q2;
+  q3 -= quaternion.q3;
+  return (*this);
+}
+
+Quaternion operator+(const Quaternion &quaternionA,
+                     const Quaternion &quaterniontB) {
+  return Quaternion(
+      quaternionA.q0 + quaterniontB.q0, quaternionA.q1 + quaterniontB.q1,
+      quaternionA.q2 + quaterniontB.q2, quaternionA.q3 + quaterniontB.q3);
+}
+
+Quaternion operator-(const Quaternion &quaterniontA,
+                     const Quaternion &quaterniontB) {
+  return Quaternion(
+      quaterniontA.q0 - quaterniontB.q0, quaterniontA.q1 - quaterniontB.q1,
+      quaterniontA.q2 - quaterniontB.q2, quaterniontA.q3 - quaterniontB.q3);
+}
+
+Quaternion operator-(const Quaternion &quaternion) {
+  return Quaternion(-quaternion.q0, -quaternion.q1, -quaternion.q2,
+                    -quaternion.q3);
+}
+
+Quaternion operator*(const Quaternion &quaterniontA,
+                     const Quaternion &quaterniontB) {
+  return Quaternion(
+      quaterniontA.q0 * quaterniontB.q0 - quaterniontA.q1 * quaterniontB.q1 -
+          quaterniontA.q2 * quaterniontB.q2 - quaterniontA.q3 * quaterniontB.q3,
+      quaterniontA.q0 * quaterniontB.q1 + quaterniontA.q1 * quaterniontB.q0 +
+          quaterniontA.q2 * quaterniontB.q3 - quaterniontA.q3 * quaterniontB.q2,
+      quaterniontA.q0 * quaterniontB.q2 - quaterniontA.q1 * quaterniontB.q3 +
+          quaterniontA.q2 * quaterniontB.q0 + quaterniontA.q3 * quaterniontB.q1,
+      quaterniontA.q0 * quaterniontB.q3 + quaterniontA.q1 * quaterniontB.q2 -
+          quaterniontA.q2 * quaterniontB.q1 + quaterniontA.q3 * quaterniontB.q0);
+}
+
+Quaternion operator*(float coeff, const Quaternion &quaternion) {
+  return Quaternion(coeff * quaternion.q0, coeff * quaternion.q1,
+                    coeff * quaternion.q2, coeff * quaternion.q3);
+}
+
+Quaternion operator*(const Quaternion &quaternion, float coeff) {
+  return Quaternion(coeff * quaternion.q0, coeff * quaternion.q1,
+                    coeff * quaternion.q2, coeff * quaternion.q3);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Quaternion.h
===================================================================
--- tags/latest/lib/FlairCore/src/Quaternion.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Quaternion.h	(revision 209)
@@ -0,0 +1,221 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Quaternion.h
+ * \brief Class defining a quaternion
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/03
+ * \version 4.0
+ */
+#ifndef QUATERNION_H
+#define QUATERNION_H
+
+#include <Vector3D.h>
+
+namespace flair {
+namespace core {
+class Euler;
+class RotationMatrix;
+
+/*! \class Quaternion
+*
+* \brief Class defining a quaternion
+*/
+class Quaternion {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a quaternion using specified values.
+  *
+  * \param q0, scalar part
+  * \param q1
+  * \param q2
+  * \param q3
+  */
+  Quaternion(float q0 = 1, float q1 = 0, float q2 = 0, float q3 = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Quaternion();
+
+  /*!
+  * \brief Norm
+  *
+  * \return norm
+  */
+  float GetNorm(void) const;
+
+  /*!
+  * \brief Normalize
+  */
+  void Normalize(void);
+
+  /*!
+  * \brief Logarithm
+  *
+  * This method also Normalize the quaternion.
+  *
+  * \param logarithm output logarithm
+  */
+  void GetLogarithm(Vector3Df &logarithm);
+
+  /*!
+  * \brief Logarithm
+  *
+  * This method also Normalize the quaternion.
+  *
+  * \return output logarithm
+  */
+  Vector3Df GetLogarithm(void);
+
+  /*!
+  * \brief Conjugate
+  */
+  void Conjugate(void);
+
+  /*!
+  * \brief Conjugate
+  *
+  * \return Conjugate
+  */
+  Quaternion GetConjugate(void);
+
+  /*!
+  * \brief Derivative
+  *
+  * \param w angular speed
+  *
+  * \return derivative
+  */
+  Quaternion GetDerivative(const Vector3Df &angularSpeed) const;
+
+  /*!
+  * \brief Derivate
+  *
+  * \param w rotationonal speed
+  */
+  void Derivate(const Vector3Df &angularSpeed);
+
+  /*!
+  * \brief Convert to euler angles
+  *
+  * \param euler output euler angles
+  */
+  void ToEuler(Euler &euler) const;
+
+  /*!
+  * \brief Convert to euler angles
+  *
+  * \return euler angles
+  */
+  Euler ToEuler(void) const;
+
+  /*!
+  * \brief Convert to rotation matrix
+  *
+  * \param m output matrix
+  */
+  void ToRotationMatrix(RotationMatrix &matrix) const;
+
+  /*!
+  * \brief q0
+  */
+  float q0;
+
+  /*!
+  * \brief q1
+  */
+  float q1;
+
+  /*!
+  * \brief q2
+  */
+  float q2;
+
+  /*!
+  * \brief q3
+  */
+  float q3;
+
+  Quaternion &operator+=(const Quaternion &quaternion);
+  Quaternion &operator-=(const Quaternion &quaternion);
+  Quaternion &operator=(const Quaternion &quaternion);
+};
+
+/*! Add
+*
+* \brief Add
+*
+* \param quaterniontA quaternion
+* \param quaterniontB quaternion
+*
+* \return quaterniontA+quaterniontB
+*/
+Quaternion operator+(Quaternion const &quaterniontA,
+                     Quaternion const &quaterniontB);
+
+/*! Substract
+*
+* \brief Substract
+*
+* \param quaterniontA quaternion
+* \param quaterniontB quaternion
+*
+* \return quaterniontA-quaterniontB
+*/
+Quaternion operator-(Quaternion const &quaternionA,
+                     Quaternion const &quaterniontB);
+
+/*! Minus
+*
+* \brief Minus
+*
+* \param quaternion quaternion
+*
+* \return -quaternion
+*/
+Quaternion operator-(const Quaternion &quaternion);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param quaterniontA quaternion
+* \param quaterniontB quaternion
+*
+* \return quaterniontA*quaterniontB
+*/
+Quaternion operator*(Quaternion const &quaternionA,
+                     Quaternion const &quaterniontB);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param coeff coefficient
+* \param quat quaternion
+*
+* \return coeff*quat
+*/
+Quaternion operator*(float coeff, Quaternion const &quaternion);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param quat quaternion
+* \param coeff coefficient
+*
+* \return coeff*quat
+*/
+Quaternion operator*(Quaternion const &quaternion, float coeff);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // QUATERNION_H
Index: tags/latest/lib/FlairCore/src/RTDM_I2cPort.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/RTDM_I2cPort.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/RTDM_I2cPort.cpp	(revision 209)
@@ -0,0 +1,137 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/09/04
+//  filename:   RTDM_RTDM_I2cPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for real time i2c port using RTDM
+//
+//
+/*********************************************************************/
+
+#include "RTDM_I2cPort.h"
+
+#ifdef __XENO__
+
+#include <rtdm/rti2c.h>
+#include <cstring>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+RTDM_I2cPort::RTDM_I2cPort(const Object *parent, string name, string device)
+    : I2cPort(parent, name) {
+  int err = 0;
+  struct rti2c_config write_config;
+
+  // printf("i2c integer le mutex dans le driver, avec acces ioctl\n");
+  fd = rt_dev_open(device.c_str(), 0);
+  if (fd < 0) {
+		char errorMsg[256];
+    Err("rt_dev_open (%s)\n", ObjectName().c_str(), strerror_r(-fd, errorMsg, sizeof(errorMsg)));
+  }
+
+  write_config.config_mask =
+      RTI2C_SET_BAUD | RTI2C_SET_TIMEOUT_RX | RTI2C_SET_TIMEOUT_TX;
+  write_config.baud_rate = 400000;
+  write_config.rx_timeout = 500000;
+  write_config.tx_timeout = 1000000; // 5ms pour les xbldc, normalement 1ms
+  // the rest implicitely remains default
+
+  // config
+  err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG error (%s)\n",
+        ObjectName().c_str(), strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+RTDM_I2cPort::~RTDM_I2cPort() { rt_dev_close(fd); }
+
+int RTDM_I2cPort::SetSlave(uint16_t address) {
+  int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_SLAVE, &address);
+  if (err) {
+		char errorMsg[256];
+    Err("rt_dev_ioctl RTI2C_RTIOC_SET_SLAVE error (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+
+  return err;
+}
+
+void RTDM_I2cPort::SetRxTimeout(Time timeout_ns) {
+  struct rti2c_config write_config;
+
+  write_config.config_mask = RTI2C_SET_TIMEOUT_RX;
+  write_config.rx_timeout = timeout_ns;
+
+  int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG (%s)\n", ObjectName().c_str(),
+        strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+void RTDM_I2cPort::SetTxTimeout(Time timeout_ns) {
+  struct rti2c_config write_config;
+
+  write_config.config_mask = RTI2C_SET_TIMEOUT_TX;
+  write_config.tx_timeout = timeout_ns;
+
+  int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG (%s)\n", ObjectName().c_str(),
+        strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+ssize_t RTDM_I2cPort::Write(const void *buf, size_t nbyte) {
+  return rt_dev_write(fd, buf, nbyte);
+}
+
+ssize_t RTDM_I2cPort::Read(void *buf, size_t nbyte) {
+  return rt_dev_read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
+#else //__XENO__
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace core {
+
+RTDM_I2cPort::RTDM_I2cPort(const Object *parent, string name, string device)
+    : I2cPort(parent, name) {
+  Err("not available in non real time\n");
+}
+
+RTDM_I2cPort::~RTDM_I2cPort() {}
+
+int RTDM_I2cPort::SetSlave(uint16_t address) { return -1; }
+
+void RTDM_I2cPort::SetRxTimeout(Time timeout_ns) {}
+
+void RTDM_I2cPort::SetTxTimeout(Time timeout_ns) {}
+
+ssize_t RTDM_I2cPort::Write(const void *buf, size_t nbyte) { return -1; }
+
+ssize_t RTDM_I2cPort::Read(void *buf, size_t nbyte) { return -1; }
+
+} // end namespace core
+} // end namespace flair
+
+#endif
Index: tags/latest/lib/FlairCore/src/RTDM_I2cPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/RTDM_I2cPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/RTDM_I2cPort.h	(revision 209)
@@ -0,0 +1,102 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RTDM_I2cPort.h
+ * \brief Class for real time i2c port using RTDM
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef RTDM_I2CPORT_H
+#define RTDM_I2CPORT_H
+
+#include <I2cPort.h>
+
+namespace flair {
+namespace core {
+/*! \class RTDM_I2cPort
+*
+* \brief Class for real time i2c port using RTDM
+*
+* This class can only be used with the real time version of Framework library.
+*
+*/
+class RTDM_I2cPort : public I2cPort {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an RTDM i2c port, with the following default values: \n
+  * - 400kbits baudrate \n
+  * - 500000ns RX timeout \n
+  * - 1000000ns TX timeout
+  *
+  * \param parent parent
+  * \param name name
+  * \param device i2c device (ex rti2c1)
+  */
+  RTDM_I2cPort(const Object *parent, std::string name, std::string device);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RTDM_I2cPort();
+
+  /*!
+  * \brief Set slave's address
+  *
+  * This method need to be called before any communication.
+  *
+  * \param address slave's address
+  */
+  int SetSlave(uint16_t address);
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  ssize_t Write(const void *buf, size_t nbyte);
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  ssize_t Read(void *buf, size_t nbyte);
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting an ACK from the slave.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetRxTimeout(Time timeout_ns);
+
+  /*!
+  * \brief Set TX timeout
+  *
+  * Timeout for waiting an ACK from the slave.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetTxTimeout(Time timeout_ns);
+
+private:
+  int fd;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // RTDM_I2CPORT_H
Index: tags/latest/lib/FlairCore/src/RTDM_SerialPort.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/RTDM_SerialPort.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/RTDM_SerialPort.cpp	(revision 209)
@@ -0,0 +1,135 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/25
+//  filename:   RTDM_SerialPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    port serie temps reel
+//
+//
+/*********************************************************************/
+
+#include "RTDM_SerialPort.h"
+
+#ifdef __XENO__
+
+#include <rtdm/rtserial.h>
+#include <cstring>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+RTDM_SerialPort::RTDM_SerialPort(const Object *parent, string name,
+                                 string device)
+    : SerialPort(parent, name) {
+  struct rtser_config write_config;
+
+  write_config.config_mask = RTSER_SET_BAUD | RTSER_SET_TIMESTAMP_HISTORY,
+  write_config.baud_rate = 115200,
+  write_config.timestamp_history = RTSER_DEF_TIMESTAMP_HISTORY,
+  // the rest implicitely remains default
+
+      fd = rt_dev_open(device.c_str(), 0);
+  if (fd < 0) {
+		char errorMsg[256];
+    Err("error rt_dev_open (%s)\n", strerror_r(-fd, errorMsg, sizeof(errorMsg)));
+  }
+
+  // config
+  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+RTDM_SerialPort::~RTDM_SerialPort() { rt_dev_close(fd); }
+
+void RTDM_SerialPort::SetBaudrate(int baudrate) {
+  struct rtser_config write_config;
+
+  write_config.config_mask = RTSER_SET_BAUD;
+  write_config.baud_rate = baudrate;
+  // the rest implicitely remains default
+
+  // config
+  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+void RTDM_SerialPort::SetRxTimeout(core::Time timeout_ns) {
+  struct rtser_config write_config;
+
+  write_config.config_mask = RTSER_SET_TIMEOUT_RX;
+  write_config.rx_timeout = timeout_ns;
+  // the rest implicitely remains default
+
+  // config
+  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
+  if (err) {
+		char errorMsg[256];
+    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+void RTDM_SerialPort::FlushInput(void) {
+  char tmp;
+
+  SetRxTimeout(1000000);
+  while (rt_dev_read(fd, &tmp, 1) == 1)
+    ;
+  SetRxTimeout(TIME_INFINITE);
+}
+
+ssize_t RTDM_SerialPort::Write(const void *buf, size_t nbyte) {
+  return rt_dev_write(fd, buf, nbyte);
+}
+
+ssize_t RTDM_SerialPort::Read(void *buf, size_t nbyte) {
+  return rt_dev_read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
+#else //__XENO__
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace core {
+
+RTDM_SerialPort::RTDM_SerialPort(const Object *parent, string name,
+                                 string device)
+    : SerialPort(parent, name) {
+  Err("not available in non real time\n");
+}
+
+RTDM_SerialPort::~RTDM_SerialPort() {}
+
+ssize_t RTDM_SerialPort::Write(const void *buf, size_t nbyte) { return -1; }
+
+ssize_t RTDM_SerialPort::Read(void *buf, size_t nbyte) { return -1; }
+
+void RTDM_SerialPort::SetBaudrate(int baudrate) {}
+
+void RTDM_SerialPort::SetRxTimeout(core::Time timeout_ns) {}
+
+void RTDM_SerialPort::FlushInput(void) {}
+
+} // end namespace core
+} // end namespace flair
+
+#endif
Index: tags/latest/lib/FlairCore/src/RTDM_SerialPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/RTDM_SerialPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/RTDM_SerialPort.h	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RTDM_SerialPort.h
+ * \brief Class for real time serial port using RTDM
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef RTDM_SERIALPORT_H
+#define RTDM_SERIALPORT_H
+
+#include <SerialPort.h>
+
+namespace flair {
+namespace core {
+/*! \class RTDM_SerialPort
+*
+* \brief Class for real time serial port using RTDM
+*
+* This class can only be used with the real time version of Framework library.
+*
+*/
+class RTDM_SerialPort : public SerialPort {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an RTDM serial port, with the following default values: \n
+  * - 115200bps baudrate
+  *
+  * \param parent parent
+  * \param name name
+  * \param device serial device (ex rtser1)
+  */
+  RTDM_SerialPort(const Object *parent, std::string port_name,
+                  std::string device);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RTDM_SerialPort();
+
+  /*!
+  * \brief Set baudrate
+  *
+  * \param baudrate baudrate
+  *
+  */
+  void SetBaudrate(int baudrate);
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting datas.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetRxTimeout(Time timeout_ns);
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  ssize_t Write(const void *buf, size_t nbyte);
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  ssize_t Read(void *buf, size_t nbyte);
+
+  /*!
+  * \brief Flush input datas
+  *
+  */
+  void FlushInput(void);
+
+private:
+  int fd;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // RTDM_SERIALPORT_H
Index: tags/latest/lib/FlairCore/src/RangeFinderPlot.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/RangeFinderPlot.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/RangeFinderPlot.cpp	(revision 209)
@@ -0,0 +1,67 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/07/23
+//  filename:   RangeFinderPlot.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 2D plot on the ground station for laser range
+//  finder like Hokuyo
+//
+//
+/*********************************************************************/
+
+#include "RangeFinderPlot.h"
+#include "cvmatrix.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include <cxcore.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace gui {
+
+RangeFinderPlot::RangeFinderPlot(const LayoutPosition *position, string name,
+                                 string x_name, float xmin, float xmax,
+                                 string y_name, float ymin, float ymax,
+                                 const cvmatrix *datas, float start_angle,
+                                 float end_angle, uint32_t nb_samples)
+    : SendData(position, name, "RangeFinderPlot", 200) {
+  this->datas = datas;
+
+  SetSendSize(datas->GetDataType().GetSize());
+
+  SetVolatileXmlProp("xmin", xmin);
+  SetVolatileXmlProp("xmax", xmax);
+  SetVolatileXmlProp("ymin", ymin);
+  SetVolatileXmlProp("ymax", ymax);
+  SetVolatileXmlProp("x_name", x_name);
+  SetVolatileXmlProp("y_name", y_name);
+  SetVolatileXmlProp("start_angle", start_angle);
+  SetVolatileXmlProp("end_angle", end_angle);
+  SetVolatileXmlProp("nb_samples", nb_samples);
+  SetVolatileXmlProp(
+      "type", datas->GetDataType().GetElementDataType().GetDescription());
+  SendXml();
+
+  if (datas->Cols() != 1 || datas->Rows() != nb_samples)
+    Err("Wrong input matrix size\n");
+}
+
+RangeFinderPlot::~RangeFinderPlot() {}
+
+void RangeFinderPlot::CopyDatas(char *buf) const {
+  datas->GetMutex();
+  memcpy(buf, datas->getCvMat()->data.ptr, datas->GetDataType().GetSize());
+  datas->ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/RangeFinderPlot.h
===================================================================
--- tags/latest/lib/FlairCore/src/RangeFinderPlot.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/RangeFinderPlot.h	(revision 209)
@@ -0,0 +1,95 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RangeFinderPlot.h
+ * \brief Class displaying a 2D plot on the ground station for laser range
+ * finder like Hokuyo
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/23
+ * \version 4.0
+ */
+
+#ifndef RANGEFINDERPLOT_H
+#define RANGEFINDERPLOT_H
+
+#include <SendData.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+}
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class RangeFinderPlot
+*
+* \brief Class displaying a 2D plot on the ground station for laser range finder
+*like Hokuyo
+*
+*/
+class RangeFinderPlot : public SendData {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a 2D plot at given position. \n
+  * The RangeFinderPlot will automatically be child of position->getLayout()
+  *Layout. After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position to display the plot
+  * \param name name
+  * \param x_name name of x axis
+  * \param xmin default xmin of the plot
+  * \param xmax default xmax of the plot
+  * \param y_name name of y axis
+  * \param ymin default ymin of the plot
+  * \param ymax default ymax of the plot
+  * \param datas laser datas
+  * \param start_angle start angle of the laser
+  * \param end_angle end angle of the laser
+  * \param nb_samples number of samples
+  */
+  RangeFinderPlot(const LayoutPosition *position, std::string name,
+                  std::string x_name, float xmin, float xmax,
+                  std::string y_name, float ymin, float ymax,
+                  const core::cvmatrix *datas, float start_angle,
+                  float end_angle, uint32_t nb_samples);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RangeFinderPlot();
+
+private:
+  /*!
+  * \brief Copy datas to specified buffer
+  *
+  * Reimplemented from SendData.
+  *
+  * \param buf output buffer
+  */
+  void CopyDatas(char *buf) const;
+
+  /*!
+  * \brief Extra Xml event
+  *
+  * Reimplemented from SendData.
+  */
+  void ExtraXmlEvent(void){};
+
+  const core::cvmatrix *datas;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // RANGEFINDERPLOT_H
Index: tags/latest/lib/FlairCore/src/RotationMatrix.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/RotationMatrix.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/RotationMatrix.cpp	(revision 209)
@@ -0,0 +1,121 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/09
+//  filename:   RotationMatrix.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a rotation matrix
+//
+//
+/*********************************************************************/
+
+#include "RotationMatrix.h"
+#include "Object.h"
+#include "Euler.h"
+#include "Quaternion.h"
+#include "math.h"
+
+using std::max;
+
+namespace flair {
+namespace core {
+
+RotationMatrix::RotationMatrix() {
+  for (int i = 0; i < 3; i++) {
+    for (int j = 0; j < 3; j++) {
+      if (i == j) {
+        m[i][j] = 1;
+      } else {
+        m[i][j] = 0;
+      }
+    }
+  }
+}
+
+RotationMatrix::~RotationMatrix() {}
+
+void RotationMatrix::ToEuler(Euler &euler) const {
+  euler.roll = atanf(m[1][2] / m[2][2]);
+  euler.pitch = asinf(-m[0][2]);
+  euler.yaw = atan2f(m[0][1], m[0][0]);
+}
+
+Euler RotationMatrix::ToEuler(void) const {
+  Euler euler;
+  ToEuler(euler);
+  return euler;
+}
+
+//from 3dmgx3-25 manual
+void RotationMatrix::ToQuaternion(Quaternion &quaternion) const {
+  float test1 = m[0][0] + m[1][1] + m[2][2];
+  float test2 = m[0][0] - m[1][1] - m[2][2];
+  float test3 = -m[0][0] + m[1][1] - m[2][2];
+  float test4 = -m[0][0] - m[1][1] + m[2][2];
+
+  if(test1==max(max(test1,test2),max(test3,test4))) {
+    float s=2*sqrtf(1+test1);
+    quaternion.q0 = s/4.;
+    quaternion.q1 = ( m[1][2] - m[2][1] ) / s;
+    quaternion.q2 = ( m[2][0] - m[0][2] ) / s;
+    quaternion.q3 = ( m[0][1] - m[1][0] ) / s;
+  }
+
+  if(test2==max(max(test1,test2),max(test3,test4))) {
+    float s=2*sqrtf(1+test2);
+    quaternion.q0 = ( m[2][1] - m[1][2] ) / s;
+    quaternion.q1 = -s/4.;
+    quaternion.q2 = -( m[1][0] + m[0][1] ) / s;
+    quaternion.q3 = -( m[0][2] + m[2][0] ) / s;
+  }
+
+  if(test3==max(max(test1,test2),max(test3,test4))) {
+    float s=2*sqrtf(1+test3);
+    quaternion.q0 = (m[0][2] - m[2][0] ) / s;
+    quaternion.q1 = -( m[1][0] + m[0][1] ) / s;
+    quaternion.q2 = -s/4.;
+    quaternion.q3 = -( m[2][1] + m[1][2] ) / s;
+  }
+
+  if(test4==max(max(test1,test2),max(test3,test4))) {
+    float s=2*sqrtf(1+test4);
+    quaternion.q0 = (m[1][0] - m[0][1] ) / s;
+    quaternion.q1 = -( m[0][2] + m[2][0] ) / s;
+    quaternion.q2 = -( m[2][1] + m[1][2] ) / s;
+    quaternion.q3 = -s/4.;
+  }
+  quaternion.Normalize();
+}
+
+Quaternion RotationMatrix::ToQuaternion(void) const {
+  Quaternion quaternion;
+  ToQuaternion(quaternion);
+  return quaternion;
+}
+
+float &RotationMatrix::operator()(size_t row, size_t col) {
+  if (row < 3 && col < 3) {
+    return m[row][col];
+  } else {
+    Printf("RotationMatrix: index (%i,%i) out of bound\n", row, col);
+    return m[2][2];
+  }
+}
+
+const float &RotationMatrix::operator()(size_t row, size_t col) const {
+  if (row < 3 && col < 3) {
+    return m[row][col];
+  } else {
+    Printf("RotationMatrix: index (%i,%i) out of bound\n", row, col);
+    return m[2][2];
+  }
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/RotationMatrix.h
===================================================================
--- tags/latest/lib/FlairCore/src/RotationMatrix.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/RotationMatrix.h	(revision 209)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RotationMatrix.h
+ * \brief Class defining a rotation matrix
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/09
+ * \version 4.0
+ */
+#ifndef ROTATIONMATRIX_H
+#define ROTATIONMATRIX_H
+
+#include <stddef.h>
+
+namespace flair {
+namespace core {
+class Euler;
+class Quaternion;
+
+/*! \class RotationMatrix
+*
+* \brief Class defining a rotation matrix
+*/
+class RotationMatrix {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an identity rotation matrix
+  *
+  */
+  RotationMatrix();
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RotationMatrix();
+
+  /*!
+  * \brief Convert to euler angles
+  *
+  * \param euler output euler angles
+  */
+  void ToEuler(Euler &euler) const;
+
+  /*!
+  * \brief Convert to euler angles
+  *
+  * \return euler angles
+  */
+  Euler ToEuler(void) const;
+
+  /*!
+  * \brief Convert to quaternion
+  *
+  * \param quaternion output quaternion
+  */
+  void ToQuaternion(Quaternion &quaternion) const;
+
+  /*!
+  * \brief Convert to quaternion
+  *
+  * \return quaternion
+  */
+  Quaternion ToQuaternion(void) const;
+
+  /*!
+  * \brief matrix
+  *
+  */
+  float m[3][3];
+
+  float &operator()(size_t row, size_t col);
+  const float &operator()(size_t row, size_t col) const;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // ROTATIONMATRIX_H
Index: tags/latest/lib/FlairCore/src/Semaphore.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Semaphore.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Semaphore.cpp	(revision 209)
@@ -0,0 +1,39 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/11/16
+//  filename:   Semaphore.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a semaphore
+//
+//
+/*********************************************************************/
+
+#include "Semaphore.h"
+#include "Semaphore_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Semaphore::Semaphore(const Object *parent, uint32_t initialValue, string name)
+    : Object(parent, name, "semaphore") {
+  pimpl_ = new Semaphore_impl(this, initialValue);
+}
+
+Semaphore::~Semaphore() { delete pimpl_; }
+
+bool Semaphore::TryGetSemaphore() const { return pimpl_->TryGetSemaphore(); }
+bool Semaphore::GetSemaphore(Time timeout) const { return pimpl_->GetSemaphore(timeout); }
+
+bool Semaphore::ReleaseSemaphore(void) const { return pimpl_->ReleaseSemaphore(); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Semaphore.h
===================================================================
--- tags/latest/lib/FlairCore/src/Semaphore.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Semaphore.h	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Semaphore.h
+ * \brief Class defining a semaphore
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/11/16
+ * \version 1.0
+ */
+
+#ifndef SEMAPHORE_H
+#define SEMAPHORE_H
+
+#include <Object.h>
+
+class Semaphore_impl;
+class ConditionVariable_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class Semaphore
+*
+* \brief Class defining a semaphore
+*
+*/
+class Semaphore : public Object {
+  friend class ::ConditionVariable_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a semaphore.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Semaphore(const Object *parent, uint32_t initialValue, std::string name = "");
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Semaphore();
+
+  /*!
+  * \brief TryGetSemaphore
+  *
+  * Lock the semaphore. If not possible immediately returns false
+  *
+  */
+  bool TryGetSemaphore() const;
+
+  /*!
+  * \brief GetSemaphore
+  *
+  * Lock the semaphore.
+  * 
+  * \param timeout The timeout, in nanoseconds.
+  */
+  bool GetSemaphore(Time timeout = TIME_INFINITE) const;
+
+  /*!
+  * \brief ReleaseSemaphore
+  *
+  * Unlock the semaphore.
+  *
+  */
+  bool ReleaseSemaphore(void) const;
+
+private:
+  class Semaphore_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SEMAPHORE_H
Index: tags/latest/lib/FlairCore/src/Semaphore_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Semaphore_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Semaphore_impl.cpp	(revision 209)
@@ -0,0 +1,111 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/11/16
+//  filename:   Semaphore_impl.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a semaphore implementation
+//
+//
+/*********************************************************************/
+
+#include "Semaphore.h"
+#include "Semaphore_impl.h"
+
+#include <string.h>
+#include <time.h>
+
+using std::string;
+using namespace flair::core;
+
+Semaphore_impl::Semaphore_impl(Semaphore *self, uint32_t initialValue) {
+  this->self = self;
+  int status;
+	char errorMsg[256];
+	
+#ifdef __XENO__
+  status = rt_sem_create(&semaphore, NULL, initialValue, S_FIFO);
+#else
+  status = sem_init(&semaphore, 0, initialValue);
+#endif
+  if (status != 0) {
+    self->Err("error creating semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+Semaphore_impl::~Semaphore_impl() {
+  int status;
+	char errorMsg[256];
+	
+#ifdef __XENO__
+  status = rt_sem_delete(&semaphore);
+#else
+  status = sem_destroy(&semaphore);
+#endif
+  if (status != 0)
+    self->Err("error destroying semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+}
+
+bool Semaphore_impl::TryGetSemaphore() {
+#ifdef __XENO__
+  return !rt_sem_p(&semaphore, TM_NONBLOCK);
+#else
+  return !sem_trywait(&semaphore);
+#endif
+}
+
+bool Semaphore_impl::GetSemaphore(Time timeout) {
+  int status;
+  bool returnValue = true;
+#ifdef __XENO__
+  status = rt_sem_p(&semaphore, timeout);
+#else
+  if (timeout != 0) {
+    struct timespec semTimeout;
+    clock_gettime(CLOCK_REALTIME, &semTimeout);
+    semTimeout.tv_sec += timeout / 1000000000ULL;
+    semTimeout.tv_nsec += timeout % 1000000000ULL;
+    if (semTimeout.tv_nsec >= 1000000000ULL) {
+    	semTimeout.tv_sec++;
+    	semTimeout.tv_nsec -= 1000000000ULL;
+    }
+    status = sem_timedwait(&semaphore, &semTimeout);
+  } else {
+    status = sem_wait(&semaphore);
+  }
+#endif
+  	if (status != 0) {
+  		if (errno == ETIMEDOUT) {
+#ifdef DEBUG
+  		  	self->Warn("warning : semaphore timedout\n");
+#endif
+  		} else {
+					char errorMsg[256];
+  		    self->Err("error getting the semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  		}
+    returnValue = false;
+  }
+  return returnValue;
+}
+
+bool Semaphore_impl::ReleaseSemaphore(void) {
+  int status;
+  bool returnValue = true;
+#ifdef __XENO__
+  status = rt_sem_v(&semaphore);
+#else
+  status = sem_post(&semaphore);
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("error releasing the semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    returnValue = false;
+  }
+  return returnValue;
+}
Index: tags/latest/lib/FlairCore/src/SendData.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/SendData.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/SendData.cpp	(revision 209)
@@ -0,0 +1,119 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/07
+//  filename:   SendData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for sending datas to ground station
+//
+//
+/*********************************************************************/
+
+#include "SendData.h"
+#include "SendData_impl.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+
+using namespace std;
+using namespace flair::core;
+
+namespace flair {
+namespace gui {
+
+SendData::SendData(const LayoutPosition *position, string name, string type,
+                   uint16_t default_periodms, bool default_enabled)
+    : Widget(position->getLayout(), name, type) {
+  pimpl_ = new SendData_impl();
+
+  pimpl_->send_size = 0;
+
+  // default refesh rate: (ms)
+  pimpl_->send_period = default_periodms;
+  pimpl_->is_enabled = default_enabled;
+
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  GetPersistentXmlProp("period", pimpl_->send_period);
+  SetPersistentXmlProp("period", pimpl_->send_period);
+  GetPersistentXmlProp("enabled", pimpl_->is_enabled);
+  SetPersistentXmlProp("enabled", pimpl_->is_enabled);
+
+  delete position;
+
+  if (getUiCom() != NULL) {
+    // register SendData for sending to ground station
+    getUiCom()->AddSendData(this);
+    // resume if necessary
+    getUiCom()->UpdateSendData(this);
+  }
+}
+
+SendData::~SendData() {
+  if (getUiCom() != NULL) {
+    // unregister SendData for sending to ground station
+    getUiCom()->RemoveSendData(this);
+  }
+
+  delete pimpl_;
+}
+
+void SendData::XmlEvent(void) {
+  uint16_t send_period;
+  bool is_enabled;
+  bool something_changed = false;
+
+  if (GetPersistentXmlProp("period", send_period) &&
+      GetPersistentXmlProp("enabled", is_enabled)) {
+    if (send_period != SendPeriod())
+      something_changed = true;
+    if (is_enabled != IsEnabled())
+      something_changed = true;
+  }
+
+  if (something_changed) {
+    getFrameworkManager()->BlockCom();
+
+    SetSendPeriod(send_period);
+    SetEnabled(is_enabled);
+
+    getFrameworkManager()->UpdateSendData(this);
+
+    // ack pour la station sol
+    // period and enabled are already in persistent prop
+    SetVolatileXmlProp("period", send_period);
+    SetVolatileXmlProp("enabled", is_enabled);
+    SendXml();
+
+    getFrameworkManager()->UnBlockCom();
+  }
+
+  ExtraXmlEvent();
+}
+
+size_t SendData::SendSize(void) const { return pimpl_->send_size; }
+
+uint16_t SendData::SendPeriod(void) const { return pimpl_->send_period; }
+
+bool SendData::IsEnabled(void) const { return pimpl_->is_enabled; }
+
+void SendData::SetEnabled(bool value) { pimpl_->is_enabled = value; }
+
+void SendData::SetSendSize(size_t value) {
+  pimpl_->send_size = value;
+
+  if (getUiCom() != NULL)
+    getUiCom()->UpdateDataToSendSize();
+}
+
+void SendData::SetSendPeriod(uint16_t value) { pimpl_->send_period = value; }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/SendData.h
===================================================================
--- tags/latest/lib/FlairCore/src/SendData.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/SendData.h	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SendData.h
+ * \brief Abstract class for sending datas to ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/07
+ * \version 4.0
+ */
+
+#ifndef SENDDATA_H
+#define SENDDATA_H
+
+#include <Widget.h>
+
+class SendData_impl;
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class SendData
+*
+* \brief Abstract class for sending datas to ground station
+*
+*/
+class SendData : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  */
+  SendData(const LayoutPosition *position, std::string name, std::string type,
+           uint16_t default_periodms = 100, bool default_enabled = false);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  virtual ~SendData();
+
+  /*!
+  * \brief Copy datas to specified buffer
+  *
+  * This method must be reimplemented, in order to send datas to ground station.
+  *
+  * \param buf output buffer
+  */
+  virtual void CopyDatas(char *buf) const = 0;
+
+  size_t SendSize(void) const;
+  uint16_t SendPeriod(void) const; // in ms
+  bool IsEnabled(void) const;
+
+protected:
+  /*!
+  * \brief Notify that SenData's datas have changed
+  *
+  * This method must be called when the datas have changed. \n
+  * Normally, it occurs when a curve is added to a plot for example. \n
+  * This method automatically blocks and unblocks the communication.
+  *
+  */
+  void SetSendSize(size_t value);
+
+  /*!
+  * \brief Extra Xml event
+  *
+  * This method must be reimplemented to handle extra xml event. \n
+  * It is automatically called when something changed from
+  * ground station, through XmlEvent method. \n
+  */
+  virtual void ExtraXmlEvent(void) = 0;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget. \n
+  * This method handles period and enabled properties of the SendData. \n
+  * Then it calls ExtraXmlEvent to handle specific xml events of reimplemented
+  *class.
+  *
+  */
+  void XmlEvent(void);
+
+  void SetSendPeriod(uint16_t value);
+  void SetEnabled(bool value);
+
+  class SendData_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SENDDATA_H
Index: tags/latest/lib/FlairCore/src/SendData_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/SendData_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/SendData_impl.cpp	(revision 209)
@@ -0,0 +1,22 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/07
+//  filename:   SendData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for sending datas to ground station
+//
+//
+/*********************************************************************/
+
+#include "SendData_impl.h"
+
+SendData_impl::SendData_impl() {}
+
+SendData_impl::~SendData_impl() {}
Index: tags/latest/lib/FlairCore/src/SerialPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/SerialPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/SerialPort.h	(revision 209)
@@ -0,0 +1,89 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SerialPort.h
+ * \brief Base class for serial port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/25
+ * \version 4.0
+ */
+
+#ifndef SERIALPORT_H
+#define SERIALPORT_H
+
+#include <Object.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+/*! \class SerialPort
+*
+* \brief Base class for serial port
+*/
+class SerialPort : public Object {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a serial port.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  SerialPort(const Object *parent, std::string name) : Object(parent, name) {}
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SerialPort(){};
+
+  /*!
+  * \brief Set baudrate
+  *
+  * \param baudrate baudrate
+  *
+  */
+  virtual void SetBaudrate(int baudrate) = 0;
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting datas.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  virtual void SetRxTimeout(Time timeout_ns) = 0;
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  virtual ssize_t Write(const void *buf, size_t nbyte) = 0;
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  virtual ssize_t Read(void *buf, size_t nbyte) = 0;
+
+  /*!
+  * \brief Flush input datas
+  *
+  */
+  virtual void FlushInput(void) = 0;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // SERIALPORT_H
Index: tags/latest/lib/FlairCore/src/SharedMem.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/SharedMem.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/SharedMem.cpp	(revision 209)
@@ -0,0 +1,47 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/10
+//  filename:   SharedMem.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a shared memory
+//
+//
+/*********************************************************************/
+
+#include "SharedMem.h"
+#include "SharedMem_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+SharedMem::SharedMem(const Object *parent, string name, size_t size, Type type)
+    : Object(parent, name, "shmem"), type(type) {
+  pimpl_ = new SharedMem_impl(this, name, size, type);
+}
+
+SharedMem::~SharedMem() { delete pimpl_; }
+
+void SharedMem::Write(const char *buf, size_t size) {
+  pimpl_->Write(buf, size);
+}
+
+bool SharedMem::Read(char *buf, size_t size, Time nsTimeout) const {
+  return pimpl_->Read(buf, size, nsTimeout);
+}
+
+void SharedMem::ReaderReady() {
+  if (type==Type::producerConsumer) pimpl_->ReaderReady();
+  else Warn("Function called for a non producerConsumer\n");
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/SharedMem.h
===================================================================
--- tags/latest/lib/FlairCore/src/SharedMem.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/SharedMem.h	(revision 209)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SharedMem.h
+ * \brief Class defining a shared memory
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/10
+ * \version 4.0
+ */
+
+#ifndef SHAREDMEM_H
+#define SHAREDMEM_H
+
+#include <Object.h>
+#include <semaphore.h>
+
+class SharedMem_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class SharedMem
+*
+* \brief Class defining a shared memory
+*
+* Shared memory is identified by its name so it can be accessed
+* by another process using its name.
+*/
+
+class SharedMem : public Object {
+public:
+  enum class Type { mutex, producerConsumer };
+  /*!
+  * \brief Constructor
+  *
+  * Construct a shared memory object
+  *
+  * \param parent parent
+  * \param name name
+  * \param size size of the shared memory
+  * \param blockOnRead if true reading will block if nothing written
+  */
+  SharedMem(const Object *parent, std::string name, size_t size, Type type=Type::mutex);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SharedMem();
+
+  /*!
+  * \brief Write
+  *
+  * \param buf input buffer to write to memory
+  * \param size buffer size
+  */
+  void Write(const char *buf, size_t size);
+
+  /*!
+  * \brief Read
+  *
+  * \param buf output buffer to write from memory
+  * \param size buffer size
+  */
+  bool Read(char *buf, size_t size, Time nsTimeout=TIME_INFINITE) const;
+
+
+  /*!
+  * \brief This function should be called when reader is ready (in case of a SharedMem of type producerConsumer)
+  */
+   void ReaderReady();
+private:
+  SharedMem_impl *pimpl_;
+  Type type;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SHAREDMEM_H
Index: tags/latest/lib/FlairCore/src/SharedMem_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/SharedMem_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/SharedMem_impl.cpp	(revision 209)
@@ -0,0 +1,136 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/10
+//  filename:   SharedMem_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a shared memory
+//
+//
+/*********************************************************************/
+
+#include "SharedMem_impl.h"
+#include "SharedMem.h"
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+SharedMem_impl::SharedMem_impl(const SharedMem *self, string name, size_t size, SharedMem::Type &type):self(self),type(type),size(size),
+                               sem(self,1,"/" + name + "_mutex"), sem_producer(self,0,"/" + name + "_producer"),sem_consumer(self,0,"/" + name + "_consumer") {
+
+  char errorMsg[256];
+
+#ifdef __XENO__
+  heap_binded = false;
+  int status = rt_heap_create(&heap, name.c_str(), size,
+                              H_SHARED | H_FIFO | H_NONCACHED);
+  if (status == -EEXIST) {
+    heap_binded = true;
+    status = rt_heap_bind(&heap, name.c_str(), TM_INFINITE);
+  }
+  if (status != 0) {
+    self->Err("rt_heap_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    return;
+  }
+
+  void *ptr;
+  status = rt_heap_alloc(&heap, 0, TM_NONBLOCK, &ptr);
+  if (status != 0) {
+    self->Err("rt_heap_alloc error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+  mem_segment = (char *)ptr;
+
+#else
+  shm_name = "/" + name;
+  fd = shm_open(shm_name.c_str(), O_RDWR | O_CREAT, 0666);
+  if (fd == -1) {
+    self->Err("Error creating shared memory\n");
+  }
+  ftruncate(fd, size);
+
+  mem_segment = (char *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+  if (mem_segment == MAP_FAILED) {
+    self->Err("Failed to map memory\n");
+  }
+#endif
+}
+
+SharedMem_impl::~SharedMem_impl() {
+  int status;
+	char errorMsg[256];
+	
+#ifdef __XENO__
+
+  if (heap_binded == false) {
+    status = rt_heap_delete(&heap);
+    if (status != 0) {
+      self->Err("rt_heap_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+  }
+
+#else
+  status = munmap(mem_segment, size);
+  if (status != 0) {
+    self->Err("Failed to unmap memory (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+
+  status = close(fd);
+  if (status != 0) {
+    self->Err("Failed to close file (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+
+  // do not check errors as it can be done by another process
+  status = shm_unlink(shm_name.c_str()); /*
+   if(status!=0)
+   {
+       self->Err("Failed to unlink memory (%s)\n",strerror_r(-status, errorMsg, sizeof(errorMsg)));
+   }
+*/
+#endif
+}
+
+void SharedMem_impl::ReaderReady() {
+  sem_consumer.ReleaseSemaphore();
+}
+
+void SharedMem_impl::Write(const char *buf, size_t size) {
+  if (type==SharedMem::Type::mutex) {
+    sem.GetSemaphore();
+    memcpy(mem_segment, buf, size);
+    sem.ReleaseSemaphore();
+  } else if (type==SharedMem::Type::producerConsumer) {
+    //wait until consumer took the data away before writting a new one
+    //but should not block if nobody's there to read
+    if (sem_consumer.TryGetSemaphore()) {
+      memcpy(mem_segment, buf, size);
+      sem_producer.ReleaseSemaphore();
+    }
+  }
+}
+
+bool SharedMem_impl::Read(char *buf, size_t size, Time nsTimeout) {
+  if (type==SharedMem::Type::mutex) {
+    if (sem.GetSemaphore()) {
+      memcpy(buf, mem_segment, size);
+      sem.ReleaseSemaphore();
+      return true;
+    }
+  } else if (type==SharedMem::Type::producerConsumer) {
+    if (sem_producer.GetSemaphore(nsTimeout)) {
+      memcpy(buf, mem_segment, size);
+      sem_consumer.ReleaseSemaphore();
+      return true;
+    }
+  }
+  return false;
+}
Index: tags/latest/lib/FlairCore/src/SpinBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/SpinBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/SpinBox.cpp	(revision 209)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   SpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QSpinBox on the ground station
+//
+//
+/*********************************************************************/
+
+#include "SpinBox.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+SpinBox::SpinBox(const LayoutPosition *position, string name, int min, int max,
+                 int step, int default_value)
+    : Box(position, name, "SpinBox") {
+  // update value from xml file
+  if (default_value < min)
+    default_value = min;
+  if (default_value > max)
+    default_value = max;
+  box_value = default_value;
+
+  SetVolatileXmlProp("min", min);
+  SetVolatileXmlProp("max", max);
+  SetVolatileXmlProp("step", step);
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", box_value);
+
+  SendXml();
+}
+
+SpinBox::SpinBox(const LayoutPosition *position, string name, string suffix,
+                 int min, int max, int step, int default_value)
+    : Box(position, name, "SpinBox") {
+  // update value from xml file
+  if (default_value < min)
+    default_value = min;
+  if (default_value > max)
+    default_value = max;
+  box_value = default_value;
+
+  SetVolatileXmlProp("suffix", suffix);
+  SetVolatileXmlProp("min", min);
+  SetVolatileXmlProp("max", max);
+  SetVolatileXmlProp("step", step);
+  GetPersistentXmlProp("value", box_value);
+  SetPersistentXmlProp("value", box_value);
+  SendXml();
+}
+
+SpinBox::~SpinBox() {}
+
+int SpinBox::Value(void) const {
+  int tmp;
+
+  GetMutex();
+  tmp = box_value;
+  ReleaseMutex();
+
+  return tmp;
+}
+
+void SpinBox::XmlEvent(void) {
+  GetMutex();
+  if (GetPersistentXmlProp("value", box_value))
+    SetValueChanged();
+  ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/SpinBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/SpinBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/SpinBox.h	(revision 209)
@@ -0,0 +1,90 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SpinBox.h
+ * \brief Class displaying a QSpinBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef SPINBOX_H
+#define SPINBOX_H
+
+#include <Box.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class SpinBox
+*
+* \brief Class displaying a QSpinBox on the ground station
+*
+*/
+class SpinBox : public Box {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QSpinBox at given position. \n
+  * The QSpinBox is saturated to min and max values.
+  *
+  * \param position position to display the QSpinBox
+  * \param name name
+  * \param min minimum value
+  * \param max maximum value
+  * \param step step
+  * \param default_value default value if not in the xml config file
+  */
+  SpinBox(const LayoutPosition *position, std::string name, int min, int max,
+          int step, int default_value = 0); /*!
+
+* \brief Constructor
+*
+* Construct a QSpinBox at given position. \n
+* The QSpinBox is saturated to min and max values.
+*
+* \param position position to display the QSpinBox
+* \param name name
+* \param suffix suffix for the value (eg unit)
+* \param min minimum value
+* \param max maximum value
+* \param step step
+* \param default_value default value if not in the xml config file
+*/
+  SpinBox(const LayoutPosition *position, std::string name, std::string suffix,
+          int min, int max, int step, int default_value = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SpinBox();
+
+  /*!
+   * \brief Value
+   *
+   * \return value
+   */
+  int Value(void) const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  int box_value;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // SPINBOX_H
Index: tags/latest/lib/FlairCore/src/Tab.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Tab.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Tab.cpp	(revision 209)
@@ -0,0 +1,34 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   Tab.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTab on the ground station
+//
+//
+/*********************************************************************/
+#include "Tab.h"
+#include "TabWidget.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+Tab::Tab(const TabWidget *parent, string name, int position)
+    : Layout(parent, name, "Tab") {
+  SetVolatileXmlProp("position", position);
+  SendXml();
+}
+
+Tab::~Tab() {}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Tab.h
===================================================================
--- tags/latest/lib/FlairCore/src/Tab.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Tab.h	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Tab.h
+ * \brief Class displaying a QTab on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef TAB_H
+#define TAB_H
+
+#include <Layout.h>
+
+namespace flair {
+namespace gui {
+
+class TabWidget;
+
+/*! \class Tab
+*
+* \brief Class displaying a QTab on the ground station
+*
+* Tabs are displayed in a TabWidget.
+*/
+class Tab : public Layout {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Tab in the TabWidget.
+  *
+  * \param parent parent
+  * \param name name
+  * \param position tab position, -1 to put at the last position
+  */
+  Tab(const TabWidget *parent, std::string name, int position = -1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Tab();
+
+private:
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // TAB_H
Index: tags/latest/lib/FlairCore/src/TabWidget.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/TabWidget.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/TabWidget.cpp	(revision 209)
@@ -0,0 +1,41 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/07/30
+//  filename:   TabWidget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTabWidget on the ground station
+//
+//
+/*********************************************************************/
+#include "TabWidget.h"
+#include "Tab.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+TabWidget::TabWidget(const LayoutPosition *position, string name,
+                     TabPosition_t tabPosition)
+    : Widget(position->getLayout(), name, "TabWidget") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  SetVolatileXmlProp("position", (int)tabPosition);
+  SendXml();
+
+  delete position;
+}
+
+TabWidget::~TabWidget() {}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/TabWidget.h
===================================================================
--- tags/latest/lib/FlairCore/src/TabWidget.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/TabWidget.h	(revision 209)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TabWidget.h
+ * \brief Class displaying a QTabWidget on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/07/30
+ * \version 4.0
+ */
+
+#ifndef TABWIDGET_H
+#define TABWIDGET_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+
+/*! \class TabWidget
+*
+* \brief Class displaying a QTabWidget on the ground station
+*
+* TabWidget contains Tabs.
+*
+*/
+class TabWidget : public Widget {
+public:
+  /*!
+  * \enum TabPosition_t
+  * \brief Position of tabs
+  */
+  typedef enum {
+    North /*! north */,
+    South /*! south */,
+    West /*! west */,
+    East /*! east */
+  } TabPosition_t;
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QTabWidget at given position. \n
+  * The TabWidget will automatically be child of position->getLayout() Layout.
+  *After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param position position
+  * \param name name
+  * \param tabPosition position of tabs
+  */
+  TabWidget(const LayoutPosition *position, std::string name,
+            TabPosition_t tabPosition = TabWidget::West);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~TabWidget();
+
+private:
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // TABWIDGET_H
Index: tags/latest/lib/FlairCore/src/TcpSocket.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/TcpSocket.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/TcpSocket.cpp	(revision 209)
@@ -0,0 +1,247 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/28
+//  filename:   TcpSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a TCP socket
+//
+//
+/*********************************************************************/
+#include "TcpSocket.h"
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+TcpSocket::TcpSocket(const Object *parent, const std::string name,
+                     bool _blockOnSend, bool _blockOnReceive)
+    : ConnectedSocket(parent, name), isConnected(false) {
+  blockOnSend = _blockOnSend;
+  blockOnReceive = _blockOnReceive;
+}
+
+TcpSocket::~TcpSocket() {
+  // Info("Debug: destroying TCP socket %s", ObjectName().c_str());
+  close(socket);
+}
+
+void TcpSocket::Listen(const unsigned int port,
+                       const std::string localAddress) {
+  socket = ::socket(AF_INET, SOCK_STREAM, 0);
+
+  sockaddr_in my_addr;
+  my_addr.sin_family = AF_INET;
+  my_addr.sin_port = htons(port);
+  if (localAddress == "ANY") {
+    my_addr.sin_addr.s_addr = INADDR_ANY;
+  } else {
+    inet_aton(localAddress.c_str(), &(my_addr.sin_addr));
+  }
+  memset(&(my_addr.sin_zero), '\0', 8);
+
+  if (bind(socket, (sockaddr *)&my_addr, sizeof(my_addr)) < 0) {
+    char errorMsg[256];
+    Err("TCP bind, %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+  }
+
+  listen(socket, 1);
+}
+
+TcpSocket *TcpSocket::Accept(Time timeout) {
+  char errorMsg[256];
+  TcpSocket *acceptedSocket = nullptr;
+
+  struct timeval tv;
+  if (timeout != 0) {
+    tv.tv_sec = timeout / 1000; // timeout is in ms
+    tv.tv_usec = (timeout % 1000) * 1000;
+  }
+  fd_set rset;
+  FD_ZERO(&rset);
+  FD_SET(socket, &rset);
+  int ret = select(socket + 1, &rset, nullptr, nullptr,
+                   (timeout == 0) ? nullptr : &tv); // man 2 accept
+  if (ret < 0) {
+    Err("select: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+  } else {
+    if (ret == 0) {
+      // timeout reached
+      // Err("timeout reached\n");
+    } else {
+      // our socket is readable, a new connection can be accepted
+      acceptedSocket = new TcpSocket(this->Parent(), this->ObjectName(),
+                                     blockOnSend, blockOnReceive);
+      sockaddr_in their_addr;
+      socklen_t namelen = sizeof(their_addr);
+      if ((acceptedSocket->socket =
+               accept(socket, (sockaddr *)&their_addr, &namelen)) < 0) {
+        Err("error: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+        delete acceptedSocket;
+        acceptedSocket = nullptr;
+      }
+    }
+  }
+
+  return acceptedSocket;
+}
+
+bool TcpSocket::Connect(const unsigned int distantPort,
+                        const std::string distantAddress, Time timeout) {
+  bool success = false;
+  char errorMsg[256];
+
+  if (isConnected) {
+    if (this->distantPort == distantPort &&
+        this->distantAddress == distantAddress) {
+      return true;
+    } else {
+      close(socket);
+    }
+  }
+  socket = ::socket(AF_INET, SOCK_STREAM, 0);
+  if (socket == -1)
+    return false;
+
+  sockaddr_in serv_addr;
+  serv_addr.sin_family = AF_INET;
+  serv_addr.sin_port = htons(short(distantPort));
+  if (inet_pton(AF_INET, distantAddress.c_str(), &serv_addr.sin_addr) <= 0) {
+    printf("incorrect network address.");
+    close(socket);
+    return false;
+  }
+  memset(&(serv_addr.sin_zero), '\0', 8);
+
+  // go non blocking
+  int flags = fcntl(socket, F_GETFL);
+  fcntl(socket, F_SETFL, flags | O_NONBLOCK);
+  if (connect(socket, (sockaddr *)&serv_addr, sizeof(serv_addr)) == -1) {
+    if ((errno != EINPROGRESS) && (errno != EAGAIN)) {
+      Err("socket connect: %s\n",
+          strerror_r(errno, errorMsg, sizeof(errorMsg)));
+      success = false;
+    } else {
+      // now block with a timeout
+      struct timeval tv;
+      if (timeout != 0) {
+        tv.tv_sec = timeout / 1000; // timeout is in ms
+        tv.tv_usec = (timeout % 1000) * 1000;
+      }
+      fd_set wset;
+      FD_ZERO(&wset);
+      FD_SET(socket, &wset);
+      int ret =
+          select(socket + 1, NULL, &wset, NULL,
+                 (timeout == 0) ? NULL : &tv); // man 2 connect EINPROGRESS
+      if (ret < 0) {
+        Err("select: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+        success = false;
+      } else {
+        if (ret == 0) {
+          // timeout reached
+          // Err("timeout reached\n");
+          success = false;
+        } else {
+          // something happened on our socket. Check if an error occured
+          int error;
+          socklen_t len = sizeof(error);
+          if (getsockopt(socket, SOL_SOCKET, SO_ERROR, &error, &len) != 0) {
+            // Err("getsockopt:
+            // %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+            success = false;
+          } else if (error != 0) {
+            // Err("socket error:
+            // %d(%s)\n",error,strerror_r(error,errorMsg,sizeof(errorMsg)));
+            success = false;
+          } else {
+            if (connect(socket, (sockaddr *)&serv_addr, sizeof(serv_addr)) ==
+                -1) {
+              success = false;
+            } else {
+              // Info("connected indeed ^^\n");
+              success = true;
+            }
+          }
+        }
+      }
+    }
+  } else {
+    success = true; // never reached suprisingly...
+  }
+  // switch back to blocking mode (default)
+  fcntl(socket, F_SETFL, flags);
+
+  if (!success) {
+    close(socket);
+    // Info("Debug: Connect to %s:%d failed\n", distantAddress.c_str(),
+    // distantPort);
+    return false;
+  } else {
+    isConnected = true;
+    this->distantPort = distantPort;
+    this->distantAddress = distantAddress;
+    // Info("Debug: Connect to %s:%d succeeded\n", distantAddress.c_str(),
+    // distantPort);
+    return true;
+  }
+}
+
+ssize_t TcpSocket::SendMessage(const char *buffer, size_t bufferSize,
+                               Time timeout) {
+  int flags = 0;
+  if (!blockOnSend) {
+    flags |= MSG_DONTWAIT;
+  } else {
+    struct timeval tv;
+    tv.tv_sec = timeout / 1000; // timeout is in ms
+    tv.tv_usec = (timeout % 1000) * 1000;
+
+    setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv,
+               sizeof(struct timeval));
+  }
+  ssize_t bytesSent = send(socket, buffer, bufferSize, flags);
+
+  return bytesSent;
+}
+
+ssize_t TcpSocket::RecvMessage(char *buffer, size_t bufferSize, Time timeout) {
+  int flags = 0;
+  if (!blockOnReceive) {
+    flags |= MSG_DONTWAIT;
+  } else {
+    struct timeval tv;
+    tv.tv_sec = timeout / 1000; // timeout is in ms
+    tv.tv_usec = (timeout % 1000) * 1000;
+
+    setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,
+               sizeof(struct timeval));
+  }
+  ssize_t bytesRead = recv(socket, buffer, bufferSize, flags);
+
+  return bytesRead;
+}
+
+uint16_t TcpSocket::NetworkToHost16(uint16_t data) { return ntohs(data); }
+
+uint16_t TcpSocket::HostToNetwork16(uint16_t data) { return htons(data); }
+
+uint32_t TcpSocket::NetworkToHost32(uint32_t data) { return ntohl(data); }
+
+uint32_t TcpSocket::HostToNetwork32(uint32_t data) { return htonl(data); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/TcpSocket.h
===================================================================
--- tags/latest/lib/FlairCore/src/TcpSocket.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/TcpSocket.h	(revision 209)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TcpSocket.h
+ * \brief Class defining a Tcp socket
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/28
+ * \version 4.0
+ */
+
+#ifndef TCPSOCKET_H
+#define TCPSOCKET_H
+
+#include <ConnectedSocket.h>
+
+namespace flair {
+namespace core {
+/*! \class TcpSocket
+*
+* \brief Class encapsulating a TCP socket
+*
+*/
+class TcpSocket : public ConnectedSocket {
+public:
+  TcpSocket(const Object *parent, const std::string name,
+            bool blockOnSend = false, bool blockOnReceive = true);
+  ~TcpSocket();
+  void Listen(const unsigned int port, const std::string localAddress = "ANY");
+  TcpSocket *Accept(
+      Time timeout = 0); // should throw an exception if not a listening socket
+  bool Connect(const unsigned int distantPort, const std::string distantAddress,
+               Time timeout = 0); // timeout in milliseconds
+  ssize_t SendMessage(const char *message, size_t message_len,
+                      Time timeout = 0); // timeout in milliseconds
+  ssize_t RecvMessage(char *buf, size_t buf_len,
+                      Time timeout = 0); // timeout in milliseconds
+
+  uint16_t NetworkToHost16(uint16_t data);
+  uint16_t HostToNetwork16(uint16_t data);
+  uint32_t NetworkToHost32(uint32_t data);
+  uint32_t HostToNetwork32(uint32_t data);
+
+private:
+  int socket; // socket file descriptor
+  bool blockOnSend;
+  bool blockOnReceive;
+  bool isConnected;
+  unsigned int distantPort;
+  std::string distantAddress;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // TCPSOCKET_H
Index: tags/latest/lib/FlairCore/src/TextEdit.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/TextEdit.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/TextEdit.cpp	(revision 209)
@@ -0,0 +1,59 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/17
+//  filename:   TextEdit.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTextEdit on the ground station
+//
+//
+/*********************************************************************/
+
+#include "TextEdit.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+TextEdit::TextEdit(const LayoutPosition *position, string name, size_t buf_size)
+    : Widget(position->getLayout(), name, "TextEdit") {
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  SendXml();
+
+  delete position;
+
+  //    text_node=AddXmlChild("Text");
+
+  printf_buffer = (char *)malloc(buf_size);
+  if (printf_buffer == NULL)
+    Err("erreur malloc\n");
+}
+
+TextEdit::~TextEdit() { free(printf_buffer); }
+
+void TextEdit::Append(const char *format, ...) {
+  int n;
+
+  va_list args;
+  va_start(args, format);
+  n = vsprintf(printf_buffer, format, args);
+  va_end(args);
+  if (n <= 0)
+    return;
+
+  SetVolatileXmlProp("value", printf_buffer, text_node);
+  SendXml();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/TextEdit.h
===================================================================
--- tags/latest/lib/FlairCore/src/TextEdit.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/TextEdit.h	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TextEdit.h
+ * \brief Class displaying a QTextEdit on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/08/17
+ * \version 4.0
+ */
+
+#ifndef TEXTEDIT_H
+#define TEXTEDIT_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class TextEdit
+*
+* \brief Class displaying a QTextEdit on the ground station
+*
+* QTextEdit allows printing on multiple lines. \n
+*
+*/
+class TextEdit : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QTabWidget at given position. \n
+  * The TextEdit will automatically be child of position->getLayout() Layout.
+  *After calling this constructor,
+  * position will be deleted as it is no longer usefull.
+  *
+  * \param parent parent
+  * \param name name
+  * \param buf_size size of the text buffer
+  */
+  TextEdit(const LayoutPosition *position, std::string name,
+           size_t buf_size = 255);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~TextEdit();
+
+  /*!
+  * \brief Append a line
+  *
+  * \param format text string to display, see standard printf
+  */
+  void Append(const char *format, ...);
+
+private:
+  char *printf_buffer;
+  xmlNodePtr text_node;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // TEXTEDIT_H
Index: tags/latest/lib/FlairCore/src/Thread.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Thread.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Thread.cpp	(revision 209)
@@ -0,0 +1,151 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/10/04
+//  filename:   Thread.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for a thread
+//
+//
+/*********************************************************************/
+
+#include "Thread.h"
+#include "Thread_impl.h"
+#ifdef __XENO__
+#include <native/timer.h>
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Thread::Thread(const Object *parent, string name, uint8_t priority)
+    : Object(parent, name, "Thread") {
+  pimpl_ = new Thread_impl(this, priority);
+}
+
+Thread::~Thread() { delete pimpl_; }
+
+void Thread::Start(void) { pimpl_->Start(); }
+
+void Thread::SafeStop(void) { pimpl_->SafeStop(); }
+
+bool Thread::ToBeStopped(void) const { return pimpl_->ToBeStopped(); }
+
+#ifdef __XENO__
+void Thread::WarnUponSwitches(bool value) {
+  // Ask Xenomai to warn us upon switches to secondary mode.
+  if (value == true) {
+    rt_task_set_mode(0, T_WARNSW, NULL);
+  } else {
+    rt_task_set_mode(T_WARNSW, 0, NULL);
+  }
+}
+#else
+void Thread::WarnUponSwitches(bool value) {
+  // Warn("Not applicable in non real time\n");
+}
+#endif
+
+void Thread::Join(void) { pimpl_->Join(); }
+
+void Thread::SetPeriodUS(uint32_t period) { pimpl_->SetPeriodUS(period); }
+
+uint32_t Thread::GetPeriodUS(void) const { return pimpl_->GetPeriodUS(); }
+
+void Thread::SetPeriodMS(uint32_t period) { pimpl_->SetPeriodMS(period); }
+
+uint32_t Thread::GetPeriodMS(void) const { return pimpl_->GetPeriodMS(); }
+
+bool Thread::IsPeriodSet(void) { return pimpl_->period_set; }
+
+void Thread::WaitPeriod(void) const { pimpl_->WaitPeriod(); }
+
+void Thread::Suspend(void) { pimpl_->Suspend(); }
+
+bool Thread::SuspendUntil(Time date) { return pimpl_->SuspendUntil(date); }
+
+bool Thread::IsSuspended(void) const { return pimpl_->IsSuspended(); }
+
+bool Thread::IsRunning(void) const { return pimpl_->isRunning; }
+
+void Thread::Resume(void) { pimpl_->Resume(); }
+
+int Thread::WaitUpdate(const IODevice *device) {
+  return pimpl_->WaitUpdate(device);
+}
+
+void Thread::SleepUntil(Time time) const {
+#ifdef __XENO__
+  int status = rt_task_sleep_until(time);
+  if (status != 0) {
+		char errorMsg[256];
+    Err("%error rt_task_sleep_until (%s), resume time: %lld, actual time: "
+        "%lld\n",strerror_r(-status, errorMsg, sizeof(errorMsg)), time, GetTime());
+	}
+// Printf("rt_task_sleep_until, resume time: %lld, actual time:
+// %lld\n",time,GetTime());
+#else
+  Time current = GetTime();
+  if (current < time) {
+    //usleep((time - current) / 1000);
+    struct timespec req;
+    req.tv_nsec = time - current;
+    req.tv_sec = req.tv_nsec / 1000000000;
+    req.tv_nsec %= 1000000000;
+    struct timespec rem;
+    if(nanosleep(&req,&rem)!=0) Err("error in nanosleep\n");//todo, handle EINTR
+  } else {
+    Err("error resume time is passed by %lldns\n", ( current-time));
+  }
+#endif
+}
+
+void Thread::SleepMS(uint32_t time) const {
+#ifdef __XENO__
+  int status = rt_task_sleep(time * 1000 * 1000);
+  if (status != 0) {
+		char errorMsg[256];
+    Err("erreur rt_task_sleep (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#else
+  //usleep(time * 1000);
+  struct timespec req;
+  req.tv_nsec = time * 1000000;
+  req.tv_sec = req.tv_nsec / 1000000000;
+  req.tv_nsec %= 1000000000;
+  struct timespec rem;
+  if(nanosleep(&req,&rem)!=0) Err("error in nanosleep\n");//todo, handle EINTR
+#endif
+}
+
+void Thread::SleepUS(uint32_t time) const {
+#ifdef __XENO__
+  int status = rt_task_sleep(time * 1000);
+  if (status != 0) {
+		char errorMsg[256];
+    Err("erreur rt_task_sleep (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#else
+  //usleep(time);
+  struct timespec req;
+  req.tv_nsec = time * 1000;
+  req.tv_sec = req.tv_nsec / 1000000000;
+  req.tv_nsec %= 1000000000;
+  struct timespec rem;
+  if(nanosleep(&req,&rem)!=0) Err("error in nanosleep\n");//todo, handle EINTR
+#endif
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Thread.h
===================================================================
--- tags/latest/lib/FlairCore/src/Thread.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Thread.h	(revision 209)
@@ -0,0 +1,243 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Thread.h
+ * \brief Abstract class for a thread
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/10/04
+ * \version 4.0
+ */
+
+#ifndef THREAD_H
+#define THREAD_H
+
+#include <Object.h>
+#include <stdint.h>
+
+class Thread_impl;
+
+namespace flair {
+namespace core {
+
+class IODevice;
+
+/*! \class Thread
+*
+* \brief Abstract class for a thread
+*
+* To implement a thread, Run() method must be reimplemented. \n
+* When Start() is called, it will automatically call Run() reimplemented method.
+* A thread can be periodic, in this case WaitPeriod() will block untill period
+*is met.
+* Thread can also e synnchronized with an IODevice, using WaitUpdate() method.
+*\n
+* Thread period is by default 100ms.
+*/
+class Thread : public Object {
+  friend class ::Thread_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * \param parent parent
+  * \param name name
+  * \param priority priority, should be >20 (<20 is reserved for internal use)
+  */
+  Thread(const Object *parent, std::string name,
+         uint8_t priority); // priority>20, for real time only
+
+  /*!
+  * \brief Destructor
+  *
+  * If thread is started, SafeStop() and Join() will
+  * be automatically called.
+  *
+  */
+  virtual ~Thread();
+
+  /*!
+  * \brief Start the thread
+  *
+  */
+  void Start(void);
+
+  /*!
+  * \brief Set a stop flag
+  *
+  * ToBeStopped() will return true after calling this method.
+  */
+  void SafeStop(void);
+
+  /*!
+  * \brief Set a stop flag
+  *
+  * Reimplemented Run() can poll this method to
+  * determine when to stop the thread.
+  *
+  * \return true if SafeStop() was called
+  */
+  bool ToBeStopped(void) const;
+
+  /*!
+  * \brief Join the thread
+  *
+  * This method will block untill Run() returns.
+  *
+  */
+  void Join(void);
+
+  /*!
+  * \brief Set the period in micro second
+  *
+  * After calling this method, IsPeriodSet will return true.
+  *
+  * \param period_us period in us
+  */
+  void SetPeriodUS(uint32_t period_us);
+
+  uint32_t GetPeriodUS() const;
+
+  /*!
+  * \brief Set the period in milli second
+  *
+  * After calling this method, IsPeriodSet will return true.
+  *
+  * \param period_ums period in ms
+  */
+  void SetPeriodMS(uint32_t period_ms);
+
+  uint32_t GetPeriodMS() const;
+
+  /*!
+  * \brief Returns if period was set
+  *
+  * \return true if a period was set using SetPeriodUS or SetPeriodMS
+  * false otherwise
+  */
+  bool IsPeriodSet(void);
+
+  /*!
+  * \brief Wait the period
+  *
+  * This method will block untill period is met. \n
+  * If no period was set (see SetPeriodUS, SetPeriodMS and IsPeriodSet), this
+  *method
+  * returns immediately.
+  *
+  */
+  void WaitPeriod(void) const;
+
+  /*!
+  * \brief Wait update of an IODevice
+  *
+  * This method will block untill IODevice::ProcessUpdate
+  * is called. \n
+  * This method is usefull to synchronize a thread with an IODevice.
+  *
+  * \param device IODevice to wait update from
+  */
+  int WaitUpdate(const IODevice *device);
+
+  /*!
+  * \brief Suspend the thread
+  *
+  * This method will block untill Resume() is called.
+  *
+  */
+  void Suspend(void);
+
+  /*!
+  * \brief Suspend the thread with timeout
+  *
+  * This method will block until Resume() is called or the absolute date
+  *specified occurs
+  *
+  * \param date absolute date in ns
+  * \return true if thread is woken up by a call to Resume, false otherwise
+  */
+  bool SuspendUntil(Time date);
+
+  /*!
+  * \brief Resume the thread
+  *
+  * This method will unblock the call to Suspend().
+  *
+  */
+  void Resume(void);
+
+  /*!
+  * \brief Is the thread suspended?
+  *
+  * \return true if thread is suspended
+  *
+  */
+  bool IsSuspended(void) const;
+  
+  /*!
+  * \brief Is the thread running?
+  *
+  * \return true if thread is running (call to Start). A suspended thread is running.
+  *
+  */
+  bool IsRunning(void) const;
+
+  /*!
+  * \brief Sleep until absolute time
+  *
+  * This method will block untill time is reached.
+  *
+  * \param time absolute time
+  */
+  void SleepUntil(Time time) const;
+
+  /*!
+  * \brief Sleep for a certain time in micro second
+  *
+  * This method will block untill time is elapsed.
+  *
+  * \param time_us time to wait in micro second
+  */
+  void SleepUS(uint32_t time_us) const;
+
+  /*!
+  * \brief Sleep for a cartain time in milli second
+  *
+  * This method will block untill time is elapsed.
+  *
+  * \param time_ms time to wait in milli second
+  */
+  void SleepMS(uint32_t time_ms) const;
+
+  /*!
+  * \brief Warn if real time / non real time switches occur
+  *
+  * If enabled, a message with the call stack will be displayed
+  * in case of real time / non real time switches. \n
+  * This method can help to debug application and see if switches occur. \n
+  * Note that it as no effect if this method is called from the non real time
+  * Framework library.
+  *
+  * \param enable enable or disable warns
+  */
+  static void WarnUponSwitches(bool enable);
+
+private:
+  /*!
+  * \brief Run method
+  *
+  * This method is automatically called by Start(). \n
+  * This method must be reimplemented, in order to implement the thread.
+  *
+  */
+  virtual void Run(void) = 0;
+
+  class Thread_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // THREAD_H
Index: tags/latest/lib/FlairCore/src/Thread_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Thread_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Thread_impl.cpp	(revision 209)
@@ -0,0 +1,411 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/10/04
+//  filename:   Thread_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe implementant un thread rt ou non
+//
+//
+/*********************************************************************/
+
+#include "Thread_impl.h"
+#include "Thread.h"
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "ConditionVariable.h"
+#include "config.h"
+#include "FrameworkManager.h"
+#include <string.h>
+#ifdef __XENO__
+#include <rtdk.h>
+#define TH_NAME getFrameworkManager()->ObjectName() + "-" + self->ObjectName()
+#else//__XENO__
+#include <sys/resource.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#endif//__XENO__
+
+using std::string;
+using namespace flair::core;
+
+Thread_impl::Thread_impl(Thread *self, uint8_t priority) {
+  isRunning = false;
+  tobestopped = false;
+  is_suspended = false;
+  period_set = false;
+
+  this->self = self;
+  cond = new ConditionVariable(self, self->ObjectName());
+
+  if (priority < MIN_THREAD_PRIORITY) {
+    priority = MIN_THREAD_PRIORITY;
+    //        printf("Thread::Thread, %s: priority set to
+    //        %i\n",self->ObjectName().c_str(), priority);
+  }
+  if (priority > MAX_THREAD_PRIORITY) {
+    priority = MAX_THREAD_PRIORITY;
+    self->Warn("priority set to %i\n", MAX_THREAD_PRIORITY);
+  }
+
+  this->priority = priority;
+  period = 100 * 1000 * 1000; // 100ms par defaut
+  min_latency = 1000 * 1000 * 1000;
+  max_latency = 0;
+  mean_latency = 0;
+  last = 0;
+  cpt = 0;
+
+#ifdef __XENO__
+  // Perform auto-init of rt_print buffers if the task doesn't do so
+  rt_print_auto_init(1);
+    // Initialise the rt_print buffer for this task explicitly
+  rt_print_init(512, (TH_NAME).c_str());
+#endif //__XENO__
+}
+
+Thread_impl::~Thread_impl() {
+  SafeStop();
+  Join();
+}
+
+void Thread_impl::Start(void) {
+  int status;
+	char errorMsg[256];
+
+  isRunning = true;
+  tobestopped = false;
+  is_suspended = false;
+
+#ifdef __XENO__
+  string th_name =TH_NAME;
+
+#ifdef RT_STACK_SIZE
+  status = rt_task_create(&task_rt, th_name.c_str(), RT_STACK_SIZE,
+                          (int)priority, T_JOINABLE);
+#else
+  status =
+      rt_task_create(&task_rt, th_name.c_str(), 0, (int)priority, T_JOINABLE);
+#endif // RT_STACK_SIZE
+  if (status != 0) {
+    self->Err("rt_task_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  } else {
+    //_printf("rt_task_create ok %s\n",th_name);
+  }
+
+  status = rt_task_start(&task_rt, &main_rt, (void *)this);
+  if (status != 0) {
+    self->Err("rt_task_start error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  } else {
+    //_printf("rt_task_start ok %s\n",th_name);
+  }
+
+#else //__XENO__
+
+  // Initialize thread creation attributes
+  pthread_attr_t attr;
+  if (pthread_attr_init(&attr) != 0) {
+    self->Err("Error pthread_attr_init\n");
+  }
+
+#ifdef NRT_STACK_SIZE
+  if (pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0) {
+    self->Err("Error pthread_attr_setstacksize\n");
+  }
+#endif // NRT_STACK_SIZE
+
+  if (pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) != 0) {
+    self->Err("Error pthread_attr_setinheritsched\n");
+  }
+
+  if (pthread_attr_setschedpolicy(&attr, SCHED_FIFO) != 0) {
+    self->Err("Error pthread_attr_setschedpolicy\n");
+  }
+
+  struct sched_param parm;
+  parm.sched_priority = priority;
+  if (pthread_attr_setschedparam(&attr, &parm) != 0) {
+    self->Err("Error pthread_attr_setschedparam\n");
+  }
+
+  next_time = GetTime() + period;
+
+  if (pthread_create(&task_nrt, &attr, main_nrt, (void *)this) != 0) {
+    self->Err("pthread_create error\n");
+  }
+
+  if (pthread_attr_destroy(&attr) != 0) {
+    self->Err("Error pthread_attr_destroy\n");
+  }
+
+#endif //__XENO__
+}
+
+#ifdef __XENO__
+void Thread_impl::main_rt(void *arg) {
+  Thread_impl *caller = (Thread_impl *)arg;
+
+  caller->self->Run();
+
+  caller->PrintStats();
+}
+#else
+void* Thread_impl::main_nrt(void * arg)
+{
+    Thread_impl *caller = (Thread_impl*)arg;
+/*string th_name=getFrameworkManager()->ObjectName()+ "-" + caller->self->ObjectName();
+caller->self->Info("pthread '%s' created with TID %x\n",th_name.c_str(),(pid_t)syscall(SYS_gettid));*/
+
+  caller->self->Run();
+
+  caller->PrintStats();
+
+  pthread_exit(0);
+}
+#endif //__XENO__
+
+void Thread_impl::SetPeriodUS(uint32_t period) {
+  if (period == 0) {
+    self->Err("Period must be>0\n");
+    return;
+  }
+
+#ifdef __XENO__
+  int status = rt_task_set_periodic(&task_rt, TM_NOW, period * 1000);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("Error rt_task_set_periodic %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#else
+  next_time -= period;
+  next_time += period * 1000;
+#endif
+  this->period = period * 1000;
+  period_set = true;
+}
+
+uint32_t Thread_impl::GetPeriodUS() const { return this->period / 1000; }
+
+void Thread_impl::SetPeriodMS(uint32_t period) {
+  if (period == 0) {
+    self->Err("Period must be>0\n");
+    return;
+  }
+
+#ifdef __XENO__
+  int status = rt_task_set_periodic(&task_rt, TM_NOW, period * 1000 * 1000);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("Error rt_task_set_periodic %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#else
+  next_time -= period;
+  next_time += period * 1000 * 1000;
+#endif
+  this->period = period * 1000 * 1000;
+  period_set = true;
+}
+
+uint32_t Thread_impl::GetPeriodMS() const { return this->period / 1000 / 1000; }
+
+void Thread_impl::WaitPeriod(void) {
+  if (period_set == false) {
+    self->Err("Period must be set befaore calling this method\n");
+    return;
+  }
+#ifdef __XENO__
+  unsigned long overruns_r;
+  int status = rt_task_wait_period(&overruns_r);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("Error rt_task_wait_period %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+//avoid spamming messages
+/*
+  if (status == -ETIMEDOUT) {
+    self->Err("overrun: %lld\n", overruns_r);
+	}*/
+#else
+  self->SleepUntil(next_time);
+  Time current = GetTime();
+//avoid spamming messages
+  //if(current>next_time+period) self->Err("overrun of %lld\n", current-next_time);
+  while (next_time < current) {
+    next_time += period;
+  }
+#endif
+  ComputeLatency(GetTime());
+}
+
+void Thread_impl::Suspend(void) {
+  if (isRunning == false) {
+    self->Err("thread is not started\n");
+    return;
+  }
+
+  cond->GetMutex(), is_suspended = true;
+  cond->CondWait();
+  is_suspended = false;
+  cond->ReleaseMutex();
+}
+
+bool Thread_impl::SuspendUntil(Time date) {
+  if (isRunning == false) {
+    self->Err("thread is not started\n");
+    return false;
+  }
+
+  cond->GetMutex(), is_suspended = true;
+  bool success = cond->CondWaitUntil(date);
+  is_suspended = false;
+  cond->ReleaseMutex();
+  return success;
+}
+
+bool Thread_impl::IsSuspended(void) {
+  bool result;
+
+  cond->GetMutex();
+  result = is_suspended;
+  cond->ReleaseMutex();
+
+  return result;
+}
+
+void Thread_impl::Resume(void) {
+  if (isRunning == false) {
+    self->Err("thread is not started\n");
+    return;
+  }
+
+  cond->GetMutex();
+  if (is_suspended == true) {
+    cond->CondSignal();
+  } else {
+    self->Err("thread is not suspended\n");
+  }
+  cond->ReleaseMutex();
+}
+
+int Thread_impl::WaitUpdate(const IODevice *device) {
+  int status = 0;
+
+  if (IsSuspended() == true) {
+    self->Err("thread is already supended\n");
+    status = -1;
+  } else {
+    cond->GetMutex();
+
+    if (device->pimpl_->SetToWake(self) == 0) {
+      is_suspended = true;
+      cond->CondWait();
+      is_suspended = false;
+    } else {
+      self->Err("%s is already waiting an update\n",
+                device->ObjectName().c_str());
+      status = -1;
+    }
+
+    cond->ReleaseMutex();
+  }
+
+  return status;
+}
+
+void Thread_impl::PrintStats(void) {
+#ifdef __XENO__
+  RT_TASK_INFO info;
+
+  int status = rt_task_inquire(NULL, &info);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("Error rt_task_inquire %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  } else
+#endif
+  {
+#ifndef __XENO__
+  if(last!=0)
+#endif
+    { Printf("Thread::%s :\n", self->ObjectName().c_str()); 
+    if(period_set) {Printf("    period (ns): %lld\n", period);}}
+#ifdef __XENO__
+    Printf("    number of context switches: %i\n", info.ctxswitches);
+    Printf("    number of primary->secondary mode switch: %i\n",
+           info.modeswitches);
+    // printf("number of page faults: %i\n",info.pagefaults);
+    Printf("    execution time (ms) in primary mode: %lld\n",
+           info.exectime / 1000000);
+#else
+/*
+        struct rusage r_usage;
+        getrusage(RUSAGE_THREAD,&r_usage);
+        printf("    memory usage = %ld\n",r_usage.ru_maxrss);
+        printf("RUSAGE :ru_utime => %lld [sec] : %lld [usec], :ru_stime => %lld
+   [sec] : %lld [usec] \n",
+           (int64_t)r_usage.ru_utime.tv_sec, (int64_t)r_usage.ru_utime.tv_usec,
+           (int64_t)r_usage.ru_stime.tv_sec,
+   (int64_t)r_usage.ru_stime.tv_usec);*/
+#endif
+    if (last != 0) {
+      Printf("    min latency (ns): %lld\n", min_latency);
+      Printf("    max latency (ns): %lld\n", max_latency);
+      Printf("    latency moy (ns): %lld\n", mean_latency / cpt);
+      Printf("    iterations: %lld\n", cpt);
+    }
+  }
+}
+
+void Thread_impl::Join(void) {
+  if (isRunning == true) {
+    int status;
+		char errorMsg[256];
+
+#ifdef __XENO__
+    status = rt_task_join(&task_rt);
+#else
+    status = pthread_join(task_nrt, NULL);
+#endif
+    if (status != 0)
+      self->Err("error %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    isRunning = false;
+  }
+}
+
+void Thread_impl::ComputeLatency(Time time) {
+  Time diff, delta;
+  diff = time - last;
+
+  if (diff >= period) {
+    delta = diff - period;
+  } else {
+    delta = period - diff;
+  }
+  // if(delta==0) rt_printf("%lld %lld\n",time,last);
+  last = time;
+  if (diff == time)
+    return;
+
+  if (delta > max_latency)
+    max_latency = delta;
+  if (delta < min_latency)
+    min_latency = delta;
+  mean_latency += delta;
+  cpt++;
+
+  // Printf("Thread::%s latency moy (ns):
+  // %lld\n",self->ObjectName().c_str(),mean_latency/cpt);
+}
+
+void Thread_impl::SafeStop(void) {
+  tobestopped = true;
+  if (IsSuspended())
+    Resume();
+}
+
+bool Thread_impl::ToBeStopped(void) { return tobestopped; }
Index: tags/latest/lib/FlairCore/src/UdpSocket.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/UdpSocket.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/UdpSocket.cpp	(revision 209)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/17
+//  filename:   UdpSocket.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a UDP socket
+//
+//
+/*********************************************************************/
+#include "UdpSocket.h"
+#include "UdpSocket_impl.h"
+#include <FrameworkManager.h>
+#include <string.h>
+#include <stdexcept>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+UdpSocket::UdpSocket(const Object *parent, string name, uint16_t port)
+    : Object(parent, name) {
+  pimpl_ = new UdpSocket_impl(this, name, port);
+}
+
+UdpSocket::UdpSocket(const Object *parent, string name, string address,
+               bool broadcast)
+    : Object(parent, name) {
+  pimpl_ = new UdpSocket_impl(this, name, address, broadcast);
+}
+
+UdpSocket::~UdpSocket() { delete pimpl_; }
+
+void UdpSocket::SendMessage(const char *message, size_t message_len) {
+  pimpl_->SendMessage(message, message_len);
+}
+
+void UdpSocket::SendMessage(string message) { pimpl_->SendMessage(message); }
+
+ssize_t UdpSocket::RecvMessage(char *buf, size_t buf_len, Time timeout, char *src,
+                            size_t *src_len) {
+  return pimpl_->RecvMessage(buf, buf_len, timeout, src, src_len);
+}
+
+void UdpSocket::NetworkToHost(char *data, size_t dataSize) {
+  if (core::IsBigEndian())
+    return;
+  if (dataSize == 1)
+    return;
+  if ((dataSize == 2) || (dataSize == 4) || (dataSize == 8) ||
+      (dataSize == 16)) {
+    char dataInHostEndianness[dataSize];
+    for (unsigned int i = 0; i < dataSize; i++) {
+      dataInHostEndianness[i] = data[dataSize - i - 1];
+    }
+    memcpy(data, dataInHostEndianness, dataSize);
+    return;
+  }
+  throw std::runtime_error(
+      string("Unsupported data size (") + std::to_string(dataSize) +
+      string(") in host to network endianness conversion"));
+}
+
+void UdpSocket::HostToNetwork(char *data, size_t dataSize) {
+  if (IsBigEndian())
+    return;
+  if (dataSize == 1)
+    return;
+  if ((dataSize == 2) || (dataSize == 4) || (dataSize == 8) ||
+      (dataSize == 16)) {
+    char dataInNetworkEndianness[dataSize];
+    for (unsigned int i = 0; i < dataSize; i++) {
+      dataInNetworkEndianness[i] = data[dataSize - i - 1];
+    }
+    memcpy(data, dataInNetworkEndianness, dataSize);
+    return;
+  }
+  throw std::runtime_error(
+      string("Unsupported data size (") + std::to_string(dataSize) +
+      string(") in host to network endianness conversion"));
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/UdpSocket.h
===================================================================
--- tags/latest/lib/FlairCore/src/UdpSocket.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/UdpSocket.h	(revision 209)
@@ -0,0 +1,111 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Socket.h
+ * \brief Class defining a UDP socket
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/17
+ * \version 4.0
+ */
+
+#ifndef UDPSOCKET_H
+#define UDPSOCKET_H
+
+#include <unistd.h>
+#include <stdint.h>
+#include <Object.h>
+
+class UdpSocket_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class UdpSocket
+*
+* \brief Class encapsulating a UDP socket. It assumes packets are coming from
+*only one distant host on a given port.
+*
+*/
+class UdpSocket : public Object {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct the client side of the socket
+  *
+  * \param parent parent
+  * \param name name
+  * \param address server address (ex 192.168.1.1:9000)
+  * \param broadcast true if address is a broadcast address
+  */
+  UdpSocket(const Object *parent, std::string name, std::string address,
+         bool broadcast = false);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct the server side of the socket
+  *
+  * \param parent parent
+  * \param name name
+  * \param port listening port
+  */
+  UdpSocket(const Object *parent, std::string name, uint16_t port);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~UdpSocket();
+
+  /*!
+  * \brief Send a message
+  *
+  * In case of a broadcast Socket, Parent()->ObjectName() is used as source of
+  *the message, this name should be unique.
+  *
+  * \param message message
+  */
+  void SendMessage(std::string message);
+
+  /*!
+  * \brief Send a message
+  *
+  * \param message message
+  * \param message_len message length
+  */
+  void SendMessage(const char *message, size_t message_len);
+
+  /*!
+  * \brief Receive a message
+  *
+  * Receive a message and wait up to timeout. \n
+  * If src and src_len are specified, the source of the message will be
+  * copied in the src buffer. \n
+  * Note that in case of a broadcast socket, own messages are filtered and
+  * are not received.
+  *
+  * \param buf buffer to put the message
+  * \param buf_len buffer length
+  * \param timeout timeout
+  * \param src buffer to put source name
+  * \param src_len buffer length
+  *
+  * \return size of the received message
+  */
+  ssize_t RecvMessage(char *buf, size_t buf_len, Time timeout, char *src = NULL,
+                      size_t *src_len = NULL);
+
+  void NetworkToHost(char *data, size_t dataSize);
+  void HostToNetwork(char *data, size_t dataSize);
+
+private:
+  class UdpSocket_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // UDPSOCKET_H
Index: tags/latest/lib/FlairCore/src/UdpSocket_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/UdpSocket_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/UdpSocket_impl.cpp	(revision 209)
@@ -0,0 +1,375 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/17
+//  filename:   Socket_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour une Socket_impl
+//
+//
+/*********************************************************************/
+#include "UdpSocket_impl.h"
+#include "UdpSocket.h"
+#include "FrameworkManager.h"
+#include <fcntl.h>
+#include <cstdlib>
+#include <unistd.h>
+#include <string.h>
+#ifdef __XENO__
+#include "config.h"
+#endif
+
+using std::string;
+using namespace flair::core;
+
+UdpSocket_impl::UdpSocket_impl(const UdpSocket *self, string name, uint16_t port) {
+  this->self = self;
+  this->port = port;
+  this->address = "";
+  this->broadcast = false;
+  Init();
+}
+
+UdpSocket_impl::UdpSocket_impl(const UdpSocket *self, string name, string address,
+                         bool broadcast) {
+  this->self = self;
+  int pos = address.find(":");
+  this->address = address.substr(0, pos);
+  port = atoi(address.substr(pos + 1).c_str());
+  this->broadcast = broadcast;
+
+  if (pos == 0 || address == "") {
+    self->Err("address %s is not correct\n", address.c_str());
+  }
+  Init();
+}
+
+void UdpSocket_impl::Init(void) {
+  int yes = 1;
+
+  fd = socket(AF_INET, SOCK_DGRAM, 0); // UDP
+
+  if (broadcast == true) {
+    if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(int)) != 0)
+      self->Err("Setsockopt error\n");
+  }
+
+  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) != 0)
+    self->Err("Setsockopt error\n");
+
+  if (address == "" || broadcast == true) {
+    sockaddr_in sin = {0};
+
+    if (broadcast == true) {
+      struct hostent *hostinfo;
+
+      hostinfo = gethostbyname(this->address.c_str());
+      if (hostinfo == NULL) {
+        self->Err("hostinfo error\n");
+      }
+      sin.sin_addr = *(in_addr *)hostinfo->h_addr;
+    } else {
+      sin.sin_addr.s_addr = INADDR_ANY;
+    }
+
+    sin.sin_port = htons(port);
+    sin.sin_family = AF_INET;
+    if (bind(fd, (sockaddr *)&sin, sizeof sin) == -1) {
+      self->Err("bind error\n");
+    }
+  }
+
+#ifdef __XENO__
+  string tmp_name;
+  int status;
+  is_running = true;
+
+  // pipe
+  tmp_name =
+      getFrameworkManager()->ObjectName() + "-" + self->ObjectName() + "-pipe";
+  // xenomai limitation
+  if (tmp_name.size() > 31)
+    self->Err("rt_pipe_create error (%s is too long)\n", tmp_name.c_str());
+#ifdef RT_PIPE_SIZE
+  status = rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO, RT_PIPE_SIZE);
+#else
+  status = rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO, 0);
+#endif
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("rt_pipe_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+
+// start user side thread
+#ifdef NRT_STACK_SIZE
+  // Initialize thread creation attributes
+  pthread_attr_t attr;
+  if (pthread_attr_init(&attr) != 0) {
+    self->Err("pthread_attr_init error\n");
+  }
+  if (pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0) {
+    self->Err("pthread_attr_setstacksize error\n");
+  }
+  if (pthread_create(&user_thread, &attr, user, (void *)this) < 0) {
+    self->Err("pthread_create error\n");
+  }
+  if (pthread_attr_destroy(&attr) != 0) {
+    self->Err("pthread_attr_destroy error\n");
+  }
+#else  // NRT_STACK_SIZE
+  if (pthread_create(&user_thread, NULL, user, (void *)this) < 0) {
+    self->Err("pthread_create error\n");
+  }
+#endif // NRT_STACK_SIZE
+#endif //__XENO__
+
+  if (address != "") {
+    struct hostent *hostinfo;
+    hostinfo = gethostbyname(address.c_str());
+    if (hostinfo == NULL) {
+      self->Err("gethostbyname\n");
+    }
+
+    sock_in.sin_addr = *(in_addr *)hostinfo->h_addr;
+    sock_in.sin_port = htons(port);
+    sock_in.sin_family = AF_INET;
+  }
+}
+
+UdpSocket_impl::~UdpSocket_impl() {
+#ifdef __XENO__
+  is_running = false;
+
+  pthread_join(user_thread, NULL);
+  int status = rt_pipe_delete(&pipe);
+  if (status != 0) {
+		char errorMsg[256];
+    self->Err("rt_pipe_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#endif
+  close(fd);
+}
+
+void UdpSocket_impl::SendMessage(const char *src, size_t src_len) {
+  ssize_t written;
+  string to_send;
+	char errorMsg[256];
+
+  if (broadcast == true) {
+    to_send = getFrameworkManager()->ObjectName() + ":" + string(src, src_len);
+    src_len = to_send.size();
+    src = (char *)to_send.c_str();
+  }
+
+#ifdef __XENO__
+  // Printf("send pipe %s\n",src);
+  written = rt_pipe_write(&pipe, src, src_len, P_NORMAL);
+
+  if (written < 0) {
+    self->Err("rt_pipe_write error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg)));
+  } else if (written != (ssize_t)src_len) {
+    self->Err("rt_pipe_write error %i/%i\n", written, to_send.size());
+  }
+#else
+  written =
+      sendto(fd, src, src_len, 0, (struct sockaddr *)&sock_in, sizeof(sock_in));
+  if(written==-1) {
+		char errorMsg[256];
+    self->Err("sendto error (%s)\n",strerror_r(errno, errorMsg, sizeof(errorMsg)));
+  } else if (written != (ssize_t)src_len) {
+    self->Err("sendto error %i/%i\n",written,src_len);
+  }
+#endif
+}
+
+void UdpSocket_impl::SendMessage(string message) {
+  ssize_t written;
+
+  if (broadcast == true)
+    message = self->Parent()->ObjectName() + ":" + message;
+// Printf("SendMessage %s\n",message.c_str());
+#ifdef __XENO__
+  written = rt_pipe_write(&pipe, message.c_str(), message.size(), P_NORMAL);
+
+  if (written < 0) {
+		char errorMsg[256];
+    self->Err("rt_pipe_write error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg)));
+  } else if (written != (ssize_t)message.size()) {
+    self->Err("rt_pipe_write error %i/%i\n", written, message.size());
+  }
+#else
+  written = sendto(fd, message.c_str(), message.size(), 0,
+                   (struct sockaddr *)&sock_in, sizeof(sock_in));
+  if (written != (ssize_t)message.size()) {
+    self->Err("sendto error\n");
+  }
+
+#endif
+}
+
+ssize_t UdpSocket_impl::RecvMessage(char *msg, size_t msg_len, Time timeout,
+                                 char *src, size_t *src_len) {
+  ssize_t nb_read;
+  char buffer[128];
+#ifdef __XENO__
+  nb_read = rt_pipe_read(&pipe, &buffer, sizeof(buffer), timeout);
+#else
+  socklen_t sinsize = sizeof(sock_in);
+  struct timeval tv;
+
+  if (timeout != TIME_NONBLOCK) {
+    int attr = fcntl(fd, F_GETFL, 0);
+    fcntl(fd, F_SETFL, attr & (~O_NONBLOCK));
+
+    tv.tv_sec = timeout / 1000000000;
+    timeout = timeout - (timeout / 1000000000) * 1000000000;
+    tv.tv_usec = timeout / 1000;
+    if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) {
+      self->Err("setsockopt SO_RCVTIMEO failed\n");
+    }
+  } else {
+    fcntl(fd, F_SETFL, O_NONBLOCK);
+  }
+
+  if (broadcast == false) {
+    nb_read =
+        recvfrom(fd, buffer, sizeof(buffer), 0, (sockaddr *)&sock_in, &sinsize);
+  } else {
+    nb_read = recvfrom(fd, buffer, sizeof(buffer), 0, NULL, NULL);
+  }
+#endif
+  if (nb_read <= 0) {
+    return nb_read;
+  } else {
+    // printf("%s\n",buffer);
+    if (broadcast == true) {
+      int index = -1;
+      for (int i = 0; i < nb_read; i++) {
+        if (buffer[i] == ':') {
+          index = i;
+          break;
+        }
+      }
+      if (index < 0) {
+        self->Warn("Malformed message\n");
+        return -1;
+      } else if (src_len != NULL && src != NULL) {
+        if (index + 1 > (int)(*src_len) &&
+            src != NULL) { //+1 pour inserer un 0)
+          self->Warn("insufficent src size\n");
+          return -1;
+        }
+      } else if (nb_read - index - 1 + 1 >
+                 (int)msg_len) { //+1 pour inserer un 0
+        self->Warn("insufficent msg size (%i/%i)\n", nb_read - index - 1 + 1,
+                   msg_len);
+        return -1;
+      }
+      if (src != NULL) {
+        memcpy(src, buffer, index);
+        src[index] = 0;
+      }
+      memcpy(msg, &buffer[index + 1], nb_read - index - 1);
+      msg[nb_read - index - 1] = 0;
+      return nb_read - index;
+    } else {
+      if (nb_read > (int)msg_len) {
+        self->Warn("insufficent msg size (%i/%i)\n", nb_read, msg_len);
+        return -1;
+      }
+      memcpy(msg, buffer, nb_read);
+      return nb_read;
+    }
+  }
+}
+
+#ifdef __XENO__
+void *UdpSocket_impl::user(void *arg) {
+  UdpSocket_impl *caller = (UdpSocket_impl *)arg;
+  int pipe_fd = -1;
+  string devname;
+
+  devname = NRT_PIPE_PATH + getFrameworkManager()->ObjectName() + "-" +
+            caller->self->ObjectName() + "-pipe";
+  while (pipe_fd < 0) {
+    pipe_fd = open(devname.c_str(), O_RDWR);
+    if (pipe_fd < 0 && errno != ENOENT) {
+			char errorMsg[256];
+			caller->self->Err("open pipe_fd error (%s)\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+		}
+    usleep(1000);
+  }
+
+  while (caller->is_running == true) {
+    fd_set set;
+    struct timeval timeout;
+    int rv;
+
+    FD_ZERO(&set);            // clear the set
+    FD_SET(caller->fd, &set); // add our file descriptor to the set
+    FD_SET(pipe_fd, &set);    // add our file descriptor to the set
+
+    timeout.tv_sec = 0;
+    timeout.tv_usec = SELECT_TIMEOUT_MS * 1000;
+    rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+    if (rv == -1) {
+      caller->self->Err("select error\n"); // an error occured
+    } else if (rv == 0) {
+      // printf("timeout\n");
+    } else {
+      ssize_t nb_read, nb_write;
+      char buffer[1024];
+
+      if (FD_ISSET(caller->fd, &set)) {
+        socklen_t sinsize = sizeof(caller->sock_in);
+        if (caller->broadcast == false) {
+          nb_read = recvfrom(caller->fd, buffer, sizeof(buffer), 0,
+                             (sockaddr *)&(caller->sock_in), &sinsize);
+        } else {
+          nb_read = recvfrom(caller->fd, buffer, sizeof(buffer), 0, NULL, NULL);
+        }
+        if (nb_read < 0) {
+          caller->self->Err("recvfrom error\n");
+        }
+        // printf("user %s\n",buffer);
+        // on ne garde que les messages venant pas de soi meme
+        if (caller->broadcast == false ||
+            (caller->broadcast == true &&
+             getFrameworkManager()->ObjectName().compare(
+                 0, getFrameworkManager()->ObjectName().size(), buffer,
+                 getFrameworkManager()->ObjectName().size()) != 0)) {
+          nb_write = write(pipe_fd, buffer, nb_read);
+          if (nb_write != nb_read) {
+            caller->self->Err("write error\n");
+          }
+        } else {
+          // printf("self %s\n",buffer);
+        }
+      }
+      if (FD_ISSET(pipe_fd, &set)) {
+        nb_read = read(pipe_fd, buffer, sizeof(buffer));
+        // printf("read pipe %i %s\n",nb_read,buffer);
+        if (nb_read > 0) {
+          // printf("send %s\n",buffer);
+          nb_write = sendto(caller->fd, buffer, nb_read, 0,
+                            (struct sockaddr *)&(caller->sock_in),
+                            sizeof(caller->sock_in));
+          if (nb_write != nb_read) {
+            caller->self->Err("sendto error\n");
+          }
+        }
+      }
+    }
+  }
+
+  close(pipe_fd);
+  pthread_exit(0);
+}
+#endif
Index: tags/latest/lib/FlairCore/src/UdtSocket.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/UdtSocket.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/UdtSocket.cpp	(revision 209)
@@ -0,0 +1,154 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/21
+//  filename:   UdtSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a UDT socket
+//
+//
+/*********************************************************************/
+#include "UdtSocket.h"
+#include <udt.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <string.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+UdtSocket::UdtSocket(const Object *parent, const std::string name,
+                     bool _blockOnSend, bool _blockOnReceive)
+    : ConnectedSocket(parent, name) {
+  UDT::startup();
+  blockOnSend = _blockOnSend;
+  blockOnReceive = _blockOnReceive;
+}
+
+UdtSocket::~UdtSocket() {}
+
+void UdtSocket::Listen(const unsigned int port,
+                       const std::string localAddress) {
+  socket = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+
+  UDT::setsockopt(socket, 0, UDT_SNDSYN, &blockOnSend, sizeof(bool));
+  UDT::setsockopt(socket, 0, UDT_RCVSYN, &blockOnReceive, sizeof(bool));
+  bool reuse = true;
+  UDT::setsockopt(socket, 0, UDT_REUSEADDR, &reuse, sizeof(bool));
+
+  sockaddr_in my_addr;
+  my_addr.sin_family = AF_INET;
+  my_addr.sin_port = htons(port);
+  if (localAddress == "ANY") {
+    my_addr.sin_addr.s_addr = INADDR_ANY;
+  } else {
+    inet_aton(localAddress.c_str(), &(my_addr.sin_addr));
+  }
+  memset(&(my_addr.sin_zero), '\0', 8);
+
+  if (UDT::ERROR == UDT::bind(socket, (sockaddr *)&my_addr, sizeof(my_addr))) {
+    Err("bind, %s\n", UDT::getlasterror().getErrorMessage());
+  }
+
+  UDT::listen(socket, 1);
+}
+
+UdtSocket *UdtSocket::Accept(Time timeout) {
+  // TIMEOUT UNSUPPORTED!!
+  UdtSocket *acceptedSocket = new UdtSocket(this->Parent(), this->ObjectName());
+  acceptedSocket->blockOnSend = this->blockOnSend;
+  acceptedSocket->blockOnReceive = this->blockOnReceive;
+
+  sockaddr_in their_addr;
+  int namelen = sizeof(their_addr);
+
+  if ((acceptedSocket->socket = UDT::accept(socket, (sockaddr *)&their_addr,
+                                            &namelen)) == UDT::INVALID_SOCK) {
+    Err("accept: %s, code %i\n", UDT::getlasterror().getErrorMessage(),
+        UDT::getlasterror().getErrorCode());
+  }
+
+  return acceptedSocket;
+}
+
+bool UdtSocket::Connect(const unsigned int port,
+                        const std::string distantAddress, Time timeout) {
+  bool success = true;
+  socket = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+
+  UDT::setsockopt(socket, 0, UDT_SNDSYN, &blockOnSend, sizeof(bool));
+  UDT::setsockopt(socket, 0, UDT_RCVSYN, &blockOnReceive, sizeof(bool));
+  bool reuse = true;
+  UDT::setsockopt(socket, 0, UDT_REUSEADDR, &reuse, sizeof(bool));
+
+  sockaddr_in serv_addr;
+  serv_addr.sin_family = AF_INET;
+  serv_addr.sin_port = htons(short(port));
+  if (inet_pton(AF_INET, distantAddress.c_str(), &serv_addr.sin_addr) <= 0) {
+    printf("incorrect network address.");
+    success = false;
+  }
+  memset(&(serv_addr.sin_zero), '\0', 8);
+
+  if (UDT::ERROR ==
+      UDT::connect(socket, (sockaddr *)&serv_addr, sizeof(serv_addr))) {
+    success = false;
+  }
+  if (!success) {
+    UDT::close(socket);
+    return false;
+  } else
+    return true;
+}
+
+ssize_t UdtSocket::SendMessage(const char *buffer, size_t bufferSize,
+                               Time timeout) {
+  int udtTimeout = timeout;
+  if (blockOnSend) {
+    if (UDT::setsockopt(socket, 0, UDT_SNDTIMEO, &udtTimeout,
+                        sizeof(udtTimeout)) != 0)
+      Err("error UDT_SNDTIMEO %s\n", UDT::getlasterror().getErrorMessage());
+  }
+  ssize_t bytesSent = UDT::sendmsg(socket, buffer, bufferSize, -1, true);
+
+  return bytesSent;
+}
+
+ssize_t UdtSocket::RecvMessage(char *buffer, size_t bufferSize, Time timeout) {
+  int udtTimeout = timeout;
+  if (blockOnReceive) {
+    if (UDT::setsockopt(socket, 0, UDT_RCVTIMEO, &udtTimeout,
+                        sizeof(udtTimeout)) != 0)
+      Err("error UDT_RCVTIMEO %s\n", UDT::getlasterror().getErrorMessage());
+  }
+  ssize_t bytesRead = UDT::recvmsg(socket, buffer, bufferSize);
+
+  /*
+      if(bytesRead<0) {
+          if(UDT::getlasterror().getErrorCode()==CUDTException::ECONNLOST) {
+              connection_lost=true;
+          }
+      }
+  */
+  return bytesRead;
+}
+
+uint16_t UdtSocket::NetworkToHost16(uint16_t data) { return ntohs(data); }
+
+uint16_t UdtSocket::HostToNetwork16(uint16_t data) { return htons(data); }
+
+uint32_t UdtSocket::NetworkToHost32(uint32_t data) { return ntohl(data); }
+
+uint32_t UdtSocket::HostToNetwork32(uint32_t data) { return htonl(data); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/UdtSocket.h
===================================================================
--- tags/latest/lib/FlairCore/src/UdtSocket.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/UdtSocket.h	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UdtSocket.h
+ * \brief Class defining a UDT socket
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/21
+ * \version 4.0
+ */
+
+#ifndef UDTSOCKET_H
+#define UDTSOCKET_H
+
+typedef int UDTSOCKET;
+
+#include <ConnectedSocket.h>
+
+namespace flair {
+namespace core {
+/*! \class UdtSocket
+*
+* \brief Class encapsulating a UDT socket
+*
+*/
+class UdtSocket : public ConnectedSocket {
+public:
+  UdtSocket(const Object *parent, const std::string name,
+            bool blockOnSend = false, bool blockOnReceive = true);
+  ~UdtSocket();
+  void Listen(const unsigned int port, const std::string localAddress = "ANY");
+  UdtSocket *
+  Accept(Time timeout); // should throw an exception if not a listening socket
+  bool Connect(const unsigned int port, const std::string distantAddress,
+               Time timeout); // /!\ timeout is ignored
+  ssize_t SendMessage(const char *message, size_t message_len, Time timeout);
+  ssize_t RecvMessage(char *buf, size_t buf_len, Time timeout);
+
+  uint16_t NetworkToHost16(uint16_t data);
+  uint16_t HostToNetwork16(uint16_t data);
+  uint32_t NetworkToHost32(uint32_t data);
+  uint32_t HostToNetwork32(uint32_t data);
+
+private:
+  UDTSOCKET socket;
+  bool blockOnSend;
+  bool blockOnReceive;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // UDTSOCKET_H
Index: tags/latest/lib/FlairCore/src/Unix_I2cPort.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Unix_I2cPort.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Unix_I2cPort.cpp	(revision 209)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/08/28
+//  filename:   Unix_I2cPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for unix i2c port
+//
+//
+/*********************************************************************/
+
+#include "Unix_I2cPort.h"
+#include <fcntl.h> /* File control definitions */
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/i2c-dev.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Unix_I2cPort::Unix_I2cPort(const Object *parent, string name, string device)
+    : I2cPort(parent, name) {
+  // open port
+  fd = open(device.c_str(), O_RDWR);
+  if (fd == -1) {
+    Err("open_port: Unable to open %s\n", device.c_str());
+  }
+}
+
+Unix_I2cPort::~Unix_I2cPort() { close(fd); }
+
+void Unix_I2cPort::SetRxTimeout(core::Time timeout_ns) {
+  Warn("not implemented\n");
+}
+
+void Unix_I2cPort::SetTxTimeout(core::Time timeout_ns) {
+  Warn("not implemented\n");
+}
+
+int Unix_I2cPort::SetSlave(uint16_t address) {
+  int err = ioctl(fd, I2C_SLAVE_FORCE, address);
+  if (err < 0) {
+    Err("Failed to set slave address\n");
+  }
+
+  return err;
+}
+
+ssize_t Unix_I2cPort::Write(const void *buf, size_t nbyte) {
+  return write(fd, buf, nbyte);
+}
+
+ssize_t Unix_I2cPort::Read(void *buf, size_t nbyte) {
+  return read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Unix_I2cPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/Unix_I2cPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Unix_I2cPort.h	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Unix_I2cPort.h
+ * \brief Class for unix i2c port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/08/28
+ * \version 4.0
+ */
+
+#ifndef UNIX_I2CPORT_H
+#define UNIX_I2CPORT_H
+
+#include <I2cPort.h>
+
+namespace flair {
+namespace core {
+/*! \class Unix_I2cPort
+*
+* \brief Class for unix serial port
+*
+*/
+class Unix_I2cPort : public I2cPort {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an unix i2c port
+  *
+  * \param parent parent
+  * \param name name
+  * \param device serial device (ex /dev/i2c-1)
+  */
+  Unix_I2cPort(const Object *parent, std::string port_name, std::string device);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Unix_I2cPort();
+
+  /*!
+  * \brief Set slave's address
+  *
+  * This method need to be called before any communication.
+  *
+  * \param address slave's address
+  */
+  int SetSlave(uint16_t address);
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting datas.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetRxTimeout(Time timeout_ns);
+
+  /*!
+  * \brief Set TX timeout
+  *
+  * Timeout for waiting an ACK from the slave.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetTxTimeout(Time timeout_ns);
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  ssize_t Write(const void *buf, size_t nbyte);
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  ssize_t Read(void *buf, size_t nbyte);
+
+private:
+  int fd;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // UNIX_I2CPORT_H
Index: tags/latest/lib/FlairCore/src/Unix_SerialPort.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Unix_SerialPort.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Unix_SerialPort.cpp	(revision 209)
@@ -0,0 +1,131 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/25
+//  filename:   Unix_SerialPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for unix serial port
+//
+//
+/*********************************************************************/
+
+#include "Unix_SerialPort.h"
+#include <fcntl.h> /* File control definitions */
+#include <unistd.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Unix_SerialPort::Unix_SerialPort(const Object *parent, string name,
+                                 string device)
+    : SerialPort(parent, name) {
+  // open port
+  fd = open(device.c_str(), O_RDWR | O_NOCTTY); // |O_NDELAY|O_NONBLOCK);
+  if (fd == -1) {
+    Err("open_port: Unable to open %s\n", device.c_str());
+  }
+  // fcntl(fd, F_SETFL, 0); //read calls are non blocking
+
+  // Get the current options for the port
+
+  tcgetattr(fd, &options);
+  // Set the baud rates to 115200
+  cfsetispeed(&options, B115200);
+  cfsetospeed(&options, B115200);
+
+  options.c_cflag |= (CLOCAL | CREAD); // Enable the receiver and set local mode
+  options.c_iflag = 0;                 // clear input options
+  options.c_lflag = 0;                 // clear local options
+  options.c_oflag &= ~OPOST;           // clear output options (raw output)
+
+  // Set the new options for the port
+  options.c_cc[VTIME] = 0;
+  options.c_cc[VMIN] = 1;
+  tcsetattr(fd, TCSANOW, &options);
+  FlushInput();
+}
+
+Unix_SerialPort::~Unix_SerialPort() { close(fd); }
+
+void Unix_SerialPort::SetBaudrate(int baudrate) {
+  struct termios options;
+  // Get the current options for the port
+  tcgetattr(fd, &options);
+ 
+  switch (baudrate) {
+  case 1200:
+    cfsetispeed(&options, B1200);
+    cfsetospeed(&options, B1200);
+    break;
+  case 2400:
+    cfsetispeed(&options, B2400);
+    cfsetospeed(&options, B2400);
+    break;
+  case 4800:
+    cfsetispeed(&options, B4800);
+    cfsetospeed(&options, B4800);
+    break;
+  case 9600:
+    cfsetispeed(&options, B9600);
+    cfsetospeed(&options, B9600);
+    break;
+  case 19200:
+    cfsetispeed(&options, B19200);
+    cfsetospeed(&options, B19200);
+    break;
+  case 38400:
+    cfsetispeed(&options, B38400);
+    cfsetospeed(&options, B38400);
+    break;
+  case 115200:
+    cfsetispeed(&options, B115200);
+    cfsetospeed(&options, B115200);
+    break;
+  case 230400:
+    cfsetispeed(&options, B230400);
+    cfsetospeed(&options, B230400);
+    break;
+  case 460800:
+    cfsetispeed(&options, B460800);
+    cfsetospeed(&options, B460800);
+    break;
+  case 921600:
+    cfsetispeed(&options, B921600);
+    cfsetospeed(&options, B921600);
+    break;
+  default:
+    Err("unsupported baudrate\n");
+  }
+  tcsetattr(fd, TCSANOW, &options);
+  FlushInput();
+}
+
+void Unix_SerialPort::SetRxTimeout(core::Time timeout_ns) {}
+
+void Unix_SerialPort::FlushInput(void) { tcflush(fd, TCIFLUSH); }
+
+ssize_t Unix_SerialPort::Write(const void *buf, size_t nbyte) {
+  return write(fd, buf, nbyte);
+}
+
+ssize_t Unix_SerialPort::Read(void *buf, size_t nbyte) {
+  if (options.c_cc[VMIN] != nbyte) {
+    tcgetattr(fd, &options); // bug if not called?
+    options.c_cc[VTIME] = 0;
+    options.c_cc[VMIN] = nbyte;
+    tcsetattr(fd, TCSANOW, &options);
+  }
+
+  return read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Unix_SerialPort.h
===================================================================
--- tags/latest/lib/FlairCore/src/Unix_SerialPort.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Unix_SerialPort.h	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Unix_SerialPort.h
+ * \brief Class for unix serial port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef UNIX_SERIALPORT_H
+#define UNIX_SERIALPORT_H
+
+#include <SerialPort.h>
+#include <termios.h> /* POSIX terminal control definitions */
+
+namespace flair {
+namespace core {
+/*! \class RTDM_I2cPort
+*
+* \brief Class for unix serial port
+*
+*/
+class Unix_SerialPort : public SerialPort {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an unix serial port, with the following default values: \n
+  * - 115200bps baudrate
+  *
+  * \param parent parent
+  * \param name name
+  * \param device serial device (ex rtser1)
+  */
+  Unix_SerialPort(const Object *parent, std::string port_name,
+                  std::string device);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Unix_SerialPort();
+
+  /*!
+  * \brief Set baudrate
+  *
+  * \param baudrate baudrate
+  *
+  */
+  void SetBaudrate(int baudrate);
+
+  /*!
+  * \brief Set RX timeout
+  *
+  * Timeout for waiting datas.
+  *
+  * \param timeout_ns timeout in nano second
+  */
+  void SetRxTimeout(Time timeout_ns);
+
+  /*!
+  * \brief Write datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of written datas
+  */
+  ssize_t Write(const void *buf, size_t nbyte);
+
+  /*!
+  * \brief Read datas
+  *
+  * \param buf pointer to datas
+  * \param nbyte length of datas
+  *
+  * \return amount of read datas
+  */
+  ssize_t Read(void *buf, size_t nbyte);
+
+  /*!
+  * \brief Flush input datas
+  *
+  */
+  void FlushInput(void);
+
+private:
+  int fd;
+  struct termios options;
+};
+} // end namespace core
+} // end namespace flair
+
+#endif // UNIX_SERIALPORT_H
Index: tags/latest/lib/FlairCore/src/Vector2D.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Vector2D.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector2D.cpp	(revision 209)
@@ -0,0 +1,132 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Vector2D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 2D vector
+//
+//
+/*********************************************************************/
+
+#include "Vector2D.h"
+#include "Euler.h"
+#include <math.h>
+
+namespace flair {
+namespace core {
+  
+template class Vector2D<double>;
+template Vector2D<double> operator+(const Vector2D<double>&, const Vector2D<double>&);
+template Vector2D<double> operator-(const Vector2D<double>&, const Vector2D<double>&);
+template Vector2D<double> operator-(const Vector2D<double>&);
+template Vector2D<double> operator/(const Vector2D<double>&, float);
+template Vector2D<double> operator*(const Vector2D<double>&, float);
+template Vector2D<double> operator*(float, const Vector2D<double>&);
+
+template class Vector2D<float>;
+template Vector2D<float> operator+(const Vector2D<float>&, const Vector2D<float>&);
+template Vector2D<float> operator-(const Vector2D<float>&, const Vector2D<float>&);
+template Vector2D<float> operator-(const Vector2D<float>&);
+template Vector2D<float> operator/(const Vector2D<float>&, float);
+template Vector2D<float> operator*(const Vector2D<float>&, float);
+template Vector2D<float> operator*(float, const Vector2D<float>&);
+
+template <typename T> Vector2D<T>::Vector2D(T inX, T inY) : x(inX), y(inY) {}
+
+template <typename T> Vector2D<T>::~Vector2D() {}
+
+template <typename T> Vector2D<T> &Vector2D<T>::operator+=(const Vector2D<T> &vector) {
+  x += vector.x;
+  y += vector.y;
+  return (*this);
+}
+
+template <typename T> Vector2D<T> &Vector2D<T>::operator-=(const Vector2D<T> &vector) {
+  x -= vector.x;
+  y -= vector.y;
+  return (*this);
+}
+
+template <typename T> Vector2D<T> operator+(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB) {
+  return Vector2D<T>(vectorA.x + vectorB.x, vectorA.y + vectorB.y);
+}
+
+template <typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB) {
+  return Vector2D<T>(vectorA.x - vectorB.x, vectorA.y - vectorB.y);
+}
+
+template <typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA) {
+ return Vector2D<T>(-vectorA.x, -vectorA.y);
+}
+
+template <typename T> Vector2D<T> operator/(const Vector2D<T> &vector, float coeff) {
+  if (coeff != 0) {
+    return Vector2D<T>(vector.x / coeff, vector.y / coeff);
+  } else {
+    return Vector2D<T>(0, 0);
+  }
+}
+
+template <typename T> Vector2D<T> operator*(const Vector2D<T> &vector, float coeff) {
+  return Vector2D<T>(vector.x * coeff, vector.y * coeff);
+}
+
+template <typename T> Vector2D<T> operator*(float coeff, const Vector2D<T> &vector) {
+  return Vector2D<T>(vector.x * coeff, vector.y * coeff);
+}
+
+template <typename T> void Vector2D<T>::Rotate(float value) {
+  float xTmp;
+  xTmp = x * cosf(value) - y * sinf(value);
+  y = x * sinf(value) + y * cosf(value);
+  x = xTmp;
+}
+
+template <typename T> void Vector2D<T>::RotateDeg(float value) { Rotate(Euler::ToRadian(value)); }
+
+template <typename T> float Vector2D<T>::GetNorm(void) const { return sqrt(x * x + y * y); }
+
+template <typename T> void Vector2D<T>::Normalize(void) {
+  float n = GetNorm();
+  if (n != 0) {
+    x = x / n;
+    y = y / n;
+  }
+}
+
+template <typename T> void Vector2D<T>::Saturate(Vector2D min, Vector2D max) {
+  if (x < min.x)
+    x = min.x;
+  if (x > max.x)
+    x = max.x;
+
+  if (y < min.y)
+    y = min.y;
+  if (y > max.y)
+    y = max.y;
+}
+
+template <typename T> void Vector2D<T>::Saturate(float min, float max) {
+  Saturate(Vector2D(min, min), Vector2D(max, max));
+}
+
+template <typename T> void Vector2D<T>::Saturate(const Vector2D &value) {
+  float x = fabs(value.x);
+  float y = fabs(value.y);
+  Saturate(Vector2D(-x, -y), Vector2D(x, y));
+}
+
+template <typename T> void Vector2D<T>::Saturate(float value) {
+  float sat = fabs(value);
+  Saturate(Vector2D(-sat, -sat), Vector2D(sat, sat));
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Vector2D.h
===================================================================
--- tags/latest/lib/FlairCore/src/Vector2D.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector2D.h	(revision 209)
@@ -0,0 +1,188 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Vector2D.h
+ * \brief Class defining a 2D vector
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+
+#ifndef VECTOR2D_H
+#define VECTOR2D_H
+
+namespace flair {
+namespace core {
+
+/*! \class Vector2D
+*
+* \brief Class defining a 2D vector
+*/
+template <typename T>
+class Vector2D {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Vector2D using specified values.
+  *
+  * \param x
+  * \param y
+  */
+  Vector2D(T x = 0, T y = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Vector2D();
+
+  /*!
+  * \brief Rotation
+  *
+  * \param value rotation value in radians
+  */
+  void Rotate(float value);
+
+  /*!
+  * \brief Rotation
+  *
+  * \param value rotation value in degrees
+  */
+  void RotateDeg(float value);
+
+  /*!
+  * \brief Norm
+  *
+  * \return value
+  */
+  float GetNorm(void) const;
+
+  /*!
+  * \brief Normalize
+  */
+  void Normalize(void);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between min and max
+  *
+  * \param min minimum Vector2D value
+  * \param max maximum Vector2D value
+  */
+  void Saturate(Vector2D<T> min, Vector2D<T> max);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between min and max
+  *
+  * \param min minimum Vector2D(min,min) value
+  * \param max maximum Vector2D(max,max) value
+  */
+  void Saturate(float min, float max);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between -abs(value) and abs(value)
+  *
+  * \param value saturation Vector2D value
+  */
+  void Saturate(const Vector2D<T> &value);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between -abs(Vector2D(value,value)) and abs(Vector2D(value,value))
+  *
+  * \param value saturation Vector2D(value,value)
+  */
+  void Saturate(float value);
+
+  /*!
+  * \brief x
+  */
+  T x;
+
+  /*!
+  * \brief y
+  */
+  T y;
+
+  template<typename S> Vector2D<T> &operator=(const Vector2D<S> &vector) {
+    x = vector.x;
+    y = vector.y;
+    return (*this);
+  }
+  Vector2D<T> &operator+=(const Vector2D<T> &vector);
+  Vector2D<T> &operator-=(const Vector2D<T> &vector);
+};
+
+typedef Vector2D<float> Vector2Df;
+
+/*! Add
+*
+* \brief Add
+*
+* \param vectorA vector
+* \param vectorB vector
+*/
+template<typename T> Vector2D<T> operator+(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB);
+
+/*! Substract
+*
+* \brief Substract
+*
+* \param vectorA vector
+* \param vectorB vector
+*/
+template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB);
+
+/*! Opposite
+*
+* \brief Opposite
+*
+* \param vectorA vector
+* 
+* \return -vectorA
+*/
+template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA);
+
+/*! Divid
+*
+* \brief Divid
+*
+* \param vector vector
+* \param coeff coefficent
+* \return vector/coefficient
+*/
+template<typename T> Vector2D<T> operator/(const Vector2D<T> &vector, float coeff);
+
+/*! Multiply
+*
+* \brief Multiplyf
+*
+* \param vector vector
+* \param coeff coefficent
+* \return coefficient*vector
+*/
+template<typename T> Vector2D<T> operator*(const Vector2D<T> &vector, float coeff);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param coeff coefficent
+* \param vector vector
+* \return coefficient*vector
+*/
+template<typename T> Vector2D<T> operator*(float coeff, const Vector2D<T> &vector);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR2D_H
Index: tags/latest/lib/FlairCore/src/Vector3D.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3D.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3D.cpp	(revision 209)
@@ -0,0 +1,265 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Vector3D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 3D vector
+//
+//
+/*********************************************************************/
+
+#include "Vector3D.h"
+#include "Vector2D.h"
+#include "RotationMatrix.h"
+#include "Euler.h"
+#include "Quaternion.h"
+#include "Object.h"
+#include <math.h>
+
+namespace flair {
+namespace core {
+  
+template class Vector3D<double>;
+template Vector3D<double> operator+(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator-(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator-(const Vector3D<double>&);
+template Vector3D<double> operator/(const Vector3D<double>&, float);
+template Vector3D<double> operator*(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator*(const Vector3D<double>&, float);
+template Vector3D<double> operator*(float, const Vector3D<double>&);
+template Vector3D<double> CrossProduct(const Vector3D<double>&, const Vector3D<double>&);
+template float DotProduct(const Vector3D<double>&, const Vector3D<double>&);
+
+template class Vector3D<float>;
+template Vector3D<float> operator+(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator-(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator-(const Vector3D<float>&);
+template Vector3D<float> operator/(const Vector3D<float>&, float);
+template Vector3D<float> operator*(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator*(const Vector3D<float>&, float);
+template Vector3D<float> operator*(float, const Vector3D<float>&);
+template Vector3D<float> CrossProduct(const Vector3D<float>&, const Vector3D<float>&);
+template float DotProduct(const Vector3D<float>&, const Vector3D<float>&);
+
+template <typename T> Vector3D<T>::Vector3D(T inX, T inY, T inZ) {
+  x=inX;
+  y=inY;
+  z=inZ;
+}
+
+template <typename T> Vector3D<T>::~Vector3D() {}
+
+/*
+void Vector3D::operator=(const gui::Vector3DSpinBox *vector) {
+    Vector3D vect=vector->Value();
+    x=vect.x;
+    y=vect.y;
+    z=vect.z;
+}*/
+/*
+template<typename T,typename S> Vector3D<T> &Vector3D<T>::operator=(const Vector3D<S> &vector) {
+//template <typename T> Vector3D<T> &Vector3D<T>::operator=(const Vector3D<T> &vector) {
+  x = vector.x;
+  y = vector.y;
+  z = vector.z;
+  return (*this);
+}
+*/
+template <typename T> Vector3D<T> &Vector3D<T>::operator+=(const Vector3D<T> &vector) {
+  x += vector.x;
+  y += vector.y;
+  z += vector.z;
+  return (*this);
+}
+
+template <typename T> Vector3D<T> &Vector3D<T>::operator-=(const Vector3D<T> &vector) {
+  x -= vector.x;
+  y -= vector.y;
+  z -= vector.z;
+  return (*this);
+}
+
+template <typename T> T &Vector3D<T>::operator[](size_t idx) {
+  if (idx == 0) {
+    return x;
+  } else if (idx == 1) {
+    return y;
+  } else if (idx == 2) {
+    return z;
+  } else {
+    Printf("Vector3D: index %i out of bound\n", idx);
+    return z;
+  }
+}
+
+template <typename T> const T &Vector3D<T>::operator[](size_t idx) const {
+  if (idx == 0) {
+    return x;
+  } else if (idx == 1) {
+    return y;
+  } else if (idx == 2) {
+    return z;
+  } else {
+    Printf("Vector3D: index %i out of bound\n", idx);
+    return z;
+  }
+}
+
+template <typename T> Vector3D<T> CrossProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.y * vectorB.z - vectorA.z * vectorB.y,
+                  vectorA.z * vectorB.x - vectorA.x * vectorB.z,
+                  vectorA.x * vectorB.y - vectorA.y * vectorB.x);
+}
+
+template <typename T> float DotProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return vectorA.x * vectorB.x + vectorA.y * vectorB.y + vectorA.z * vectorB.z;
+}
+
+template <typename T> Vector3D<T> operator+(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x + vectorB.x, vectorA.y + vectorB.y,
+                  vectorA.z + vectorB.z);
+}
+
+template <typename T> Vector3D<T> operator-(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x - vectorB.x, vectorA.y - vectorB.y,
+                  vectorA.z - vectorB.z);
+}
+
+template <typename T> Vector3D<T> operator-(const Vector3D<T> &vector) {
+  return Vector3D<T>(-vector.x, -vector.y, -vector.z);
+}
+
+template <typename T> Vector3D<T> operator*(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x * vectorB.x, vectorA.y * vectorB.y,
+                  vectorA.z * vectorB.z);
+}
+
+template <typename T> Vector3D<T> operator*(const Vector3D<T> &vector, float coeff) {
+  return Vector3D<T>(vector.x * coeff, vector.y * coeff, vector.z * coeff);
+}
+
+template <typename T> Vector3D<T> operator*(float coeff, const Vector3D<T> &vector) {
+  return Vector3D<T>(vector.x * coeff, vector.y * coeff, vector.z * coeff);
+}
+
+template <typename T> Vector3D<T> operator/(const Vector3D<T> &vector, float coeff) {
+  if (coeff != 0) {
+    return Vector3D<T>(vector.x / coeff, vector.y / coeff, vector.z / coeff);
+  } else {
+    printf("Vector3D: err divinding by 0\n");
+    return Vector3D<T>(0, 0, 0);
+  }
+}
+
+template <typename T> void Vector3D<T>::RotateX(float value) {
+  float y_tmp;
+  y_tmp = y * cosf(value) - z * sinf(value);
+  z = y * sinf(value) + z * cosf(value);
+  y = y_tmp;
+}
+
+template <typename T> void Vector3D<T>::RotateXDeg(float value) { RotateX(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::RotateY(float value) {
+  float x_tmp;
+  x_tmp = x * cosf(value) + z * sinf(value);
+  z = -x * sinf(value) + z * cosf(value);
+  x = x_tmp;
+}
+
+template <typename T> void Vector3D<T>::RotateYDeg(float value) { RotateY(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::RotateZ(float value) {
+  float x_tmp;
+  x_tmp = x * cosf(value) - y * sinf(value);
+  y = x * sinf(value) + y * cosf(value);
+  x = x_tmp;
+}
+
+template <typename T> void Vector3D<T>::RotateZDeg(float value) { RotateZ(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::Rotate(const RotationMatrix &matrix) {
+  T a[3] = {0, 0, 0};
+  T b[3] = {x, y, z};
+
+  for (int i = 0; i < 3; i++) {
+    for (int j = 0; j < 3; j++) {
+      a[i] += matrix.m[i][j] * b[j];
+    }
+  }
+
+  x = a[0];
+  y = a[1];
+  z = a[2];
+}
+
+template <typename T> void Vector3D<T>::Rotate(const Quaternion &quaternion) {
+  RotationMatrix matrix;
+  quaternion.ToRotationMatrix(matrix);
+  Rotate(matrix);
+}
+
+template <typename T> void Vector3D<T>::To2Dxy(Vector2D<T> &vector) const {
+  vector.x = x;
+  vector.y = y;
+}
+
+template <typename T> Vector2D<T> Vector3D<T>::To2Dxy(void) const {
+  Vector2D<T> vect;
+  To2Dxy(vect);
+  return vect;
+}
+
+template <typename T> float Vector3D<T>::GetNorm(void) const { return sqrt(x * x + y * y + z * z); }
+
+template <typename T> void Vector3D<T>::Normalize(void) {
+  float n = GetNorm();
+  if (n != 0) {
+    x = x / n;
+    y = y / n;
+    z = z / n;
+  }
+}
+
+template <typename T> void Vector3D<T>::Saturate(const Vector3D<T> &min, const Vector3D<T> &max) {
+  if (x < min.x)
+    x = min.x;
+  if (x > max.x)
+    x = max.x;
+
+  if (y < min.y)
+    y = min.y;
+  if (y > max.y)
+    y = max.y;
+
+  if (z < min.z)
+    z = min.z;
+  if (z > max.z)
+    z = max.z;
+}
+
+template <typename T> void Vector3D<T>::Saturate(float min, float max) {
+  Saturate(Vector3D<T>(min, min, min), Vector3D<T>(max, max, max));
+}
+
+template <typename T> void Vector3D<T>::Saturate(const Vector3D<T> &value) {
+  float x = fabs(value.x);
+  float y = fabs(value.y);
+  float z = fabs(value.z);
+  Saturate(Vector3D<T>(-x, -y, -z), Vector3D<T>(x, y, z));
+}
+
+template <typename T> void Vector3D<T>::Saturate(float value) {
+  float sat = fabs(value);
+  Saturate(Vector3D<T>(-sat, -sat, -sat), Vector3D<T>(sat, sat, sat));
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Vector3D.h
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3D.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3D.h	(revision 209)
@@ -0,0 +1,309 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+/*!
+ * \file Vector3D.h
+ * \brief Class defining a 3D vector
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+#ifndef VECTOR3D_H
+#define VECTOR3D_H
+
+#include <stddef.h>
+#include <Vector2D.h>
+
+namespace flair {
+namespace core {
+class RotationMatrix;
+class Quaternion;
+
+/*! \class Vector3D
+*
+* \brief Class defining a 3D vector
+*/
+template <typename T>
+class Vector3D {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Vector3D using specified values.
+  *
+  * \param x
+  * \param y
+  * \param z
+  */
+  Vector3D(T x = 0, T y = 0, T z = 0);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Vector3D();
+
+  /*!
+  * \brief x
+  */
+  T x;
+
+  /*!
+  * \brief y
+  */
+  T y;
+
+  /*!
+  * \brief z
+  */
+  T z;
+
+  /*!
+  * \brief x axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  void RotateX(float value);
+
+  /*!
+  * \brief x axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  void RotateXDeg(float value);
+
+  /*!
+  * \brief y axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  void RotateY(float value);
+
+  /*!
+  * \brief y axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  void RotateYDeg(float value);
+
+  /*!
+  * \brief z axis rotation
+  *
+  * \param value rotation value in radians
+  */
+  void RotateZ(float value);
+
+  /*!
+  * \brief z axis rotation
+  *
+  * \param value rotation value in degrees
+  */
+  void RotateZDeg(float value);
+
+  /*!
+  * \brief rotation
+  *
+  * \param matrix rotation matrix
+  */
+  void Rotate(const RotationMatrix &matrix);
+
+  /*!
+  * \brief rotation
+  *
+  * Compute a rotation from a quaternion. This method uses a rotation matrix
+  * internaly.
+  *
+  * \param quaternion quaternion
+  */
+  void Rotate(const Quaternion &quaternion);
+
+  /*!
+  * \brief Convert to a Vector2D
+  *
+  * Uses x and y coordinates.
+  *
+  * \param vector destination
+  */
+  void To2Dxy(Vector2D<T> &vector) const;
+
+  /*!
+  * \brief Convert to a Vector2D
+  *
+  * Uses x and y coordinates.
+  *
+  * \return destination
+  */
+  Vector2D<T> To2Dxy(void) const;
+
+  /*!
+  * \brief Norm
+  *
+  * \return value
+  */
+  float GetNorm(void) const;
+
+  /*!
+  * \brief Normalize
+  */
+  void Normalize(void);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between min and max
+  *
+  * \param min minimum value
+  * \param max maximum value
+  */
+  void Saturate(const Vector3D<T> &min, const Vector3D<T> &max);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between min and max
+  *
+  * \param min minimum Vector3D(min,min,min) value
+  * \param max maximum Vector3D(max,max,max) value
+  */
+  void Saturate(float min, float max);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between -abs(value) and abs(value)
+  *
+  * \param value saturation Vector3D value
+  */
+  void Saturate(const Vector3D<T> &value);
+
+  /*!
+  * \brief Saturate
+  *
+  * Saturate between -abs(Vector3D(value,value,value)) and
+  *abs(Vector3D(value,value,value))
+  *
+  * \param value saturation Vector3D(value,value,value)
+  */
+  void Saturate(float value);
+
+  T &operator[](size_t idx);
+  const T &operator[](size_t idx) const;
+  //Vector3D<T> &operator=(const Vector3D<T> &vector);
+  template<typename S> Vector3D<T> &operator=(const Vector3D<S> &vector) {
+    x = vector.x;
+    y = vector.y;
+    z = vector.z;
+    return (*this);
+  }
+  Vector3D<T> &operator+=(const Vector3D<T> &vector);
+  Vector3D<T> &operator-=(const Vector3D<T> &vector);
+
+private:
+};
+
+typedef Vector3D<float> Vector3Df;
+
+/*! Add
+*
+* \brief Add
+*
+* \param vectorA vector
+* \param vectorB vector
+*
+* \return vectorA+vectorB
+*/
+template<typename T> Vector3D<T> operator+(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
+
+/*! Substract
+*
+* \brief Substract
+*
+* \param vectorA vector
+* \param vectorB vector
+*
+* \return vectorA-vectorB
+*/
+template<typename T> Vector3D<T> operator-(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
+
+/*! Minus
+*
+* \brief Minus
+*
+* \param vector vector
+*
+* \return -vector
+*/
+template<typename T> Vector3D<T> operator-(const Vector3D<T> &vector);
+
+/*! Divid
+*
+* \brief Divid
+*
+* \param vector vector
+* \param coeff coefficent
+*
+* \return vector/coefficient
+*/
+template<typename T> Vector3D<T> operator/(const Vector3D<T> &vector, float coeff);
+
+/*! Hadamard product
+*
+* \brief Hadamard product
+*
+* \param vectorA vector
+* \param vectorBA vector
+*
+* \return Hadamard product
+*/
+template<typename T> Vector3D<T> operator*(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param vector vector
+* \param coeff coefficent
+*
+* \return coefficient*vector
+*/
+template<typename T> Vector3D<T> operator*(const Vector3D<T> &vector, float coeff);
+
+/*! Multiply
+*
+* \brief Multiply
+*
+* \param coeff coefficent
+* \param vector vector
+*
+* \return coefficient*vector
+*/
+template<typename T> Vector3D<T> operator*(float coeff, const Vector3D<T> &vector);
+
+/*! Cross product
+*
+* \brief Cross product
+*
+* \param vectorA first vector
+* \param vectorB second vector
+*
+* \return cross product
+*/
+template<typename T> Vector3D<T> CrossProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
+
+/*! Dot product
+*
+* \brief Dot product
+*
+* \param vectorA first vector
+* \param vectorB second vector
+*
+* \return dot product
+*/
+template<typename T> float DotProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR3D_H
Index: tags/latest/lib/FlairCore/src/Vector3DSpinBox.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 209)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/22
+//  filename:   Vector3DSpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying 3 QDoubleSpinBox for x,y,z on the ground
+//  station
+//
+//
+/*********************************************************************/
+
+#include "Vector3DSpinBox.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition *position, string name,
+                                 double min, double max, double step,
+                                 int decimals, core::Vector3Df default_value)
+    : Box(position, name, "Vector3DSpinBox") {
+  // update value from xml file
+  default_value.Saturate(min, max);
+  box_value = default_value;
+
+  SetVolatileXmlProp("min", min);
+  SetVolatileXmlProp("max", max);
+  SetVolatileXmlProp("step", step);
+  SetVolatileXmlProp("decimals", decimals);
+  GetPersistentXmlProp("value_x", box_value.x);
+  SetPersistentXmlProp("value_x", box_value.x);
+  GetPersistentXmlProp("value_y", box_value.y);
+  SetPersistentXmlProp("value_y", box_value.y);
+  GetPersistentXmlProp("value_z", box_value.z);
+  SetPersistentXmlProp("value_z", box_value.z);
+
+  SendXml();
+}
+
+Vector3DSpinBox::~Vector3DSpinBox() {}
+/*
+Vector3DSpinBox::operator core::Vector3D() const {
+    return Value();
+}
+*/
+core::Vector3Df Vector3DSpinBox::Value(void) const {
+  core::Vector3Df tmp;
+
+  GetMutex();
+  tmp = box_value;
+  ReleaseMutex();
+
+  return tmp;
+}
+
+void Vector3DSpinBox::XmlEvent(void) {
+  bool changed = false;
+  GetMutex();
+  if (GetPersistentXmlProp("value_x", box_value.x))
+    changed = true;
+  if (GetPersistentXmlProp("value_y", box_value.y))
+    changed = true;
+  if (GetPersistentXmlProp("value_z", box_value.z))
+    changed = true;
+  if (changed)
+    SetValueChanged();
+  ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Vector3DSpinBox.h
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3DSpinBox.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3DSpinBox.h	(revision 209)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Vector3DSpinBox.h
+ * \brief Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef VECTOR3DSPINBOX_H
+#define VECTOR3DSPINBOX_H
+
+#include <Box.h>
+#include <Vector3D.h>
+
+namespace flair {
+namespace gui {
+class Layout;
+
+/*! \class Vector3DSpinBox
+*
+* \brief Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
+*
+*/
+class Vector3DSpinBox : public Box {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Vector3DSpinBox at given position. \n
+  * Each DoubleSpinBox is saturated to min and max values.
+  *
+  * \param position position to display the Vector3DSpinBox
+  * \param name name
+  * \param min minimum value
+  * \param max maximum value
+  * \param step step
+  * \param decimals number of decimals
+  * \param default_value default value if not in the xml config file
+  */
+  Vector3DSpinBox(const LayoutPosition *position, std::string name, double min,
+                  double max, double step, int decimals = 2,
+                  core::Vector3Df default_value = core::Vector3Df(0, 0, 0));
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Vector3DSpinBox();
+
+  /*!
+  * \brief Value
+  *
+  * \return value
+  */
+  core::Vector3Df Value(void) const;
+  // operator core::Vector3D() const;
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  core::Vector3D<double> box_value;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // VECTOR3DSPINBOX_H
Index: tags/latest/lib/FlairCore/src/Vector3Ddata.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3Ddata.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3Ddata.cpp	(revision 209)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/11/26
+//  filename:   Vector3Ddata.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 3D vector and a io_data
+//
+//
+/*********************************************************************/
+
+#include "Vector3Ddata.h"
+#include <string.h>
+
+#define X 0
+#define Y 1
+#define Z 2
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+/*! \class Vector3DdataElement
+ */
+class Vector3DdataElement : public IODataElement {
+public:
+  Vector3DdataElement(const Vector3Ddata *data, string name, uint32_t elem)
+      : IODataElement(data, name) {
+    this->data = data;
+    this->elem = elem;
+    size = 4;
+  }
+
+  ~Vector3DdataElement() {}
+
+  void CopyData(char *dst) const {
+    float value;
+    data->GetMutex();
+    switch (elem) {
+    case X:
+      value = data->x;
+      break;
+    case Y:
+      value = data->y;
+      break;
+    case Z:
+      value = data->z;
+      break;
+    default:
+      data->Err("type not handled\n");
+      value = 0;
+      break;
+    }
+    data->ReleaseMutex();
+
+    memcpy(dst, &value, sizeof(float));
+  }
+
+  ScalarType const &GetDataType() const { return dataType; }
+
+private:
+  const Vector3Ddata *data;
+  uint32_t elem;
+  FloatType dataType;
+};
+
+Vector3Ddata::Vector3Ddata(const Object *parent, string name, float x, float y,
+                           float z, uint32_t n)
+    : io_data(parent, name, n), Vector3D(x, y, z) {}
+
+Vector3Ddata::~Vector3Ddata() {}
+
+void Vector3Ddata::CopyDatas(char *dst) const {
+  GetMutex();
+  memcpy(dst, &x, sizeof(float));
+  memcpy(dst + sizeof(float), &y, sizeof(float));
+  memcpy(dst + 2 * sizeof(float), &z, sizeof(float));
+  ReleaseMutex();
+}
+
+IODataElement *Vector3Ddata::XElement(void) const {
+  return new Vector3DdataElement(this, "x", X);
+}
+
+IODataElement *Vector3Ddata::YElement(void) const {
+  return new Vector3DdataElement(this, "y", Y);
+}
+
+IODataElement *Vector3Ddata::ZElement(void) const {
+  return new Vector3DdataElement(this, "z", Z);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Vector3Ddata.h
===================================================================
--- tags/latest/lib/FlairCore/src/Vector3Ddata.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Vector3Ddata.h	(revision 209)
@@ -0,0 +1,90 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+/*!
+ * \file Vector3Ddata.h
+ * \brief Class defining a 3D vector and a io_data
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+#ifndef VECTOR3DDATA_H
+#define VECTOR3DDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+
+namespace flair {
+namespace core {
+
+/*! \class Vector3Ddata
+*
+* \brief Class defining a 3D vector and a io_data
+* User must manually use the io_data's Mutex to access to Vector3D values.
+*/
+class Vector3Ddata : public io_data, public Vector3Df {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Vector3D using specified values.
+  *
+  * \param x
+  * \param y
+  * \param z
+  */
+  Vector3Ddata(const Object *parent, std::string name, float x = 0, float y = 0,
+               float z = 0, uint32_t n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Vector3Ddata();
+
+  /*!
+  * \brief X Element
+  *
+  * Get a vectorer to x element. This pointer can be used for plotting.
+  *
+  * \return pointer to the element
+  */
+  IODataElement *XElement(void) const;
+
+  /*!
+  * \brief Y Element
+  *
+  * Get a pointer to y element. This pointer can be used for plotting.
+  *
+  * \return pointer to the element
+  */
+  IODataElement *YElement(void) const;
+
+  /*!
+  * \brief Z Element
+  *
+  * Get a pointer to z element. This pointer can be used for plotting.
+  *
+  * \return pointer to the element
+  */
+  IODataElement *ZElement(void) const;
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR3DDATA_H
Index: tags/latest/lib/FlairCore/src/Watchdog.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Watchdog.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Watchdog.cpp	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/25
+//  filename:   Watchdog.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Watchdog class
+//
+/*********************************************************************/
+
+#include "Watchdog.h"
+
+namespace flair {
+namespace core {
+
+Watchdog::Watchdog(const Object *parent, std::function<void()> _expired,
+                   Time _timer)
+    : Thread(parent, "watchdog", 0), expired(_expired), timer(_timer) {}
+
+Watchdog::~Watchdog() {
+  SafeStop();
+  Join();
+}
+
+void Watchdog::Touch() {
+  if (IsSuspended())
+    Resume();
+}
+
+void Watchdog::SetTimer(Time _Timer) {
+  timer = _Timer;
+  Touch();
+}
+
+void Watchdog::Run() {
+  while (!ToBeStopped()) {
+    Time current = GetTime();
+    Time date = current + timer;
+    // Printf("watchdog goes to sleep at %llu, scheduled to wake up at
+    // %llu\n",current,date);
+    if (!SuspendUntil(date)) {
+      expired();
+    }
+  }
+};
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Watchdog.h
===================================================================
--- tags/latest/lib/FlairCore/src/Watchdog.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Watchdog.h	(revision 209)
@@ -0,0 +1,47 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Watchdog.h
+ * \brief Watchdog Class
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/25
+ * \version 1.0
+ */
+
+#ifndef WATCHDOG_H
+#define WATCHDOG_H
+
+#include <Thread.h>
+#include <functional>
+
+namespace flair {
+namespace core {
+
+/*! \class Watchdog
+*
+* \brief Watchdog class
+*
+* Calls a given function if not touched within a specified period of time
+*
+*/
+class Watchdog : public Thread {
+public:
+  Watchdog(const Object *parent, std::function<void()> _expired, Time _timer);
+  ~Watchdog();
+
+  // reset the timer
+  void Touch();
+  void SetTimer(Time _Timer);
+
+private:
+  void Run();
+  std::function<void()> expired;
+  Time timer;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // WATCHDOG_H
Index: tags/latest/lib/FlairCore/src/Widget.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Widget.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Widget.cpp	(revision 209)
@@ -0,0 +1,239 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/02
+//  filename:   Widget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for all Framework's widget classes
+//
+//
+/*********************************************************************/
+
+#include "Widget.h"
+#include "Widget_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+using namespace core;
+
+Widget::Widget(const Widget *parent, string name, string type)
+    : Object(parent, name, type) {
+  pimpl_ = new Widget_impl(this, parent, name, type);
+}
+
+Widget::~Widget() { delete pimpl_; }
+
+template <> bool Widget::GetPersistentXmlProp(std::string prop, double &value) {
+  xmlChar *result = NULL;
+  result = xmlGetProp(pimpl_->file_node, (xmlChar *)prop.c_str());
+
+  if (result != NULL) {
+    value = xmlXPathCastStringToNumber(result);
+    xmlFree(result);
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <> bool Widget::GetPersistentXmlProp(std::string prop, float &value) {
+  double tmp;
+  if (GetPersistentXmlProp<double>(prop, tmp)) {
+    value = tmp;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <> bool Widget::GetPersistentXmlProp(std::string prop, bool &value) {
+  double tmp;
+  if (GetPersistentXmlProp<double>(prop, tmp)) {
+    value = tmp;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop, int32_t &value) {
+  double tmp;
+  if (GetPersistentXmlProp<double>(prop, tmp)) {
+    value = tmp;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop, uint16_t &value) {
+  double tmp;
+  if (GetPersistentXmlProp<double>(prop, tmp)) {
+    value = tmp;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop, std::string &value) {
+  xmlChar *result = NULL;
+  result = xmlGetProp(pimpl_->file_node, (xmlChar *)prop.c_str());
+  if (result != NULL) {
+    value = std::string((char *)result);
+    xmlFree(result);
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, string value, xmlNodePtr node) {
+  if (node == NULL)
+    node = pimpl_->send_node;
+  xmlSetProp(node, (xmlChar *)prop.c_str(), (xmlChar *)value.c_str());
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, char *value, xmlNodePtr node) {
+  if (node == NULL)
+    node = pimpl_->send_node;
+  xmlSetProp(node, (xmlChar *)prop.c_str(), (xmlChar *)value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, double value, xmlNodePtr node) {
+  xmlChar *xmlChar_value = xmlXPathCastNumberToString(value);
+
+  if (node == NULL)
+    node = pimpl_->send_node;
+  xmlSetProp(node, (xmlChar *)prop.c_str(), xmlChar_value);
+  xmlFree(xmlChar_value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, float value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, int32_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, uint32_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, int16_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, uint16_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, int8_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, uint8_t value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, bool value, xmlNodePtr node) {
+  SetVolatileXmlProp<double>(prop, value, node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, xmlChar *value, xmlNodePtr node) {
+  if (node == NULL)
+    node = pimpl_->send_node;
+  xmlSetProp(node, (xmlChar *)prop.c_str(), value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop, DataType const &dataType,
+                                xmlNodePtr node) {
+  if (node == NULL)
+    node = pimpl_->send_node;
+  xmlSetProp(node, (xmlChar *)prop.c_str(),
+             (xmlChar *)dataType.GetDescription().c_str());
+  /*
+      switch(dataType)
+      {
+          case io_data::Float:
+              xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"float");
+              break;
+          case io_data::Int8_t:
+              xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"int8_t");
+              break;
+          case io_data::Int16_t:
+              xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"int16_t");
+              break;
+      }
+      */
+}
+
+template <> void Widget::SetPersistentXmlProp(std::string prop, double value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+template <> void Widget::SetPersistentXmlProp(std::string prop, float value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+template <> void Widget::SetPersistentXmlProp(std::string prop, int32_t value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop, uint16_t value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+template <> void Widget::SetPersistentXmlProp(std::string prop, bool value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+template <> void Widget::SetPersistentXmlProp(std::string prop, std::string value) {
+  SetVolatileXmlProp(prop, value);
+  SetVolatileXmlProp(prop, value, pimpl_->file_node);
+}
+
+void Widget::UnsetPersistentXmlProp(std::string prop) {
+  xmlUnsetProp(pimpl_->file_node, (xmlChar *)prop.c_str());
+}
+
+void Widget::SendXml(void) { pimpl_->SendXml(); }
+
+void Widget::setEnabled(bool status) { pimpl_->setEnabled(status); }
+
+bool Widget::isEnabled(void) const { return pimpl_->isenabled; }
+
+} // end namespace gui
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/Widget.h
===================================================================
--- tags/latest/lib/FlairCore/src/Widget.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/Widget.h	(revision 209)
@@ -0,0 +1,161 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Widget.h
+ * \brief Abstract class for all Framework's widget classes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/02
+ * \version 4.0
+ */
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <Object.h>
+//#include <io_data.h>
+#include <libxml/xpath.h>
+
+class Widget_impl;
+class FrameworkManager_impl;
+
+namespace flair {
+namespace gui {
+
+/*! \class Widget
+*
+* \brief Abstract class for all Framework's widget classes
+*
+* A widget is an object to display on the ground station. \n
+* Communication with ground station is done through xml files; properties of
+*theses files
+* are modified through appropriate method. \n
+* A xml file is used for default values of the Widget, if it has been specified
+*in the
+*  constructor of the FrameworkManager.
+*/
+class Widget : public core::Object {
+  friend class core::FrameworkManager;
+  friend class ::Widget_impl;
+  friend class ::FrameworkManager_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Widget, the xml file specified to the FrameworkManager's
+  * constructor is sued for default values. \n
+  * Two Widget with same parent must have different names. If a brother Widget
+  *already
+  * has the same name, the name of the new one will be automatically changed. \n
+  * Type must agree with predifined (hard coded) types
+  * in ground station code.
+  *
+  * \param parent parent
+  * \param name name
+  * \param type type
+  */
+  Widget(const Widget *parent, std::string name, std::string type);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  virtual ~Widget();
+
+  /*!
+  * \brief Set enabled
+  *
+  * Enable or disable the Widget on the ground station. \n
+  * A disabled widget is greyed out on the ground station
+  * and in unmodifiable.
+  *
+  * \param status
+  */
+  void setEnabled(bool status);
+
+  /*!
+  * \brief Is enabled?
+  *
+  * \return true if widget is enabled
+  */
+  bool isEnabled(void) const;
+
+protected:
+  /*!
+  * \brief Set a persistent xml property
+  *
+  * The property will be saved in the configuration xml and also used to
+  *configure the ground station.
+  *
+  * \param prop property to set and save
+  * \param value value to set and save
+  */
+  template <typename T> void SetPersistentXmlProp(std::string prop, T value);
+
+  /*!
+  * \brief Get a persistent xml property
+  *
+  * Get the property from the xml file. If no corresponding property is found in
+  *the xml, value remains unchanged. \n
+  * Thus value can be initialized with a default value before calling this
+  *method.
+  *
+  * \param prop property to get
+  * \param value value to store the result
+  * \return true if value was changed
+  */
+  template <typename T> bool GetPersistentXmlProp(std::string prop, T &value);
+
+  /*!
+  * \brief Set a volatile xml property
+  *
+  * This property should be used to configure the ground station (one time
+  *init). \n
+  * The property will be destroyed after calling SendXml() as it should no be
+  *used anymore.
+  *
+  * \param prop property to set
+  * \param value value to set
+  * \param node if sepcified, node to set; otherwise use the node of the Widget
+  */
+  template <typename T>
+  void SetVolatileXmlProp(std::string prop, T value, xmlNodePtr node = NULL);
+
+  /*!
+  * \brief Send xml
+  *
+  * Send Widget's xml to ground station. \n
+  * New changes will be taken into account by ground station. \n
+  * All volatile properties will be erased after calling ths method, as they
+  *should not be used anymore.
+  */
+  void SendXml(void);
+
+  /*!
+  * \brief Xml event
+  *
+  * This method must be reimplemented to handle a xml event. \n
+  * It is automatically called when something changed from
+  * ground station. \n
+  */
+  virtual void XmlEvent(void){};
+
+  /*!
+   * \brief Unset a persistent xml property
+   * 
+   * Unset an existent property, so it won't be saved.
+   *
+   * \param prop property to set
+   */
+  void UnsetPersistentXmlProp(std::string prop);
+
+private:
+  class Widget_impl *pimpl_;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // WIDGET_H
Index: tags/latest/lib/FlairCore/src/Widget_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/Widget_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/Widget_impl.cpp	(revision 209)
@@ -0,0 +1,353 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/02
+//  filename:   Widget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour widget
+//
+//
+/*********************************************************************/
+
+#include "Widget.h"
+#include "Widget_impl.h"
+#include "Object_impl.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "config.h"
+#ifdef __XENO__
+#include <native/heap.h>
+#endif
+
+using std::string;
+using std::vector;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace {
+#ifdef __XENO__
+RT_HEAP xml_heap;
+
+void xml2_free(void *mem) {
+  // Printf("free %x\n",mem);
+  if (mem == NULL)
+    return;
+  int status = rt_heap_free(&xml_heap, mem);
+
+  if (status != 0) {
+		char errorMsg[256];
+    printf("libxml2: rt_heap_free error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+}
+
+void *xml2_alloc(size_t sz) {
+  void *ptr;
+  // printf("alloc %i\n",sz);
+  int status = rt_heap_alloc(&xml_heap, sz, TM_NONBLOCK, &ptr);
+  if (status != 0) {
+		char errorMsg[256];
+    printf("libxml2: rt_heap_alloc error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+  }
+  // Printf("alloc %x %i\n",ptr,sz);
+
+  return ptr;
+}
+
+void *xml2_realloc(void *emem, size_t sz) {
+  // Printf("realloc %x %i -> %i\n",emem,sz,sz);
+  void *mem_re;
+
+  if (emem == NULL) {
+    return xml2_alloc(sz);
+  } else if (sz == 0) {
+    xml2_free(emem);
+  }
+
+  mem_re = xml2_alloc(sz);
+
+  memcpy(mem_re, emem, sz);
+
+  xml2_free(emem);
+
+  return mem_re;
+}
+
+char *xml2_strdup(const char *str) {
+  // printf("strdup %s\n",str);
+  char *s = (char *)xml2_alloc(strlen(str) + 1);
+  if (s == NULL)
+    return NULL;
+
+  strcpy(s, str);
+  return s;
+}
+#endif //__XENO__
+}
+
+Widget_impl::Widget_impl(Widget *self, const Widget *parent, string name,
+                         string type) {
+  // Printf("Widget %s\n",name.c_str());
+  isenabled = true;
+  file_node = NULL;
+  this->self = self;
+
+  // n'est execute qu'une fois lorsqu'on construit le FrameworkManager
+  if (parent == NULL) {
+#ifdef __XENO__
+    string tmp_name;
+    tmp_name = name + "-xml";
+    int status = rt_heap_create(&xml_heap, tmp_name.c_str(), XML_HEAP, H_FIFO);
+    if (status != 0) {
+			char errorMsg[256];
+      self->Err("rt_heap_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+
+    xmlMemSetup(xml2_free, xml2_alloc, xml2_realloc, xml2_strdup);
+#endif //__XENO__
+  }
+
+  // xml init
+  if (parent == NULL) {
+    // create local doc
+    send_doc = xmlNewDoc((xmlChar *)"1.0");
+    send_node = xmlNewNode(NULL, (xmlChar *)type.c_str());
+    xmlDocSetRootElement(send_doc, send_node);
+    xmlSetProp(send_node, (xmlChar *)"name",
+               (xmlChar *)self->ObjectName().c_str());
+  } else {
+    parent->pimpl_->AddChild(self);
+
+    // get node corresponding to this widget in the xml file
+    if (parent->pimpl_->file_node != NULL) {
+      xmlChar *search = xmlCharStrdup(type.c_str());
+      file_node =
+          GetNodeByProp(parent->pimpl_->file_node->xmlChildrenNode, search,
+                        (xmlChar *)"name", (xmlChar *)name.c_str());
+      xmlFree(search);
+    } else {
+      self->Err("parent->file_node is NULL\n");
+    }
+
+    if (file_node == NULL) {
+      self->Warn("%s, no match found in xml file\n", type.c_str());
+      xmlNode *node;
+      node = xmlNewNode(NULL, (xmlChar *)type.c_str());
+      xmlSetProp(node, (xmlChar *)"name", (xmlChar *)name.c_str());
+      file_node = xmlAddChild(parent->pimpl_->file_node, node);
+      //((Widget*)getFrameworkManager())->pimpl_->PrintXml();
+    }
+
+    send_doc = parent->pimpl_->CopyDoc();
+
+    // on recupere le dernier node
+    xmlNodePtr node = xmlDocGetRootElement(send_doc);
+    while (node->children != NULL)
+      node = node->children;
+
+    // on ajoute le node du widget
+    send_node = xmlNewNode(NULL, (xmlChar *)type.c_str());
+    xmlSetProp(send_node, (xmlChar *)"name", (xmlChar *)name.c_str());
+    xmlAddChild(node, send_node);
+  }
+
+  // Printf("Widget ok %s\n",name.c_str());
+}
+
+Widget_impl::~Widget_impl() {
+  // Printf("destruction widget %s\n",self->ObjectName().c_str());
+
+  if (self->Parent() != NULL)
+    ((Widget *)(self->Parent()))->pimpl_->RemoveChild(self);
+
+  // on efface les widgets enfants avant d'envoyer son propre delete au sol
+  // dans le delete child on modifie le child du parent, donc on se refere
+  // toujours au premier
+  while (childs.size() != 0) {
+    // Printf("child %i
+    // %s\n",childs.size(),childs.front()->ObjectName().c_str());
+    if (childs.front() != NULL)
+      delete childs.front();
+  }
+  childs.clear();
+
+  self->SetVolatileXmlProp("Delete", true);
+
+  if (self->Parent() != NULL)
+    SendXml();
+
+  xmlFreeDoc(send_doc);
+
+  if (self->Parent() == NULL) {
+    xmlCleanupParser();
+#ifdef __XENO__
+    int status;
+		char errorMsg[256];
+    RT_HEAP_INFO info;
+    status = rt_heap_inquire(&xml_heap, &info);
+    if (status != 0) {
+      self->Err("rt_heap_inquire error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+    if (info.usedmem != 0)
+      self->Err("fuite memoire xml heap (%ld)\n", info.usedmem);
+    // Printf("fin heap xml\n");
+    status = rt_heap_delete(&xml_heap);
+    if (status != 0) {
+      self->Err("rt_heap_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    }
+#endif
+  }
+  // Printf("destruction widget %s ok\n",self->ObjectName().c_str());
+}
+
+void Widget_impl::AddChild(const Widget *child) {
+  childs.push_back((Widget *)child);
+}
+
+void Widget_impl::RemoveChild(const Widget *child) {
+  for (vector<Widget *>::iterator it = childs.begin(); it < childs.end();
+       it++) {
+    if (*it == child) {
+      childs.erase(it);
+      break;
+    }
+  }
+}
+
+xmlDocPtr Widget_impl::CopyDoc(void) { return xmlCopyDoc(send_doc, 1); }
+
+void Widget_impl::ClearXmlProps(void) {
+  xmlUnlinkNode(send_node);
+  xmlFreeNode(send_node);
+
+  xmlNodePtr node;
+  node = xmlDocGetRootElement(send_doc);
+
+  if (node == NULL) { // il ne reste plus rien, on refait le rootelement
+    send_node = xmlNewNode(NULL, (xmlChar *)XML_ROOT_TYPE);
+    xmlSetProp(send_node, (xmlChar *)"name",
+               (xmlChar *)self->ObjectName().c_str());
+    xmlDocSetRootElement(send_doc, send_node);
+  } else {
+    while (node->children != NULL)
+      node = node->children;
+    send_node = xmlNewNode(NULL, (xmlChar *)self->ObjectType().c_str());
+    xmlSetProp(send_node, (xmlChar *)"name",
+               (xmlChar *)self->ObjectName().c_str());
+    xmlAddChild(node, send_node);
+  }
+}
+
+void Widget_impl::printSendNode() {
+
+  xmlChar *xmlbuff;
+  int buffersize;
+  xmlDocDumpFormatMemory(send_doc, &xmlbuff, &buffersize, 1);
+  Printf("xml:\n%s\n", xmlbuff);
+  xmlFree(xmlbuff);
+}
+
+void Widget_impl::SendXml(void) {
+  if (getUiCom() != NULL) {
+    xmlChar *xmlbuff;
+    int buffersize;
+    xmlDocDumpFormatMemory(send_doc, &xmlbuff, &buffersize, 0);
+    getUiCom()->Send((char *)xmlbuff, buffersize);
+    xmlFree(xmlbuff);
+
+    ClearXmlProps();
+  }
+}
+
+void Widget_impl::setEnabled(bool status) {
+  self->SetVolatileXmlProp("IsEnabled", status);
+  SendXml();
+}
+
+void Widget_impl::ProcessXML(xmlNode *node) {
+  // Printf("ProcessXML %s %s\n",xmlGetProp(send_node,
+  // (xmlChar*)"name"),send_node->name);
+  xmlNode *cur_node = NULL;
+
+  for (size_t i = 0; i < childs.size(); i++) {
+    for (cur_node = node; cur_node; cur_node = cur_node->next) {
+      if (cur_node->type == XML_ELEMENT_NODE) {
+        // Printf("recherche %s\n", xmlGetProp(cur_node, (xmlChar*)"name"));
+        xmlChar *name = NULL;
+        name = xmlGetProp(cur_node, (xmlChar *)"name");
+        if (!xmlStrcmp((xmlChar *)childs[i]->ObjectName().c_str(), name)) {
+          // Printf("correspond %s\n",childs[i]->ObjectName().c_str());
+          xmlChar *new_name = NULL;
+          new_name = xmlGetProp(cur_node, (xmlChar *)"new_name");
+          if (new_name != NULL) {
+            unsigned char *ren_name =
+                new_name; // xmlGetProp(cur_node, (xmlChar*)"new_name");
+            self->Warn(
+                "%s existe deja, renommage en %s; possiblite de problemes!!\n",
+                childs[i]->ObjectName().c_str(), new_name);
+            childs[i]->Object::pimpl_->name = ((const char *)ren_name);
+            xmlSetProp(childs[i]->pimpl_->send_node, (xmlChar *)"name",
+                       xmlGetProp(cur_node, (xmlChar *)"new_name"));
+            xmlFree(new_name);
+            if (name != NULL)
+              xmlFree(name);
+            break;
+          }
+
+          if (name != NULL)
+            xmlFree(name);
+
+          // update file node
+          xmlAttr *cur_prop = NULL;
+          // xmlAttr *file_prop = NULL;
+          for (cur_prop = cur_node->properties; cur_prop;
+               cur_prop = cur_prop->next) {
+            // Printf("rcv prop %s
+            // %s\n",cur_prop->name,cur_prop->children->content);
+            xmlSetProp(childs[i]->pimpl_->file_node, cur_prop->name,
+                       cur_prop->children->content);
+          }
+
+          childs[i]->XmlEvent();
+
+          childs[i]->pimpl_->ProcessXML(cur_node->children);
+          break;
+        }
+        if (name != NULL)
+          xmlFree(name);
+      }
+    }
+  }
+
+  // printf("fin ProcessXML %s %s\n",xmlGetProp(send_node,
+  // (xmlChar*)"name"),send_node->name);
+}
+
+xmlNodePtr Widget_impl::GetNodeByProp(xmlNodePtr doc, xmlChar *type,
+                                      xmlChar *prop, xmlChar *value) {
+  // printf("cherche keyword: %s %s %s\n", type,prop,value);
+  xmlNode *cur_node = NULL;
+  for (cur_node = doc; cur_node; cur_node = cur_node->next) {
+    if (cur_node->type == XML_ELEMENT_NODE) {
+      // printf("node %s %s\n",xmlGetProp(cur_node,
+      // (xmlChar*)"name"),cur_node->name);
+      xmlChar *test = NULL;
+      test = xmlGetProp(cur_node, prop);
+      if (!xmlStrcmp(test, value) && !xmlStrcmp(cur_node->name, type)) {
+        // printf("ok\n");
+        if (test != NULL)
+          xmlFree(test);
+        return cur_node;
+      }
+      if (test != NULL)
+        xmlFree(test);
+    }
+  }
+
+  return NULL;
+}
Index: tags/latest/lib/FlairCore/src/cvimage.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/cvimage.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvimage.cpp	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/20
+//  filename:   cvimage.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an image of kind IplImage
+//
+/*********************************************************************/
+
+#include "cvimage.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+cvimage::cvimage(const Object *parent, uint16_t width, uint16_t height,
+                 Type::Format format, string name, bool allocate_data, int n)
+    : io_data(parent, name, n), dataType(width, height, format) {
+  this->allocate_data = allocate_data;
+
+  if (allocate_data) {
+    switch (format) {
+    case Type::Format::YUYV:
+    case Type::Format::UYVY:
+      img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 2);
+      break;
+    case Type::Format::BGR:
+      img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
+      break;
+    case Type::Format::Gray:
+      img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1);
+      break;
+    default:
+      Err("format no supported");
+      break;
+    }
+  } else {
+    if (n > 1)
+      Err("number of samples!=1 not possible when not allocating data\n");
+    n = 1;
+    switch (format) {
+    case Type::Format::YUYV:
+    case Type::Format::UYVY:
+      img = cvCreateImageHeader(cvSize(width, height), IPL_DEPTH_8U, 2);
+      break;
+    case Type::Format::BGR:
+      img = cvCreateImageHeader(cvSize(width, height), IPL_DEPTH_8U, 3);
+      break;
+    case Type::Format::Gray:
+      img = cvCreateImageHeader(cvSize(width, height), IPL_DEPTH_8U, 1);
+      break;
+    default:
+      Err("format no supported");
+      break;
+    }
+  }
+
+  SetPtrToCircle((void **)&img);
+
+  if (n > 1)
+    prev = new cvimage(this, width, height, format, name, n - 1);
+}
+
+cvimage::~cvimage() {
+  // printf("destructeur cvimage\n");
+
+  cvReleaseImage(&img);
+}
+
+void cvimage::CopyDatas(char *dst) const { Warn("non implementé\n"); }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/cvimage.h
===================================================================
--- tags/latest/lib/FlairCore/src/cvimage.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvimage.h	(revision 209)
@@ -0,0 +1,126 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvimage.h
+ * \brief Class defining an image of kind IplImage
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/20
+ * \version 4.0
+ */
+
+#ifndef CVIMAGE_H
+#define CVIMAGE_H
+
+#include <cxcore.h>
+#include <io_data.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+/*! \class cvimage
+*
+* \brief Class defining an image of kind IplImage
+*
+* IplImage is an image struct defined in OpenCV.
+*
+*/
+class cvimage : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    /*!
+    \enum Format_t
+    \brief Picture formats
+    */
+    enum class Format {
+      YUYV, /*!< YUYV 16 bits */
+      UYVY, /*!< UYVY 16 bits */
+      BGR,  /*!< BGR 24 bits */
+      Gray, /*!< gray 8 bits */
+    };
+    Type(uint16_t _width, uint16_t _height, Format _format)
+        : width(_width), height(_height), format(_format) {}
+
+    size_t GetSize() const {
+      size_t pixelSize;
+      switch (format) {
+      case Format::Gray:
+        pixelSize = 1;
+        break;
+      case Format::YUYV:
+      case Format::UYVY:
+        pixelSize = 2;
+        break;
+      case Format::BGR:
+        pixelSize = 3;
+        break;
+      default:
+        pixelSize = 0; // TODO should throw an exception instead
+      }
+      return pixelSize * width * height;
+    }
+    std::string GetDescription() const { return "cv image"; };
+
+    Format GetFormat() const { return format; };
+    uint16_t GetWidth() const { return width; };
+    uint16_t GetHeight() const { return height; };
+
+  private:
+    uint16_t width;
+    uint16_t height;
+    Format format;
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing an IplImage.
+  *
+  * \param parent parent
+  * \param width image width
+  * \param height image height
+  * \param name name
+  * \param allocate_data if true, IplImage image data is allocated; otherwise
+  *img->imagedata must be changed
+  * \param n number of samples
+  */
+  cvimage(const Object *parent, uint16_t width, uint16_t height,
+          Type::Format format, std::string name = "", bool allocate_data = true,
+          int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~cvimage();
+
+  /*!
+  * \brief IplImage
+  *
+  * \return IplImage
+  */
+  IplImage *img;
+
+  Type const &GetDataType() const { return dataType; };
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+
+  bool allocate_data;
+  Type dataType;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVIMAGE_H
Index: tags/latest/lib/FlairCore/src/cvmatrix.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/cvmatrix.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvmatrix.cpp	(revision 209)
@@ -0,0 +1,198 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   cvmatrix.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a matrix of kind CvMat
+//
+/*********************************************************************/
+
+#include "cvmatrix.h"
+#include "cvmatrix_impl.h"
+#include <cxcore.h>
+#include <typeinfo>
+
+#include <iostream>
+
+using std::string;
+
+namespace flair {
+namespace core {
+/*! \class cvmatrixElement
+*/
+class cvmatrixElement : public IODataElement {
+public:
+  cvmatrixElement(const cvmatrix *matrix, string name, uint32_t row,
+                  uint32_t col)
+      : IODataElement(matrix, name) {
+    this->matrix = matrix;
+    this->row = row;
+    this->col = col;
+    if (row >= matrix->Rows() || col >= matrix->Cols()) {
+      matrix->Err("index (%i,%i) out of bound (%i,%i)\n", row, col,
+                  matrix->Rows() - 1, matrix->Cols() - 1);
+      size = 0;
+    } else {
+      try {
+        ScalarType const &scalarType = dynamic_cast<ScalarType const &>(
+            matrix->GetDataType().GetElementDataType());
+        size = scalarType.GetSize();
+      } catch (std::bad_cast e) {
+        matrix->Err("type not handled\n");
+        size = 0;
+      }
+    }
+  }
+
+  ~cvmatrixElement() {}
+
+  void CopyData(char *dst) const {
+    if (typeid(matrix->GetDataType().GetElementDataType()) ==
+        typeid(FloatType)) {
+      float value = matrix->Value(row, col);
+      memcpy(dst, &value, sizeof(value));
+    } else if (typeid(matrix->GetDataType().GetElementDataType()) ==
+               typeid(SignedIntegerType)) {
+      switch (matrix->GetDataType().GetElementDataType().GetSize()) {
+      case 1: {
+        int8_t int8Value = matrix->Value(row, col);
+        memcpy(dst, &int8Value, 1);
+      } break;
+      case 2: {
+        int16_t int16Value = matrix->Value(row, col);
+        memcpy(dst, &int16Value, 2);
+      } break;
+      }
+    }
+  }
+
+  DataType const &GetDataType(void) const {
+    return matrix->GetDataType().GetElementDataType();
+  }
+
+private:
+  const cvmatrix *matrix;
+  uint32_t row, col;
+};
+
+cvmatrix::cvmatrix(const Object *parent, uint32_t rows, uint32_t cols,
+                   ScalarType const &elementDataType, string name, uint32_t n)
+    : io_data(parent, name, n), dataType(rows, cols, elementDataType) {
+  pimpl_ = new cvmatrix_impl(this, rows, cols, elementDataType, n);
+
+  for (uint32_t i = 0; i < rows; i++) {
+    for (uint32_t j = 0; j < cols; j++) {
+      AppendLogDescription(pimpl_->descriptor->ElementName(i, j),
+                           elementDataType);
+      SetValue(i, j, 0);
+    }
+  }
+}
+
+cvmatrix::cvmatrix(const Object *parent, const cvmatrix_descriptor *descriptor,
+                   ScalarType const &elementDataType, string name, uint32_t n)
+    : io_data(parent, name, n),
+      dataType(descriptor->Rows(), descriptor->Cols(), elementDataType) {
+  pimpl_ = new cvmatrix_impl(this, descriptor, elementDataType, n);
+
+  for (uint32_t i = 0; i < descriptor->Rows(); i++) {
+    for (uint32_t j = 0; j < descriptor->Cols(); j++) {
+      AppendLogDescription(descriptor->ElementName(i, j), elementDataType);
+      SetValue(i, j, 0);
+    }
+  }
+}
+
+cvmatrix::~cvmatrix() { delete pimpl_; }
+
+IODataElement *cvmatrix::Element(uint32_t row, uint32_t col) const {
+  return new cvmatrixElement(this, Name(row, col), row, col);
+}
+
+IODataElement *cvmatrix::Element(uint32_t index) const {
+  if (Rows() == 1) {
+    return new cvmatrixElement(this, Name(0, index), 0, index);
+  } else if (Cols() == 1) {
+    return new cvmatrixElement(this, Name(index, 0), index, 0);
+  } else {
+    Err("matrix is not 1D\n");
+    return nullptr;
+  }
+}
+
+float cvmatrix::Value(uint32_t row, uint32_t col) const {
+  float value;
+
+  if (row >= (uint32_t)pimpl_->mat->rows ||
+      col >= (uint32_t)pimpl_->mat->cols) {
+    Warn("index (%i,%i) out of bound (%i,%i)\n", row, col,
+         pimpl_->mat->rows - 1, pimpl_->mat->cols - 1);
+    return 0;
+  }
+
+  GetMutex();
+  value = cvGetReal2D(pimpl_->mat, row, col);
+  ReleaseMutex();
+
+  return value;
+}
+
+float cvmatrix::ValueNoMutex(uint32_t row, uint32_t col) const {
+  if (row >= (uint32_t)pimpl_->mat->rows ||
+      col >= (uint32_t)pimpl_->mat->cols) {
+    Warn("index (%i,%i) out of bound (%i,%i)\n", row, col,
+         pimpl_->mat->rows - 1, pimpl_->mat->cols - 1);
+    return 0;
+  }
+
+  return cvGetReal2D(pimpl_->mat, row, col);
+}
+
+void cvmatrix::SetValue(uint32_t row, uint32_t col, float value) {
+  if (row >= (uint32_t)pimpl_->mat->rows ||
+      col >= (uint32_t)pimpl_->mat->cols) {
+    Warn("index (%i,%i) out of bound (%i,%i)\n", row, col,
+         pimpl_->mat->rows - 1, pimpl_->mat->cols - 1);
+  } else {
+    GetMutex();
+    cvSetReal2D(pimpl_->mat, row, col, value);
+    ReleaseMutex();
+  }
+}
+
+void cvmatrix::SetValueNoMutex(uint32_t row, uint32_t col, float value) {
+  if (row >= (uint32_t)pimpl_->mat->rows ||
+      col >= (uint32_t)pimpl_->mat->cols) {
+    Warn("index (%i,%i) out of bound (%i,%i)\n", row, col,
+         pimpl_->mat->rows - 1, pimpl_->mat->cols - 1);
+  } else {
+    cvSetReal2D(pimpl_->mat, row, col, value);
+  }
+}
+
+CvMat *cvmatrix::getCvMat(void) const { return pimpl_->mat; }
+
+void cvmatrix::CopyDatas(char *dst) const {
+  GetMutex();
+  // printf("%f %x %i\n",cvGetReal2D(pimpl_->mat,0,0),dst,Size());
+  memcpy(dst, pimpl_->mat->data.ptr, dataType.GetSize());
+  ReleaseMutex();
+}
+
+uint32_t cvmatrix::Rows(void) const { return pimpl_->mat->rows; }
+
+uint32_t cvmatrix::Cols(void) const { return pimpl_->mat->cols; }
+
+string cvmatrix::Name(uint32_t row, uint32_t col) const {
+  return pimpl_->descriptor->ElementName(row, col);
+}
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/cvmatrix.h
===================================================================
--- tags/latest/lib/FlairCore/src/cvmatrix.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvmatrix.h	(revision 209)
@@ -0,0 +1,224 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix.h
+ * \brief Class defining a matrix of kind CvMat
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_H
+#define CVMATRIX_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <cvmatrix_descriptor.h>
+
+class cvmatrix_impl;
+struct CvMat;
+
+namespace flair {
+namespace core {
+
+/*! \class cvmatrix
+*
+* \brief Class defining a matrix of kind CvMat
+*
+* CvMat is a matrix struct defined in OpenCV.
+*
+*/
+class cvmatrix : public io_data {
+public:
+  class Type : public DataType {
+  public:
+    Type(size_t _nbRows, size_t _nbCols, ScalarType const &_elementDataType)
+        : nbRows(_nbRows), nbCols(_nbCols), elementDataType(_elementDataType) {}
+    size_t GetSize() const {
+      return nbRows * nbCols * elementDataType.GetSize();
+    }
+    std::string GetDescription() const { return "matrix"; }
+    size_t GetNbRows() const { return nbRows; }
+    size_t GetNbCols() const { return nbCols; }
+    ScalarType const &GetElementDataType() const { return elementDataType; }
+
+  private:
+    size_t nbRows, nbCols;
+    ScalarType const &elementDataType;
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing a CvMat. \n
+  * It uses a cvmatrix_descriptor to get size and elements' names. \n
+  * Names are used for graphs and logs. \n
+  * All values are initialized to 0.
+  *
+  * \param parent parent
+  * \param descriptor matrix description, it is safe to destroy it after calling this constructor
+  * \param type type of matrix elements
+  * \param name name
+  * \param n number of samples
+  */
+  cvmatrix(const Object *parent, const cvmatrix_descriptor *descriptor,
+           ScalarType const &elementDataType, std::string name = "",
+           uint32_t n = 1);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing a CvMat. \n
+  * Elements are unamed. \n
+  * All values are initialized to 0.
+  *
+  * \param parent parent
+  * \param rows matrix rows
+  * \param cols matrix cols
+  * \param type type of matrix elements
+  * \param name name
+  * \param n number of samples
+  */
+  cvmatrix(const Object *parent, uint32_t rows, uint32_t cols,
+           ScalarType const &elementDataType, std::string name = "",
+           uint32_t n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~cvmatrix();
+
+  /*!
+  * \brief Element value
+  *
+  * Element is accessed by locking and unlocking the io_data Mutex.
+  *
+  * \param row element row
+  * \param col element col
+  *
+  * \return element value
+  */
+  float Value(uint32_t row, uint32_t col) const;
+
+  /*!
+  * \brief Element value
+  *
+  * Element is not accessed by locking and unlocking the io_data Mutex. \n
+  * Thus, this function should be called with Mutex locked. \n
+  * This function is usefull when multiple successive access are done to the
+  * elments of the matrix. It avoids unnecessary locking and unlocking.
+  *
+  * \param row element row
+  * \param col element col
+  *
+  * \return element value
+  */
+  float ValueNoMutex(uint32_t row, uint32_t col) const;
+
+  /*!
+  * \brief Set element value
+  *
+  * Element is accessed by locking and unlocking the io_data Mutex.
+  *
+  * \param row element row
+  * \param col element col
+  * \param value element value
+  */
+  void SetValue(uint32_t row, uint32_t col, float value);
+
+  /*!
+  * \brief Set element value
+  *
+  * Element is not accessed by locking and unlocking the io_data Mutex. \n
+  * Thus, this function should be called with Mutex locked. \n
+  * This function is usefull when multiple successive access are done to the
+  * elments of the matrix. It avoids unnecessary locking and unlocking.
+  *
+  * \param row element row
+  * \param col element col
+  * \param value element value
+  */
+  void SetValueNoMutex(uint32_t row, uint32_t col, float value);
+
+  /*!
+  * \brief get CvMat
+  *
+  * The io_data Mutex must be used by the user.
+  */
+  CvMat *getCvMat(void) const;
+
+  /*!
+  * \brief Element name
+  *
+  * If cvmatrix was created without cvmatrix_descriptor, element name is empty.
+  *
+  * \param row element row
+  * \param col element col
+  *
+  * \return element name
+  */
+  std::string Name(uint32_t row, uint32_t col) const;
+
+  /*!
+  * \brief Element
+  *
+  * Get a pointer to a specific element. This pointer can be used for plotting.
+  *
+  * \param row element row
+  * \param col element col
+  *
+  * \return pointer to the element
+  */
+  IODataElement *Element(uint32_t row, uint32_t col) const;
+
+  /*!
+  * \brief Element
+  *
+  * Get a pointer to a specific element. This pointer can be used for plotting.
+  *\n
+  * This function can be used for a 1D matrix.
+  *
+  * \param index element index
+  *
+  * \return pointer to the element
+  */
+  IODataElement *Element(uint32_t index) const;
+
+  /*!
+  * \brief Number of rows
+  *
+  * \return rows
+  */
+  uint32_t Rows(void) const;
+
+  /*!
+  * \brief Number of colomns
+  *
+  * \return colomns
+  */
+  uint32_t Cols(void) const;
+
+  Type const &GetDataType() const { return dataType; };
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::CopyDatas.
+  *
+  * \param dst destination buffer
+  */
+  void CopyDatas(char *dst) const;
+
+  class cvmatrix_impl *pimpl_;
+  Type dataType;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVMATRIX_H
Index: tags/latest/lib/FlairCore/src/cvmatrix_descriptor.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/cvmatrix_descriptor.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvmatrix_descriptor.cpp	(revision 209)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/05
+//  filename:   cvmatrix_descriptor.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class describing cvmatrix elements, for log and graphs purpose
+//
+/*********************************************************************/
+
+#include "cvmatrix_descriptor.h"
+#include "FrameworkManager.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+cvmatrix_descriptor::cvmatrix_descriptor(uint32_t rows, uint32_t cols) {
+  this->rows = rows;
+  this->cols = cols;
+
+  if (rows == 0 || cols == 0)
+    getFrameworkManager()->Err("rows and cols must be >0\n");
+
+  element_names = (string **)malloc(rows * cols * sizeof(string *));
+  for (uint32_t i = 0; i < rows * cols; i++) {
+    element_names[i] = new string();
+  }
+}
+
+cvmatrix_descriptor::~cvmatrix_descriptor() {
+  for (uint32_t i = 0; i < rows * cols; i++) {
+    delete element_names[i];
+  }
+  free(element_names);
+}
+
+void cvmatrix_descriptor::SetElementName(uint32_t row, uint32_t col,
+                                         string name) {
+  if (row >= rows || col >= cols) {
+    getFrameworkManager()->Err("index out of bound %s (%i,%i), range (%i,%i)\n",
+                               name.c_str(), row, col, rows - 1, cols - 1);
+    return;
+  }
+  *element_names[row * cols + col] = name;
+}
+
+string cvmatrix_descriptor::ElementName(uint32_t row, uint32_t col) const {
+  if (row >= rows || col >= cols) {
+    getFrameworkManager()->Err("index out of bound (%i,%i), range (%i,%i)\n",
+                               row, col, rows - 1, cols - 1);
+    return *element_names[0]; // safe value...
+  }
+  return *element_names[row * cols + col];
+}
+
+uint32_t cvmatrix_descriptor::Rows() const { return rows; }
+
+uint32_t cvmatrix_descriptor::Cols() const { return cols; }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/cvmatrix_descriptor.h
===================================================================
--- tags/latest/lib/FlairCore/src/cvmatrix_descriptor.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvmatrix_descriptor.h	(revision 209)
@@ -0,0 +1,87 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix_descriptor.h
+ * \brief Class describing cvmatrix elements, for log and graphs purpose
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/05
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_DESCRIPTOR_H
+#define CVMATRIX_DESCRIPTOR_H
+
+#include <string>
+
+namespace flair {
+namespace core {
+
+/*! \class cvmatrix_descriptor
+*
+* \brief Class describing cvmatrix elements, for log and graphs purpose
+*
+* This class allows to give a name to matrix elements. These names
+* will be used in graphs and logs.
+*/
+class cvmatrix_descriptor {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a matrix descriptor.
+  *
+  * \param rows matrix rows
+  * \param cols matrix cols
+  */
+  cvmatrix_descriptor(uint32_t rows, uint32_t cols);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~cvmatrix_descriptor();
+
+  /*!
+  * \brief Set element name
+  *
+  * \param row element row
+  * \param col element col
+  * \param name element name
+  */
+  void SetElementName(uint32_t row, uint32_t col, std::string name);
+
+  /*!
+  * \brief Element name
+  *
+  * \param row element row
+  * \param col element col
+  *
+  * \return element name
+  */
+  std::string ElementName(uint32_t row, uint32_t col) const;
+
+  /*!
+  * \brief Number of rows
+  *
+  * \return rows
+  */
+  uint32_t Rows(void) const;
+
+  /*!
+  * \brief Number of colomns
+  *
+  * \return colomns
+  */
+  uint32_t Cols(void) const;
+
+private:
+  uint32_t rows, cols;
+  std::string **element_names;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVMATRIX_DESCRIPTOR_H
Index: tags/latest/lib/FlairCore/src/cvmatrix_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/cvmatrix_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/cvmatrix_impl.cpp	(revision 209)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   cvmatrix_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant le type de données "CvMat"
+//
+/*********************************************************************/
+
+#include "cvmatrix.h"
+#include "cvmatrix_impl.h"
+#include <cxcore.h>
+#include <typeinfo>
+#include <sstream>
+
+using std::string;
+using namespace flair::core;
+
+cvmatrix_impl::cvmatrix_impl(cvmatrix *self, int rows, int cols,
+                             flair::core::ScalarType const &_elementDataType,
+                             int n)
+    : elementDataType(_elementDataType) {
+  descriptor = new cvmatrix_descriptor(rows, cols);
+  Init(self, n);
+}
+
+cvmatrix_impl::cvmatrix_impl(cvmatrix *self,
+                             const cvmatrix_descriptor *inDescriptor,
+                             flair::core::ScalarType const &_elementDataType,
+                             int n)
+    : elementDataType(_elementDataType) {
+  descriptor = new cvmatrix_descriptor(inDescriptor->Rows(), inDescriptor->Cols());
+
+  for (uint32_t i = 0; i < descriptor->Rows(); i++) {
+    for (uint32_t j = 0; j < descriptor->Cols(); j++) {
+      descriptor->SetElementName(i, j, inDescriptor->ElementName(i, j));
+    }
+  }
+  Init(self, n);
+}
+
+void cvmatrix_impl::Init(cvmatrix *self, int n) {
+  this->self = self;
+
+  mat = nullptr;
+  try {
+    ScalarType const &scalarType =
+        dynamic_cast<ScalarType const &>(elementDataType);
+    if (typeid(scalarType) == typeid(FloatType)) {
+      mat = cvCreateMat(descriptor->Rows(), descriptor->Cols(), CV_32FC1);
+    } else if (typeid(scalarType) == typeid(SignedIntegerType)) {
+      switch (elementDataType.GetSize()) {
+      case 1:
+        mat = cvCreateMat(descriptor->Rows(), descriptor->Cols(), CV_8SC1);
+        break;
+      case 2:
+        mat = cvCreateMat(descriptor->Rows(), descriptor->Cols(), CV_16SC1);
+        break;
+      default:
+        self->Err("unsupported integer scalar type\n");
+      }
+    } else {
+      self->Err("unsupported scalar type\n");
+    }
+  } catch (std::bad_cast e) {
+    self->Err("type is not a scalar\n");
+  }
+
+  if (mat == nullptr)
+    self->Err("allocating matrix failed\n");
+  if (n > 1)
+    self->Warn("n>1 not supported\n");
+}
+
+cvmatrix_impl::~cvmatrix_impl() {
+  cvReleaseMat(&mat);
+  delete descriptor;
+}
Index: tags/latest/lib/FlairCore/src/groups.dox
===================================================================
--- tags/latest/lib/FlairCore/src/groups.dox	(revision 209)
+++ tags/latest/lib/FlairCore/src/groups.dox	(revision 209)
@@ -0,0 +1,14 @@
+/*! \namespace flair
+ * 
+ * \brief namespace of the flair Framework
+ */
+
+/*! \namespace flair::core
+ * 
+ * \brief Core classes
+ */
+
+/*! \namespace flair::gui
+ * 
+ * \brief Graphical user interface classes
+ */
Index: tags/latest/lib/FlairCore/src/io_data.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/io_data.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/io_data.cpp	(revision 209)
@@ -0,0 +1,70 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   io_data.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for data types
+//
+//
+/*********************************************************************/
+
+#include "io_data.h"
+#include "io_data_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+DummyType dummyType;
+FloatType floatType;
+DoubleType doubleType;
+SignedIntegerType Int8Type(8);
+SignedIntegerType Int16Type(16);
+UnsignedIntegerType UInt8Type(8);
+UnsignedIntegerType UInt16Type(16);
+
+io_data::io_data(const Object *parent, string name, int n)
+    : Mutex(parent, name) {
+  pimpl_ = new io_data_impl(this, n);
+}
+
+io_data::~io_data() { delete pimpl_; }
+
+void io_data::AppendLogDescription(string description,
+                                   DataType const &datatype) {
+  pimpl_->AppendLogDescription(description, datatype);
+}
+
+void io_data::SetDataTime(Time time) {
+  GetMutex();
+  pimpl_->time = time;
+  ReleaseMutex();
+}
+
+Time io_data::DataTime(void) const {
+  Time tmp;
+  GetMutex();
+  tmp = pimpl_->time;
+  ReleaseMutex();
+  return tmp;
+}
+
+const io_data *io_data::Prev(int n) const {
+  if (n > 0)
+    return prev->Prev(n - 1);
+  else
+    return this;
+}
+
+void io_data::SetPtrToCircle(void **ptr) { pimpl_->circle_ptr = ptr; }
+
+} // end namespace core
+} // end namespace flair
Index: tags/latest/lib/FlairCore/src/io_data.h
===================================================================
--- tags/latest/lib/FlairCore/src/io_data.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/io_data.h	(revision 209)
@@ -0,0 +1,195 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file io_data.h
+ * \brief Abstract class for data types.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef IO_DATA_H
+#define IO_DATA_H
+
+#include <Mutex.h>
+
+class IODevice_impl;
+class io_data_impl;
+
+namespace flair {
+namespace core {
+
+class Object;
+
+class DataType {
+public:
+  virtual std::string GetDescription() const = 0;
+  // size in bytes
+  virtual size_t GetSize() const = 0;
+};
+
+class DummyType : public DataType {
+public:
+  size_t GetSize() const { return 0; }
+  std::string GetDescription() const { return "dummy"; };
+};
+extern DummyType dummyType;
+
+class ScalarType : public DataType {
+public:
+  ScalarType(size_t _size) : size(_size) {}
+  size_t GetSize() const { return size; }
+  virtual std::string GetDescription() const { return "scalar"; };
+
+private:
+  size_t size;
+};
+
+class SignedIntegerType : public ScalarType {
+public:
+  SignedIntegerType(size_t sizeInBits) : ScalarType(sizeInBits / 8) {}
+  std::string GetDescription() const {
+    return "int" + std::to_string(GetSize() * 8) + "_t";
+  };
+};
+extern SignedIntegerType Int8Type;
+extern SignedIntegerType Int16Type;
+
+class UnsignedIntegerType : public ScalarType {
+public:
+  UnsignedIntegerType(size_t sizeInBits) : ScalarType(sizeInBits / 8) {}
+  std::string GetDescription() const {
+    return "uint" + std::to_string(GetSize() * 8) + "_t";
+  };
+};
+extern UnsignedIntegerType UInt8Type;
+extern UnsignedIntegerType UInt16Type;
+
+class FloatType : public ScalarType {
+public:
+  FloatType() : ScalarType(4) {}
+  std::string GetDescription() const { return "float"; };
+};
+extern FloatType floatType;
+
+class DoubleType : public ScalarType {
+public:
+  DoubleType() : ScalarType(8) {}
+  std::string GetDescription() const { return "double"; };
+};
+extern DoubleType doubleType;
+
+/*! \class io_data
+*
+* \brief Abstract class for data types.
+*
+* Use this class to define a custom data type. Data types ares used for logging
+*and graphs. \n
+* The reimplemented class must call SetSize() in its constructor. \n
+* io_data can be constructed with n samples (see io_data::io_data).
+* In this case, old samples can be accessed throug io_data::Prev.
+*/
+class io_data : public Mutex {
+  friend class IODevice;
+  friend class ::IODevice_impl;
+  friend class ::io_data_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data. \n
+  *
+  * \param parent parent
+  * \param name name
+  * \param n number of samples
+  */
+  io_data(const Object *parent, std::string name, int n);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  virtual ~io_data();
+
+  /*!
+  * \brief Set data time
+  *
+  * \param time time
+  */
+  void SetDataTime(Time time);
+
+  /*!
+  * \brief Data time
+  *
+  * \return data time
+  */
+  Time DataTime(void) const;
+
+  /*!
+  * \brief Previous data
+  *
+  * Access previous data. io_data must have been constructed with
+  * n>1, io_data::SetPtrToCircle must have been set and
+  * io_data::prev must have been allocated.
+  *
+  * \param n previous data number
+  *
+  * \return previous data
+  */
+  const io_data *Prev(int n) const;
+
+  virtual DataType const &GetDataType() const = 0;
+
+protected:
+  /*!
+  * \brief Specify the description of the reimplemented class data's
+  *
+  *  This method must be called in the constructor of the reimplemented class,
+  *once by element. \n
+  *  Each element description must be called in the same order as CopyDatas put
+  *the datas in the buffer. \n
+  *  The description will be used for the log descriptor file.
+  *
+  * \param description description of the element
+  * \param datatype type of the element
+  */
+  void AppendLogDescription(std::string description, DataType const &datatype);
+
+  /*!
+  * \brief Set the datas to circle
+  *
+  * \param ptr pointer to the data to circle
+  */
+  void SetPtrToCircle(void **ptr);
+
+  /*!
+  * \brief Pointer to previous data
+  *
+  * Reimplemented class must allocate this pointer if n>1. \n
+  * Pointer must be allocated with the same kind of reimplemented class.
+  */
+  io_data *prev;
+
+private:
+  /*!
+  * \brief Copy datas
+  *
+  * This method is automatically called by IODevice::ProcessUpdate to log
+  *io_data datas. \n
+  * This method must be reimplemented, in order to copy the datas to the logs.
+  * Copied datas must be of size io_data::Size.
+  *
+  * \param dst destination buffer
+  */
+  virtual void CopyDatas(char *dst) const = 0;
+
+  io_data_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IO_DATA_H
Index: tags/latest/lib/FlairCore/src/io_data_impl.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/io_data_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/io_data_impl.cpp	(revision 209)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   io_data_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe définissant une donnée générique
+//
+//
+/*********************************************************************/
+
+#include "io_data.h"
+#include "io_data_impl.h"
+#include <fstream>
+
+using std::string;
+using namespace flair::core;
+
+io_data_impl::io_data_impl(io_data *self, int n) {
+  this->self = self;
+  this->n = n;
+  if (n < 1)
+    self->Err("n doit être >0\n");
+  size = 0;
+  is_consistent = false;
+  circle_ptr = NULL;
+}
+
+io_data_impl::~io_data_impl() {}
+
+void io_data_impl::AppendLogDescription(string description,
+                                        DataType const &datatype) {
+  description += " (" + datatype.GetDescription() + ")";
+  descriptors.push_back(description);
+}
+
+void io_data_impl::WriteLogDescriptor(std::fstream &desc_file, int *index) {
+	if(descriptors.size()==0) self->Warn("AppendLogDescription was not called for this object.\n");
+  for (size_t i = 0; i < descriptors.size(); i++) {
+    desc_file << (*index)++ << ": " << self->ObjectName() << " - "
+              << descriptors.at(i) << "\n";
+  }
+}
+
+void io_data_impl::PrintLogDescriptor(void) {
+  for (size_t i = 0; i < descriptors.size(); i++) {
+    Printf("    %s\n", descriptors.at(i).c_str());
+  }
+}
+
+void io_data_impl::Circle(void) {
+  if (n > 1) {
+    self->GetMutex();
+
+    void *tmp = *self->Prev(n - 1)->pimpl_->circle_ptr;
+
+    for (int i = 0; i < n - 1; i++) {
+      // printf("%i\n",i);
+      *(self->Prev(n - 1 - i)->pimpl_->circle_ptr) =
+          *(self->Prev(n - 2 - i)->pimpl_->circle_ptr);
+      self->Prev(n - 1 - i)->pimpl_->is_consistent =
+          self->Prev(n - 2 - i)->pimpl_->is_consistent;
+      self->Prev(n - 1 - i)->pimpl_->time = self->Prev(n - 2 - i)->pimpl_->time;
+    }
+    *circle_ptr = tmp;
+    is_consistent = false;
+    self->ReleaseMutex();
+  }
+}
+
+bool io_data_impl::IsConsistent(void) { return is_consistent; }
+
+void io_data_impl::SetConsistent(bool status) { is_consistent = status; }
Index: tags/latest/lib/FlairCore/src/ui_com.cpp
===================================================================
--- tags/latest/lib/FlairCore/src/ui_com.cpp	(revision 209)
+++ tags/latest/lib/FlairCore/src/ui_com.cpp	(revision 209)
@@ -0,0 +1,578 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   ui_com.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe permettant la lecture et l'ecriture sur socket UDT
+//
+//
+/*********************************************************************/
+
+#include "ui_com.h"
+#include <cstdlib>
+#include <string.h>
+#include <unistd.h>
+#include "Mutex.h"
+#include "SendData.h"
+#include "communication.h"
+#include "FrameworkManager.h"
+#include "zlib.h"
+#include <assert.h>
+#include "config.h"
+
+#ifdef __XENO__
+#include <pthread.h>
+#include <native/task.h>
+#include <native/task.h>
+#include <fcntl.h>
+#endif
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+ui_com::ui_com(const Object *parent, UDTSOCKET sock)
+    : Thread(parent, "send", 2) {
+  // buffer envoi
+  send_buffer = (char *)malloc(3);
+  send_size = 3; // id(1)+period(2)
+
+  // mutex
+  send_mutex = NULL;
+  send_mutex = new Mutex(this, ObjectName());
+
+  socket_fd = sock;
+  connection_lost = false;
+
+#ifdef __XENO__
+  int status;
+  string tmp_name;
+
+  is_running = true;
+
+  // pipe
+  tmp_name = getFrameworkManager()->ObjectName() + "-" + ObjectName() + "-pipe";
+  // xenomai limitation
+  if (tmp_name.size() > 31)
+    Err("rt_pipe_create error (%s is too long)\n", tmp_name.c_str());
+#ifdef RT_PIPE_SIZE
+  status = rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO, RT_PIPE_SIZE);
+#else
+  status = rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO, 0);
+#endif
+
+  if (status != 0) {
+		char errorMsg[256];
+    Err("rt_pipe_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+    // return -1;
+  }
+
+// start user side thread
+#ifdef NRT_STACK_SIZE
+  // Initialize thread creation attributes
+  pthread_attr_t attr;
+  if (pthread_attr_init(&attr) != 0) {
+    Err("pthread_attr_init error\n");
+  }
+
+  if (pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0) {
+    Err("pthread_attr_setstacksize error\n");
+  }
+
+  if (pthread_create(&thread, &attr, user_thread, (void *)this) < 0)
+#else  // NRT_STACK_SIZE
+  if (pthread_create(&thread, NULL, user_thread, (void *)this) < 0)
+#endif // NRT_STACK_SIZE
+  {
+    Err("pthread_create error\n");
+    // return -1;
+  }
+#ifdef NRT_STACK_SIZE
+  if (pthread_attr_destroy(&attr) != 0) {
+    Err("pthread_attr_destroy error\n");
+  }
+#endif
+
+#endif //__XENO__
+  int timeout = 100;
+  if (UDT::setsockopt(socket_fd, 0, UDT_RCVTIMEO, &timeout, sizeof(int)) != 0)
+    Err("UDT::setsockopt error (UDT_RCVTIMEO)\n");
+
+  bool blocking = true;
+  if (UDT::setsockopt(socket_fd, 0, UDT_SNDSYN, &blocking, sizeof(bool)) != 0)
+    Err("UDT::setsockopt error (UDT_SNDSYN)\n");
+
+  if (UDT::setsockopt(socket_fd, 0, UDT_RCVSYN, &blocking, sizeof(bool)) != 0)
+    Err("UDT::setsockopt error (UDT_RCVSYN)\n");
+  //#endif //__XENO__
+
+  Start();
+}
+
+ui_com::~ui_com() {
+// printf("destruction ui_com\n");
+
+#ifdef __XENO__
+  is_running = false;
+
+  pthread_join(thread, NULL);
+
+  int status = rt_pipe_delete(&pipe);
+  if (status != 0) {
+		char errorMsg[256];
+    Err("rt_pipe_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
+	}
+#endif
+
+  SafeStop();
+
+  if (IsSuspended() == true)
+    Resume();
+
+  Join();
+
+  if (send_buffer != NULL)
+    free(send_buffer);
+  send_buffer = NULL;
+
+  // printf("destruction ui_com ok\n");
+}
+
+void ui_com::Send(char *buf, ssize_t size) {
+  if (connection_lost == true)
+    return;
+
+  char *tosend = buf;
+  ssize_t nb_write;
+
+  if (buf[0] == XML_HEADER) {
+    // cut xml header
+    tosend = strstr(buf, "<root");
+    size -= tosend - buf;
+  }
+
+#ifdef __XENO__
+  nb_write = rt_pipe_write(&pipe, tosend, size, P_NORMAL);
+
+  if (nb_write < 0) {
+		char errorMsg[256];
+    Err("rt_pipe_write error (%s)\n", strerror_r(-nb_write, errorMsg, sizeof(errorMsg)));
+  } else if (nb_write != size) {
+    Err("rt_pipe_write error %i/%i\n", nb_write, size);
+  }
+#else //__XENO__
+
+#ifdef COMPRESS_FRAMES
+  bool sendItCompressed = false;
+  if (buf[0] == XML_HEADER) {
+    sendItCompressed = true;
+  }
+
+  if (sendItCompressed) {
+    char *out;
+    ssize_t out_size;
+    if (compressBuffer(tosend, size, &out, &out_size, 9) == Z_OK) {
+      size = out_size;
+      nb_write = UDT::sendmsg(socket_fd, out, size, -1, true);
+      free(out);
+    } else {
+      Warn("Compress error, sending it uncompressed\n");
+      sendItCompressed = false;
+    }
+  }
+
+  if (!sendItCompressed) {
+    nb_write = UDT::sendmsg(socket_fd, tosend, size, -1, true);
+  }
+
+#else // COMPRESS_FRAMES
+  nb_write = UDT::sendmsg(socket_fd, tosend, size, -1, true);
+#endif // COMPRESS_FRAMES
+  // Printf("write %i %i\n",nb_write,size);
+  if (nb_write < 0) {
+    Err("UDT::sendmsg error (%s)\n", UDT::getlasterror().getErrorMessage());
+    if (UDT::getlasterror().getErrorCode() == CUDTException::ECONNLOST ||
+        UDT::getlasterror().getErrorCode() == CUDTException::EINVSOCK) {
+      connection_lost = true;
+    }
+  } else if (nb_write != size) {
+    Err("%s, code %i (%ld/%ld)\n", UDT::getlasterror().getErrorMessage(),
+        UDT::getlasterror().getErrorCode(), nb_write, size);
+  }
+#endif //__XENO__
+}
+
+ssize_t ui_com::Receive(char *buf, ssize_t buf_size) {
+  ssize_t bytesRead = UDT::recvmsg(socket_fd, buf, buf_size);
+
+  if (bytesRead < 0) {
+    if (UDT::getlasterror().getErrorCode() == CUDTException::ECONNLOST) {
+      Err("UDT::recvmsg error (%s)\n", UDT::getlasterror().getErrorMessage());
+      connection_lost = true;
+    }
+  }
+
+  return bytesRead;
+}
+
+void ui_com::Run(void) {
+  // check endianness
+  char header;
+  if (IsBigEndian()) {
+    header = DATAS_BIG_ENDIAN;
+    Printf("System is big endian\n");
+  } else {
+    header = DATAS_LITTLE_ENDIAN;
+    Printf("System is little endian\n");
+  }
+
+#ifdef __XENO__
+  WarnUponSwitches(true);
+  printf("\n"); // a revoir pourquoi??
+// sans ce printf, dans le simu_roll, le suspend ne fonctionne pas...
+#endif
+  // on attend d'avoir des choses à faire
+  Suspend();
+
+  while (!ToBeStopped()) {
+    size_t resume_id;
+    Time min = 0xffffffffffffffffULL;
+
+    // on recpuere l'id de la prochaine execution
+    send_mutex->GetMutex();
+    resume_id = resume_time.size();
+    for (size_t i = 0; i < resume_time.size(); i++) {
+      if (resume_time.at(i) < min && data_to_send.at(i)->IsEnabled() == true) {
+        min = resume_time.at(i);
+        resume_id = i;
+      }
+    }
+
+    // attente
+    if (resume_id < resume_time.size()) {
+      Time time = resume_time.at(resume_id);
+      uint16_t resume_period = data_to_send.at(resume_id)->SendPeriod();
+      send_mutex->ReleaseMutex();
+      // on dort jusqu'a la prochaine execution
+      SleepUntil(time);
+
+      // envoi des donnees
+      int offset = 3;
+      send_buffer[0] = header;
+      send_mutex->GetMutex();
+
+      for (size_t i = 0; i < data_to_send.size(); i++) {
+        if (data_to_send.at(i)->SendPeriod() == resume_period &&
+            data_to_send.at(i)->IsEnabled() == true) {
+          data_to_send.at(i)->CopyDatas(send_buffer + offset);
+          offset += data_to_send.at(i)->SendSize();
+        }
+      }
+      if (offset != 3) {
+        memcpy(&send_buffer[1], &resume_period, sizeof(uint16_t));
+        // printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
+        // for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]);
+        // printf("\n");
+        Send(send_buffer, offset);
+      }
+
+      // on planifie la prochaine execution
+      for (size_t i = 0; i < data_to_send.size(); i++) {
+        if (data_to_send.at(i)->SendPeriod() == resume_period) {
+          resume_time.at(i) += data_to_send.at(i)->SendPeriod() * 1000000;
+        }
+      }
+      send_mutex->ReleaseMutex();
+      //Printf("%i %lld\n",resume_period,GetTime()/1000000);
+    } else {
+      send_mutex->ReleaseMutex();
+      // rien a faire, suspend
+      //Printf("rien a faire suspend\n");
+      Suspend();
+      //Printf("wake\n");
+      // on planifie la prochaine execution
+      Time time = GetTime();
+      send_mutex->GetMutex();
+      for (size_t i = 0; i < data_to_send.size(); i++) {
+        resume_time.at(i) =
+            time + (Time)data_to_send.at(i)->SendPeriod() * 1000000;
+      }
+      send_mutex->ReleaseMutex();
+    }
+  }
+}
+#ifdef __XENO__
+void *ui_com::user_thread(void *arg) {
+  int pipe_fd = -1;
+  string devname;
+  char *buf = NULL;
+  ui_com *caller = (ui_com *)arg;
+  int rv;
+  fd_set set;
+  struct timeval timeout;
+  ssize_t nb_read, nb_write;
+
+  buf = (char *)malloc(NRT_PIPE_SIZE);
+  if (buf == NULL) {
+    caller->Err("malloc error\n");
+  }
+
+  devname = NRT_PIPE_PATH + getFrameworkManager()->ObjectName() + "-" +
+            caller->ObjectName() + "-pipe";
+  while (pipe_fd < 0) {
+    pipe_fd = open(devname.c_str(), O_RDWR);
+    if (pipe_fd < 0 && errno != ENOENT) {
+			char errorMsg[256];
+      caller->Err("open pipe_fd error (%s)\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
+		}
+    usleep(1000);
+  }
+
+  while (1) {
+    FD_ZERO(&set);         // clear the set
+    FD_SET(pipe_fd, &set); // add our file descriptor to the set
+
+    timeout.tv_sec = 0;
+    timeout.tv_usec = SELECT_TIMEOUT_MS * 1000;
+
+    rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+    if (rv == -1) {
+      if (caller->is_running == false &&
+          UDT::getlasterror().getErrorCode() == CUDTException::ETIMEOUT)
+        break; // timeout
+      if (UDT::getlasterror().getErrorCode() != CUDTException::ETIMEOUT)
+        caller->Err("epoll_wait, %s, code %i\n",
+                    UDT::getlasterror().getErrorMessage(),
+                    UDT::getlasterror().getErrorCode());
+    } else if (rv == 0) {
+      // printf("timeout\n"); // a timeout occured
+      if (caller->is_running == false)
+        break;
+
+    } else {
+      nb_read = read(pipe_fd, buf, NRT_PIPE_SIZE);
+      buf[nb_read] = 0;
+// printf("envoi\n%s\n",buf);
+
+#ifdef COMPRESS_FRAMES
+      char *out;
+      ssize_t out_size;
+
+      if (buf[0] == XML_HEADER) {
+        if (compressBuffer(buf, nb_read, &out, &out_size, 9) == Z_OK) {
+          nb_read = out_size;
+          nb_write = UDT::sendmsg(caller->socket_fd, out, out_size, -1, true);
+          free(out);
+        } else {
+          caller->Warn("Compress error, sending it uncompressed\n");
+          nb_write = UDT::sendmsg(caller->socket_fd, buf, nb_read, -1, true);
+        }
+      } else {
+        nb_write = UDT::sendmsg(caller->socket_fd, buf, nb_read, -1, true);
+      }
+#else
+      nb_write = UDT::sendmsg(caller->socket_fd, buf, nb_read, -1, true);
+#endif
+
+      if (nb_write < 0) {
+        caller->Err("UDT::sendmsg error (%s)\n",
+                    UDT::getlasterror().getErrorMessage());
+        if (UDT::getlasterror().getErrorCode() == CUDTException::ECONNLOST ||
+            UDT::getlasterror().getErrorCode() == CUDTException::EINVSOCK) {
+          caller->connection_lost = true;
+        }
+      } else if (nb_write != nb_read) {
+        caller->Err("UDT::sendmsg error %i/%i\n", nb_write, nb_read);
+      }
+    }
+  }
+
+  close(pipe_fd);
+  if (buf != NULL)
+    free(buf);
+  pthread_exit(0);
+}
+#endif
+
+int ui_com::compressBuffer(char *in, ssize_t in_size, char **out,
+                           ssize_t *out_size, int level) {
+  int ret, flush;
+  unsigned have;
+  z_stream strm;
+
+  /* allocate deflate state */
+  strm.zalloc = Z_NULL;
+  strm.zfree = Z_NULL;
+  strm.opaque = Z_NULL;
+  ret = deflateInit(&strm, level);
+  if (ret != Z_OK)
+    return ret;
+
+  *out = (char *)malloc(COMPRESS_CHUNK);
+  if (!(*out))
+    return Z_BUF_ERROR;
+
+  strm.next_in = (unsigned char *)in;
+  strm.avail_out = COMPRESS_CHUNK;
+  strm.next_out = (unsigned char *)*out;
+  strm.avail_in = in_size;
+  flush = Z_FINISH;
+
+  ret = deflate(&strm, flush); /* no bad return value */
+  if (ret == Z_STREAM_ERROR) {
+    free(*out);
+    return ret;
+  }
+
+  have = COMPRESS_CHUNK - strm.avail_out;
+  *out_size = have;
+  // printf("%i -> %i\n",in_size,have);
+  /* clean up and return */
+  (void)deflateEnd(&strm);
+
+  if (strm.avail_out != 0) {
+    return Z_OK;
+  } else {
+    return Z_STREAM_ERROR;
+  }
+}
+
+int ui_com::uncompressBuffer(unsigned char *in, ssize_t in_size,
+                             unsigned char **out, ssize_t *out_size) {
+  int ret;
+  // unsigned have;
+  z_stream strm;
+
+  /* allocate inflate state */
+  strm.zalloc = Z_NULL;
+  strm.zfree = Z_NULL;
+  strm.opaque = Z_NULL;
+  strm.avail_in = 0;
+  strm.next_in = Z_NULL;
+  ret = inflateInit(&strm);
+  if (ret != Z_OK)
+    return ret;
+
+  *out = (unsigned char *)malloc(COMPRESS_CHUNK);
+  if (!(*out))
+    return Z_BUF_ERROR;
+
+  strm.avail_in = in_size;
+  strm.next_in = in;
+  strm.avail_out = COMPRESS_CHUNK;
+  strm.next_out = *out;
+
+  ret = inflate(&strm, Z_NO_FLUSH);
+  assert(ret != Z_STREAM_ERROR); /* state not clobbered */
+  switch (ret) {
+  case Z_NEED_DICT:
+    ret = Z_DATA_ERROR; /* and fall through */
+  case Z_DATA_ERROR:
+  case Z_MEM_ERROR:
+    (void)inflateEnd(&strm);
+    return ret;
+  }
+  // have = COMPRESS_CHUNK - strm.avail_out;
+
+  /* clean up and return */
+  (void)inflateEnd(&strm);
+  return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
+}
+
+bool ui_com::ConnectionLost() { return connection_lost; }
+
+void ui_com::AddSendData(const SendData *obj) {
+  send_mutex->GetMutex();
+
+  resume_time.push_back(GetTime() + (Time)obj->SendPeriod() * 1000000);
+
+  // on resume en meme temps tout ceux qui ont la meme periode
+  for (size_t i = 0; i < data_to_send.size(); i++) {
+    if (data_to_send.at(i)->SendPeriod() == obj->SendPeriod()) {
+      resume_time.at(resume_time.size() - 1) = resume_time.at(i);
+      break;
+    }
+  }
+
+  data_to_send.push_back(obj);
+
+  send_mutex->ReleaseMutex();
+}
+
+void ui_com::UpdateSendData(const SendData *obj) {
+  // le mutex est deja pris par l'appellant
+  size_t id, i;
+
+  // on recupere l'id
+  for (i = 0; i < data_to_send.size(); i++) {
+    if (data_to_send.at(i) == obj) {
+      id = i;
+      break;
+    }
+  }
+
+  // on resume en meme temps tout ceux qui ont la meme periode
+  for (i = 0; i < data_to_send.size(); i++) {
+    if (i == id)
+      continue;
+    if (data_to_send.at(i)->IsEnabled() == true &&
+        data_to_send.at(i)->SendPeriod() == obj->SendPeriod()) {
+      resume_time.at(id) = resume_time.at(i);
+      break;
+    }
+  }
+
+  // si aucun match, on planifie l'execution
+  if (i == data_to_send.size())
+    resume_time.at(id) = GetTime() + (Time)obj->SendPeriod() * 1000000;
+
+  if (IsSuspended() == true)
+    Resume();
+
+  return;
+}
+
+void ui_com::UpdateDataToSendSize(void) {
+  send_mutex->GetMutex();
+  send_size = 3; // id(1)+period(2)
+  for (size_t i = 0; i < data_to_send.size(); i++) {
+    if (data_to_send[i] != NULL)
+      send_size += data_to_send[i]->SendSize();
+  }
+
+  // send_buffer=(char*)realloc((void*)send_buffer,send_size*sizeof(char));
+  if (send_buffer != NULL)
+    free(send_buffer);
+  send_buffer = (char *)malloc(send_size * sizeof(char));
+  send_mutex->ReleaseMutex();
+}
+
+void ui_com::RemoveSendData(const SendData *obj) {
+  // printf("remove_data_to_send %i\n",data_to_send.size());
+
+  send_mutex->GetMutex();
+  // on recupere l'id
+  for (size_t i = 0; i < data_to_send.size(); i++) {
+    if (data_to_send.at(i) == obj) {
+      data_to_send.erase(data_to_send.begin() + i);
+      resume_time.erase(resume_time.begin() + i);
+      // printf("remove_data_to_send %i ok\n",data_to_send.size());
+      break;
+    }
+  }
+  send_mutex->ReleaseMutex();
+
+  return;
+}
+
+void ui_com::Block(void) { send_mutex->GetMutex(); }
+
+void ui_com::UnBlock(void) { send_mutex->ReleaseMutex(); }
Index: tags/latest/lib/FlairCore/src/unexported/ConditionVariable_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/ConditionVariable_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/ConditionVariable_impl.h	(revision 209)
@@ -0,0 +1,52 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConditionVariable_impl.h
+ * \brief Class defining a condition variable
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef CONDITIONVARIABLE_IMPL_H
+#define CONDITIONVARIABLE_IMPL_H
+
+#include "Object.h"
+#ifdef __XENO__
+#include <native/cond.h>
+#include <native/timer.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair {
+namespace core {
+class ConditionVariable;
+}
+}
+
+/*! \class ConditionVariable_impl
+* \brief Class defining a condition variable
+*
+*/
+class ConditionVariable_impl {
+
+public:
+  ConditionVariable_impl(flair::core::ConditionVariable *self);
+  ~ConditionVariable_impl();
+  void CondWait(void);
+  bool CondWaitUntil(flair::core::Time date);
+  void CondSignal(void);
+
+private:
+  flair::core::ConditionVariable *self;
+#ifdef __XENO__
+  RT_COND m_ResumeCond;
+#else
+  pthread_cond_t m_ResumeCond;
+#endif
+};
+
+#endif // CONDITIONVARIABLE_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/DataPlot_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/DataPlot_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/DataPlot_impl.h	(revision 209)
@@ -0,0 +1,36 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot_impl.h
+ * \brief Classe de base pour les gprahes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/10
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT_IMPL_H
+#define DATAPLOT_IMPL_H
+
+#include <vector>
+
+namespace flair {
+namespace core {
+class IODataElement;
+}
+}
+
+/*! \class DataPlot_impl
+* \brief Classe de base pour les graphes
+*
+*/
+class DataPlot_impl {
+public:
+  DataPlot_impl();
+  ~DataPlot_impl();
+
+  std::vector<const flair::core::IODataElement *> tosend;
+};
+
+#endif // DATAPLOT_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/FrameworkManager_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/FrameworkManager_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/FrameworkManager_impl.h	(revision 209)
@@ -0,0 +1,136 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file FrameworkManager.h
+ * \brief Classe de base de la librairie
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/31
+ * \version 4.0
+ */
+
+#ifndef FRAMEWORKMANAGER_IMPL_H
+#define FRAMEWORKMANAGER_IMPL_H
+
+#include "Thread.h"
+#include "ui_com.h"
+#include <io_hdfile.h>
+#include <libxml/xpath.h>
+
+#ifdef __XENO__
+#include <native/pipe.h>
+#include <native/heap.h>
+#endif
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class IODevice;
+class Watchdog;
+}
+namespace gui {
+class TabWidget;
+class PushButton;
+class Layout;
+}
+}
+
+class ui_com;
+
+class FrameworkManager_impl : public flair::core::Thread {
+public:
+  FrameworkManager_impl(flair::core::FrameworkManager *self, std::string name);
+  ~FrameworkManager_impl();
+  void SetupConnection(std::string address, uint16_t port,flair::core::Time watchdogTimeout,
+                       size_t rcv_buf_size);
+  void SetupUserInterface(std::string xml_file);
+  void SetupLogger(std::string log_path);
+  void AddDeviceToLog(flair::core::IODevice *device);
+	bool IsDeviceLogged(const flair::core::IODevice *device) const;
+  void StartLog();
+  void StopLog();
+  char *GetBuffer(size_t sz);
+  void ReleaseBuffer(char *buf);
+  void WriteLog(const char *buf, size_t size);
+
+  /*!
+  * \brief Affiche le xml
+  *
+  * Pour debug.
+  */
+  void PrintXml(void) const;
+
+  bool is_logging;
+  bool disable_errors;
+  bool connection_lost;
+  static ui_com *com;
+  static FrameworkManager_impl *_this;
+  std::string log_path;
+
+  flair::gui::TabWidget *tabwidget;
+  flair::gui::PushButton *save_button; //,*load_button;
+
+  xmlDocPtr file_doc;
+
+  typedef struct {
+    const flair::core::IODevice *device;
+    size_t size;
+    flair::core::Time time;
+  } log_header_t;
+
+private:
+  flair::core::FrameworkManager *self;
+  UDTSOCKET file_sock, com_sock;
+  UDTSOCKET GetSocket(std::string address, uint16_t port);
+  void Run();
+  void SendFile(std::string path, std::string name);
+  void FinishSending(void);
+  std::string FileName(flair::core::IODevice *device);
+  void SaveXmlChange(char *buf);
+  void SaveXml(void);
+  size_t rcv_buf_size;
+  char *rcv_buf;
+#ifdef __XENO__
+  int CreatePipe(RT_PIPE *fd, std::string name);
+  int DeletePipe(RT_PIPE *fd);
+  RT_PIPE cmd_pipe;
+  RT_PIPE data_pipe;
+  RT_HEAP log_heap;
+#else
+  int CreatePipe(int (*fd)[2], std::string name);
+  int DeletePipe(int (*fd)[2]);
+  int cmd_pipe[2];
+  int data_pipe[2];
+#endif
+  // logger
+  bool continuer; // a enlever, avoir un seul bool pour toutes les taches
+  static void *write_log_user(void *arg);
+  pthread_t log_th;
+  std::string xml_file;
+  bool logger_defined;
+  bool ui_defined;
+  flair::gui::Layout *top_layout;
+
+  typedef struct {
+    flair::core::IODevice *device;
+    size_t size;
+    hdfile_t *dbtFile;
+    bool running;
+  } log_desc_t;
+
+  std::vector<log_desc_t> logs;
+  std::vector<std::string> xml_changes;
+  flair::core::Watchdog *gcs_watchdog;
+  void ConnectionLost(void);
+};
+
+namespace {
+inline ui_com *getUiCom(void) { return FrameworkManager_impl::com; }
+
+inline FrameworkManager_impl *getFrameworkManagerImpl(void) {
+  return FrameworkManager_impl::_this;
+}
+}
+
+#endif // FRAMEWORKMANAGER_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/IODevice_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 209)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file IODevice_impl.h
+ * \brief Classe de base pour un système à entrées/sorties
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef IO_DEVICE_IMPL_H
+#define IO_DEVICE_IMPL_H
+
+#include <string>
+#include <Object.h>
+
+namespace flair {
+namespace core {
+class io_data;
+class IODevice;
+class Thread;
+class Mutex;
+class FrameworkManager;
+class SharedMem;
+}
+}
+
+class FrameworkManager_impl;
+
+class IODevice_impl {
+public:
+  IODevice_impl(const flair::core::IODevice *self);
+  ~IODevice_impl();
+  void ResumeThread(void);
+  size_t LogSize(void) const;
+  void AppendLog(char **ptr);
+  void AddDataToLog(const flair::core::io_data *data);
+  void WriteLogsDescriptors(std::fstream &desc_file, int *index);
+  int SetToWake(const flair::core::Thread *thread);
+  void WriteLog(flair::core::Time time);
+  void AddDeviceToLog(const flair::core::IODevice *device);
+  void SetToBeLogged(void); 
+	bool IsSetToBeLogged(void) const;
+  void OutputToShMem(bool enabled);
+  void WriteToShMem(void);
+  void PrintLogsDescriptors(void);
+  void SetIsReady(bool status);
+  bool IsReady(void) const;
+
+private:
+  std::vector<const flair::core::IODevice *> devicesToLog;
+  const flair::core::IODevice *self;
+  const flair::core::FrameworkManager *framework;
+  FrameworkManager_impl *framework_impl;
+  std::vector<const flair::core::io_data *> datasToLog;
+  flair::core::Thread *thread_to_wake;
+  flair::core::Mutex *wake_mutex;
+  bool tobelogged;
+  bool outputtoshm;
+  flair::core::SharedMem *shmem;
+  bool isReady;
+};
+
+#endif // IO_DEVICE_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/Mutex_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/Mutex_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/Mutex_impl.h	(revision 209)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Mutex_impl.h
+ * \brief Class defining a mutex
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/14
+ * \version 4.0
+ */
+
+#ifndef MUTEX_IMPL_H
+#define MUTEX_IMPL_H
+
+#ifdef __XENO__
+#include <native/mutex.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair {
+namespace core {
+class Mutex;
+}
+}
+
+class Mutex_impl {
+public:
+  Mutex_impl(flair::core::Mutex *self);
+  ~Mutex_impl();
+  void GetMutex(void);
+  void ReleaseMutex(void);
+//        bool IsLocked(void);
+#ifdef __XENO__
+  RT_MUTEX mutex;
+#else
+  pthread_mutex_t mutex;
+// bool flag_locked;
+#endif
+
+private:
+  flair::core::Mutex *self;
+};
+
+#endif // MUTEX_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/Object_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/Object_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/Object_impl.h	(revision 209)
@@ -0,0 +1,40 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour object_impl
+//
+//
+/*********************************************************************/
+
+#ifndef OBJECT_IMPL_H
+#define OBJECT_IMPL_H
+
+class Object_impl {
+public:
+  Object_impl(const flair::core::Object *self,
+              const flair::core::Object *parent = NULL, std::string name = "",
+              std::string type = "");
+  ~Object_impl();
+  std::string name, type;
+  std::vector<const flair::core::Object *> childs;
+  std::vector<const flair::core::Object *> type_childs;
+  void AddChild(const flair::core::Object *child);
+  void RemoveChild(const flair::core::Object *child);
+  bool ErrorOccured(bool recursive);
+  bool error_occured;
+  const flair::core::Object *parent;
+
+private:
+  const flair::core::Object *self;
+};
+
+#endif // OBJECT_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/OneAxisRotation_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 209)
@@ -0,0 +1,52 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file OneAxisRotation_impl.h
+ * \brief Classe définissant une rotation autour d'un axe
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/17
+ * \version 4.0
+ */
+
+#ifndef ONEAXISROTATION_IMPL_H
+#define ONEAXISROTATION_IMPL_H
+
+#include <Vector3D.h>
+
+namespace flair {
+namespace core {
+class Euler;
+class Quaternion;
+class RotationMatrix;
+}
+namespace gui {
+class GroupBox;
+class ComboBox;
+class DoubleSpinBox;
+}
+}
+
+/*! \class OneAxisRotation_impl
+* \brief Classe définissant une rotation autour d'un axe
+*
+*/
+class OneAxisRotation_impl {
+public:
+  OneAxisRotation_impl(flair::gui::GroupBox *box,int rotationType);
+  ~OneAxisRotation_impl();
+  template <typename T> void ComputeRotation(flair::core::Vector3D<T> &point) const;
+  void ComputeRotation(flair::core::Quaternion &quat) const;
+  void ComputeRotation(flair::core::RotationMatrix &matrix) const;
+  void ComputeRotation(flair::core::Euler &euler) const;
+  int GetAxis() const;
+  float GetAngle() const;
+  
+private:
+  flair::gui::ComboBox *rot_axe;
+  flair::gui::DoubleSpinBox *rot_value;
+  int rotationType;
+};
+
+#endif // ONEAXISROTATION_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/Semaphore_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 209)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Semaphore_impl.h
+ * \brief Class defining a semaphore implementation
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/11/16
+ * \version 1.0
+ */
+
+#ifndef SEMAPHORE_IMPL_H
+#define SEMAPHORE_IMPL_H
+
+#ifdef __XENO__
+#include <native/sem.h>
+#else
+#include <semaphore.h>
+#endif
+
+namespace flair {
+namespace core {
+class Semaphore;
+class Object;
+}
+}
+
+class Semaphore_impl {
+public:
+  Semaphore_impl(flair::core::Semaphore *self, uint32_t initialValue);
+  ~Semaphore_impl();
+  bool TryGetSemaphore();
+  bool GetSemaphore(flair::core::Time timeout = TIME_INFINITE);
+  bool ReleaseSemaphore(void);
+#ifdef __XENO__
+  RT_SEM semaphore;
+#else
+  sem_t semaphore;
+#endif
+
+private:
+  flair::core::Semaphore *self;
+};
+
+#endif // SEMAPHORE_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/SendData_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/SendData_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/SendData_impl.h	(revision 209)
@@ -0,0 +1,34 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SendData_impl.h
+ * \brief Base class for sending datas to ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/07
+ * \version 4.0
+ */
+
+#ifndef SENDDATA_IMPL_H
+#define SENDDATA_IMPL_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+class SendData_impl;
+
+/*! \class SendData_impl
+* \brief Base class for sending datas to ground station
+*
+*/
+class SendData_impl {
+public:
+  SendData_impl();
+  ~SendData_impl();
+  bool is_enabled;
+  size_t send_size;
+  uint16_t send_period;
+};
+
+#endif // SENDDATA_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/SharedMem_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/SharedMem_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/SharedMem_impl.h	(revision 209)
@@ -0,0 +1,56 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SharedMem_impl.h
+ * \brief Class defining a shared memory
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/10
+ * \version 4.0
+ */
+
+#ifndef SHAREDMEM_IMPL_H
+#define SHAREDMEM_IMPL_H
+
+#include <string>
+
+#ifdef __XENO__
+#include <native/heap.h>
+#endif
+
+#include <Semaphore.h>
+
+#include <SharedMem.h>
+
+/*! \class SharedMem_impl
+* \brief Class defining a shared memory
+*
+*/
+
+class SharedMem_impl {
+public:
+  SharedMem_impl(const flair::core::SharedMem *self, std::string name,
+                 size_t size, flair::core::SharedMem::Type &type);
+  ~SharedMem_impl();
+
+  void Write(const char *buf, size_t size);
+  bool Read(char *buf, size_t size, flair::core::Time nsTimeout);
+  void ReaderReady();
+
+private:
+  const flair::core::SharedMem *self;
+  flair::core::SharedMem::Type type;
+  size_t size;
+  char *mem_segment;
+  flair::core::Semaphore sem,sem_producer,sem_consumer;
+#ifdef __XENO__
+  RT_HEAP heap;
+  bool heap_binded;
+#else
+  int fd;
+  std::string shm_name;
+#endif
+};
+
+#endif // SHAREDMEM_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/Thread_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/Thread_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/Thread_impl.h	(revision 209)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Thread_impl.h
+ * \brief Classe définissant un thread
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/10/04
+ * \version 4.0
+ */
+#ifndef THREAD_IMPL_H
+#define THREAD_IMPL_H
+
+#include <string>
+#include <stdint.h>
+#include <Object.h>
+#ifdef __XENO__
+#include <native/task.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair {
+namespace core {
+class Thread;
+class IODevice;
+class ConditionVariable;
+}
+}
+
+class Thread_impl {
+public:
+  Thread_impl(flair::core::Thread *self, uint8_t priority);
+  ~Thread_impl();
+  void Start(void);
+  void Join(void);
+  void SafeStop(void);
+  bool ToBeStopped(void);
+  void SetPeriodUS(uint32_t period);
+  uint32_t GetPeriodUS(void) const;
+  void SetPeriodMS(uint32_t period);
+  uint32_t GetPeriodMS(void) const;
+  void WaitPeriod(void);
+  void Suspend(void);
+  bool SuspendUntil(flair::core::Time date);
+  void Resume(void);
+  bool IsSuspended(void);
+  int WaitUpdate(const flair::core::IODevice *device);
+  bool period_set;
+   bool isRunning;
+
+private:
+  flair::core::Thread *self;
+  flair::core::ConditionVariable *cond;
+  uint8_t priority;
+  flair::core::Time max_latency, min_latency, mean_latency;
+  flair::core::Time last;
+  uint64_t cpt;
+  flair::core::Time period;
+  bool tobestopped;
+  bool is_suspended;
+  void PrintStats(void);
+  void ComputeLatency(flair::core::Time time);
+#ifdef __XENO__
+  RT_TASK task_rt;
+  static void main_rt(void *arg);
+#else
+  pthread_t task_nrt;
+  static void *main_nrt(void *arg);
+  flair::core::Time next_time;
+#endif
+};
+#endif // THREAD_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/UdpSocket_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/UdpSocket_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/UdpSocket_impl.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UdpSocket_impl.h
+ * \brief Classe creant une socket
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/17
+ * \version 4.0
+ */
+
+#ifndef UDPSOCKET_IMPL_H
+#define UDPSOCKET_IMPL_H
+
+#include <sys/socket.h>
+#include <netdb.h>
+#include <Object.h>
+#ifdef __XENO__
+#include <native/pipe.h>
+#endif
+
+namespace flair { namespace core {
+  class UdpSocket;
+} }
+
+class UdpSocket_impl {
+public:
+  UdpSocket_impl(const flair::core::UdpSocket *self, std::string name,
+              std::string address, bool broadcast = false);
+  UdpSocket_impl(const flair::core::UdpSocket *self, std::string name, uint16_t port);
+  ~UdpSocket_impl();
+
+  void SendMessage(std::string message);
+  void SendMessage(const char *src, size_t src_len);
+  ssize_t RecvMessage(char *msg, size_t msg_len, flair::core::Time timeout,
+                      char *src = NULL, size_t *src_len = NULL);
+
+private:
+  int fd;
+  uint16_t port;
+  std::string address;
+  bool broadcast;
+  void Init(void);
+  const flair::core::UdpSocket *self;
+  struct sockaddr_in sock_in;
+#ifdef __XENO__
+  bool is_running;
+  static void *user(void *arg);
+  pthread_t user_thread;
+  RT_PIPE pipe;
+#endif
+};
+
+#endif // UDPSOCKET_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/Widget_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/Widget_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/Widget_impl.h	(revision 209)
@@ -0,0 +1,123 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Widget_impl.h
+ * \brief Classe representant un Widget
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/02
+ * \version 4.0
+ */
+
+#ifndef WIDGET_IMPL_H
+#define WIDGET_IMPL_H
+
+#include <libxml/xpath.h>
+#include <io_data.h>
+
+namespace flair {
+namespace gui {
+class Widget;
+}
+}
+
+/*! \class Widget_impl
+* \brief Classe representant un Widget
+*
+*  C'est une classe de base. Tout comme l'Object elle permet de gérer les liens
+*de parenté
+*  et de détruire automatiquement les enfants. Elle permet en plus de gérer une
+*communication
+*  avec la station sol, et donc d'y afficher un QWidget. \n
+*  La comunication avec la station sol se fait par l'échange de fichiers xml.
+*Les propriétés xml du Widget sont
+*  modifiables par les fonctions appropriées. \n
+*  Un fichier xml de réglages par défaut du Widget est utilisé s'il a été
+*spécifié à la construction du FrameworkManager.
+*/
+class Widget_impl {
+  friend class flair::core::FrameworkManager;
+  friend class FrameworkManager_impl;
+
+public:
+  /*!
+  * \brief Constructeur
+  *
+  * Construit un Widget, qui est automatiquement enfant du parent. Le fichier
+  *xml
+  * spécifié au constructeur du FrameworkManager est utilisé pour les réglages
+  *par
+  * défaut. \n
+  * Sauf pour le FrameworkManager, ce constructeur doit être apellé depuis une
+  *tache temps réel
+  * lorsque l'on utilise la librairie framework_rt.
+  *
+  * \param parent parent
+  * \param name nom
+  * \param type type
+  */
+  Widget_impl(flair::gui::Widget *self, const flair::gui::Widget *parent,
+              std::string name, std::string type);
+
+  /*!
+  * \brief Déstructeur
+  *
+  * Détruit automatiquement les enfants.
+  * La destruction implique la destruction du QWidget associé sur la station
+  *sol.\n
+  * Sauf pour le FrameworkManager, ce déstructeur doit être apellé depuis une
+  *tache temps réel
+  * lorsque l'on utilise la librairie framework_rt.
+  *
+  */
+  ~Widget_impl();
+
+  /*!
+  * \brief Activer
+  *
+  * Active le QWidget associé sur la station sol. \n
+  * Un QWdiget désactivé apparait grisé et n'est pas modifiable.
+  *
+  * \param status
+  */
+  void setEnabled(bool status);
+
+  /*!
+  * \brief Envoi le xml
+  *
+  * Envoi le xml à la station sol pour prendre en compte les changements.
+  */
+  void SendXml(void);
+
+  xmlNodePtr file_node;
+  xmlNodePtr send_node;
+  bool isenabled;
+
+private:
+  flair::gui::Widget *self;
+
+  std::vector<flair::gui::Widget *> childs;
+
+  void AddChild(const flair::gui::Widget *child);
+  void RemoveChild(const flair::gui::Widget *child);
+
+  /*!
+ * \brief Efface les proriétés xml
+ *
+ *  Permet d'effacer toutes les propriétés XML fixées par SetVolatileXmlProp.
+ *  A utliser lorsque l'on a plus besoin d'utiliser ces propriétés. Utile
+ * pour réduire la taille des fichiers XML écangés avec la station sol.
+ */
+  void ClearXmlProps(void);
+
+  // xml
+  void ProcessXML(xmlNode *node);
+  xmlDocPtr CopyDoc(void);
+  static xmlNodePtr GetNodeByProp(xmlNodePtr doc, xmlChar *type, xmlChar *prop,
+                                  xmlChar *value);
+  void printSendNode();
+  xmlDocPtr send_doc;
+};
+
+#endif // WIDGET_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/communication.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/communication.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/communication.h	(revision 209)
@@ -0,0 +1,20 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef COMMUNICATION_H
+#define COMMUNICATION_H
+
+// messages file socket
+#define FILE_INFO_LITTLE_ENDIAN 0x01
+#define FILE_INFO_BIG_ENDIAN 0x02
+#define END 0x03
+
+#define XML_HEADER 0x3c
+#define ZLIB_HEADER 0x78
+#define WATCHDOG_HEADER 0x01
+
+#define DATAS_LITTLE_ENDIAN 0xfd
+#define DATAS_BIG_ENDIAN 0xfe
+
+#endif // COMMUNICATION_H
Index: tags/latest/lib/FlairCore/src/unexported/config.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/config.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/config.h	(revision 209)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/21
+//  filename:   config.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    configuration du framework
+//
+//
+/*********************************************************************/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+// stack size of nrt threads, comment it to use default value
+#define NRT_STACK_SIZE 1024 * 1024 * 1
+
+// stack size of rt threads, comment it to use default value
+#define RT_STACK_SIZE 1024 * 100
+
+// rt pipe size, comment it to use system heap
+#define RT_PIPE_SIZE 1024 * 1024
+
+// nrt pipe size
+#define NRT_PIPE_SIZE 1024 * 100
+
+// rt log heap size
+#define LOG_HEAP 1024 * 100
+
+// xml heap size
+#define XML_HEAP 5 * 1024 * 1024
+
+// nrt pipe path
+#define NRT_PIPE_PATH "/proc/xenomai/registry/native/pipes/"
+
+// min priority for Threads
+#define MIN_THREAD_PRIORITY 20
+
+// max priority for Threads
+#define MAX_THREAD_PRIORITY 99
+
+// priority of the FrameworkManager task (manages udt connection)
+#define FRAMEWORK_TASK_PRIORITY 1
+
+// timeout in ms for select
+#define SELECT_TIMEOUT_MS 200
+
+// type of xml root element
+#define XML_ROOT_TYPE "root"
+
+// name of xml root element
+//#define XML_ROOT_ELEMENT "Manager"
+
+// name of main tabwidget
+#define XML_MAIN_TABWIDGET "Main_TabWidget"
+
+// name of app tabwidget
+#define XML_APP_TABWIDGET "App_TabWidget"
+
+// use compression for messages with ground station
+#define COMPRESS_FRAMES
+
+// size of buffer shunck
+#define COMPRESS_CHUNK 1024
+
+#endif // CONFIG_H
Index: tags/latest/lib/FlairCore/src/unexported/cvmatrix_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/cvmatrix_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/cvmatrix_impl.h	(revision 209)
@@ -0,0 +1,43 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix_impl.h
+ * \brief Classe définissant une matrice opencv
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_IMPL_H
+#define CVMATRIX_IMPL_H
+
+#include <io_data.h>
+#include <cvmatrix.h>
+
+struct CvMat;
+
+/*! \class cvmatrix_impl
+* \brief Classe définissant une matrice opencv
+*
+*/
+class cvmatrix_impl {
+public:
+  cvmatrix_impl(flair::core::cvmatrix *self, int rows, int cols,
+                flair::core::ScalarType const &elementDataType, int n);
+  cvmatrix_impl(flair::core::cvmatrix *self,
+                const flair::core::cvmatrix_descriptor *descriptor,
+                flair::core::ScalarType const &elementDataType, int n);
+  ~cvmatrix_impl();
+
+  CvMat *mat;
+  flair::core::ScalarType const &elementDataType;
+  flair::core::cvmatrix_descriptor *descriptor;
+
+private:
+  flair::core::cvmatrix *self;
+  void Init(flair::core::cvmatrix *self, int n);
+};
+
+#endif // CVMATRIX_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/io_data_impl.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/io_data_impl.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/io_data_impl.h	(revision 209)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file io_data_impl.h
+ * \brief Abstract class for data types.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef IO_DATA_IMPL_H
+#define IO_DATA_IMPL_H
+
+#include "io_data.h"
+
+/*! \class io_data_impl
+* \brief Abstract class for data types.
+*
+* Use this class to define a custom data type. Data types ares used for logging
+*and graphs. \n
+* The reimplemented class must call SetSize() in its constructor. \n
+* io_data can be constructed with n samples (see io_data::io_data).
+* In this case, old samples can be accessed throug io_data::Prev.
+*/
+class io_data_impl {
+public:
+  io_data_impl(flair::core::io_data *self, int n);
+  ~io_data_impl();
+  void Circle(void);
+  bool IsConsistent(void);
+  void SetConsistent(bool status);
+  void WriteLogDescriptor(std::fstream &desc_file, int *index);
+  void PrintLogDescriptor(void);
+  void AppendLogDescription(std::string description,
+                            flair::core::DataType const &datatype);
+  size_t size;
+  flair::core::Time time;
+  void **circle_ptr;
+
+private:
+  flair::core::io_data *self;
+  int n;
+  bool is_consistent;
+  std::vector<std::string> descriptors;
+};
+
+#endif // IO_DATA_IMPL_H
Index: tags/latest/lib/FlairCore/src/unexported/ui_com.h
===================================================================
--- tags/latest/lib/FlairCore/src/unexported/ui_com.h	(revision 209)
+++ tags/latest/lib/FlairCore/src/unexported/ui_com.h	(revision 209)
@@ -0,0 +1,73 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   ui_com.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe permettant la lecture et l'ecriture RT sur socket UDT
+//
+//
+/*********************************************************************/
+
+#ifndef UI_COM_H
+#define UI_COM_H
+
+#include "Thread.h"
+#include <udt.h>
+#ifdef __XENO__
+#include <native/pipe.h>
+#endif
+
+namespace flair {
+namespace core {
+class Mutex;
+class Object;
+}
+namespace gui {
+class SendData;
+}
+}
+
+class ui_com : public flair::core::Thread {
+public:
+  ui_com(const flair::core::Object *parent, UDTSOCKET sock);
+  ~ui_com();
+  void Send(char *buf, ssize_t size);
+  ssize_t Receive(char *buf, ssize_t buf_size);
+  void AddSendData(const flair::gui::SendData *obj);
+  void UpdateSendData(const flair::gui::SendData *obj);
+  void RemoveSendData(const flair::gui::SendData *obj);
+  void UpdateDataToSendSize(void);
+  void Block(void);
+  void UnBlock(void);
+  bool ConnectionLost(void);
+
+private:
+  ssize_t send_size;
+  char *send_buffer;
+  std::vector<const flair::gui::SendData *> data_to_send;
+  std::vector<flair::core::Time> resume_time;
+  flair::core::Mutex *send_mutex;
+  UDTSOCKET socket_fd;
+  bool connection_lost;
+  void Run(void);
+  void SendDatas(void);
+  static int compressBuffer(char *in, ssize_t in_size, char **out,
+                            ssize_t *out_size, int level);
+  static int uncompressBuffer(unsigned char *in, ssize_t in_size,
+                              unsigned char **out, ssize_t *out_size);
+#ifdef __XENO__
+  bool is_running;
+  static void *user_thread(void *arg);
+  pthread_t thread;
+  RT_PIPE pipe;
+#endif
+};
+
+#endif // UI_COM_H
Index: tags/latest/lib/FlairFilter/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairFilter/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairFilter/CMakeLists.txt	(revision 209)
@@ -0,0 +1,52 @@
+PROJECT(FlairFilter)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairSensorActuator/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+	${CMAKE_CURRENT_SOURCE_DIR}/src/
+	${CMAKE_SYSROOT}/usr/include/opencv
+	${CMAKE_SYSROOT}/usr/include/iir
+)
+
+FILE(GLOB SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SRC_FILES}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+#copie des entetes
+FILE(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
+INSTALL(FILES ${HEADER_FILES} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
Index: tags/latest/lib/FlairFilter/src/Ahrs.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/Ahrs.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Ahrs.cpp	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/14
+//  filename:   Ahrs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for AHRS
+//
+//
+/*********************************************************************/
+
+#include "Ahrs.h"
+#include "Ahrs_impl.h"
+#include <Imu.h>
+#include <DataPlot1D.h>
+#include <AhrsData.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+namespace flair {
+namespace filter {
+
+Ahrs::Ahrs(const Imu *parent, string name) : IODevice(parent, name) {
+  pimpl_ = new Ahrs_impl(this);
+  AddDataToLog(pimpl_->ahrsData);
+}
+
+Ahrs::~Ahrs() { delete pimpl_; }
+
+const Imu *Ahrs::GetImu(void) const { return (Imu *)Parent(); }
+
+const AhrsData *Ahrs::GetDatas(void) const { return pimpl_->ahrsData; }
+
+void Ahrs::GetDatas(core::AhrsData **ahrsData) const {
+  *ahrsData = pimpl_->ahrsData;
+}
+
+void Ahrs::LockUserInterface(void) const {
+  //((Imu*)Parent())->LockUserInterface();
+}
+
+void Ahrs::UnlockUserInterface(void) const {
+  //((Imu*)Parent())->UnlockUserInterface();
+}
+
+void Ahrs::UseDefaultPlot(void) {
+  pimpl_->UseDefaultPlot();
+  ((Imu *)Parent())->UseDefaultPlot();
+}
+
+void Ahrs::AddPlot(const AhrsData *ahrsData, DataPlot::Color_t color) {
+  pimpl_->AddPlot(ahrsData, color);
+}
+
+DataPlot1D *Ahrs::RollPlot(void) const { return pimpl_->rollPlot; }
+
+DataPlot1D *Ahrs::PitchPlot(void) const { return pimpl_->pitchPlot; }
+
+DataPlot1D *Ahrs::YawPlot(void) const { return pimpl_->yawPlot; }
+
+DataPlot1D *Ahrs::WXPlot(void) const { return pimpl_->wXPlot; }
+
+DataPlot1D *Ahrs::WYPlot(void) const { return pimpl_->wYPlot; }
+
+DataPlot1D *Ahrs::WZPlot(void) const { return pimpl_->wZPlot; }
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/Ahrs.h
===================================================================
--- tags/latest/lib/FlairFilter/src/Ahrs.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Ahrs.h	(revision 209)
@@ -0,0 +1,184 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Ahrs.h
+ * \brief Abstract class for AHRS
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/14
+ * \version 4.0
+ */
+
+#ifndef AHRS_H
+#define AHRS_H
+
+#include <IODevice.h>
+#include <DataPlot.h>
+
+namespace flair {
+  namespace core {
+    class AhrsData;
+  }
+  namespace gui {
+    class Tab;
+    class DataPlot1D;
+  }
+  namespace sensor {
+    class Imu;
+  }
+}
+
+class Ahrs_impl;
+
+namespace flair {
+namespace filter {
+/*! \class Ahrs
+*
+* \brief Abstract class for AHRS
+*
+* Use this class to define a custom AHRS. This class is child
+* of an Imu class, which will provide measurements. \n
+*
+*/
+class Ahrs : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Ahrs.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Ahrs(const sensor::Imu *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Ahrs();
+
+  /*!
+  * \brief Get parent Imu
+  *
+  * This function is identical to (Imu*)Parent()
+  */
+  const sensor::Imu *GetImu(void) const;
+
+  /*!
+  * \brief Get ahrs datas
+  *
+  * \return AhrsData
+  */
+  const core::AhrsData *GetDatas(void) const;
+
+  /*!
+  * \brief Lock the graphical user interface
+  *
+  * When locked, parameters cannot be modified.
+  *
+  */
+  void LockUserInterface(void) const;
+
+  /*!
+  * \brief Unlock the graphical user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  * Plot the datas defined in imudata,
+  * and datas defined in Imu::imudata.
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief Add plot
+  *
+  * Add plot of an AhrsData to the default plot
+  *
+  * \param ahrsData ahrs datas to plot
+  * \param color color to use
+  */
+  void AddPlot(const core::AhrsData *ahrsData, gui::DataPlot::Color_t color);
+
+  /*!
+  * \brief Roll plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *RollPlot(void) const;
+
+  /*!
+  * \brief Pitch plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *PitchPlot(void) const;
+
+  /*!
+  * \brief Yaw plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *YawPlot(void) const;
+
+  /*!
+  * \brief Rotation speed around x axis plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *WXPlot(void) const;
+
+  /*!
+  * \brief Rotation speed around y axis plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *WYPlot(void) const;
+
+  /*!
+  * \brief Rotation speed around z axis plot
+  *
+  * Use this plot to add own curves.
+  *
+  * \return plot
+  *
+  */
+  gui::DataPlot1D *WZPlot(void) const;
+
+protected:
+  /*!
+  * \brief Get ahrs datas
+  * 
+  * Can be used by dervied class to fill core::AhrsData
+  * 
+  * \param ahrsData ahrs datas
+  */
+  void GetDatas(core::AhrsData **ahrsData) const;
+
+private:
+  class Ahrs_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // AHRS_H
Index: tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 209)
@@ -0,0 +1,164 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+//  created:    2014/04/28
+//  filename:   AhrsComplementaryFilter.cpp
+//
+//  authors:    Augustin Manecy (RT-MaG Toolbox author, augustin.manecy@gmail.com)
+//              API changes by Guillaume Sanahuja to fit the Flair framework
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an Ahrs complementary filter
+//
+//
+/*********************************************************************/
+
+#include "AhrsComplementaryFilter.h"
+#include <Imu.h>
+#include <DoubleSpinBox.h>
+#include <Vector3DSpinBox.h>
+#include <GridLayout.h>
+#include <ImuData.h>
+#include <AhrsData.h>
+#include <math.h>
+
+#define G 9.81
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+namespace flair { namespace filter {
+
+AhrsComplementaryFilter::AhrsComplementaryFilter(const Imu* parent,string name): isInit(false), Ahrs(parent,name) {
+
+  QHat.q0=1;
+  QHat.q1=0;
+  QHat.q2=0;
+  QHat.q3=0;
+  BHat.x=0;
+  BHat.y=0;
+  BHat.z=0;
+
+  ka[0]=new DoubleSpinBox(parent->GetLayout()->NewRow(),"ka[0]:",0.,10,0.1,2,0.5);
+  ka[1]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"ka[1]:",0.,10,0.1,2,0.5);
+  ka[2]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"ka[2]:",0.,10.,0.1,2,0.);
+
+  kb[0]=new DoubleSpinBox(parent->GetLayout()->NewRow(),"kb[0]:",0.,10,0.1,2,0.01);
+  kb[1]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"kb[1]:",0.,10,0.1,2,0.01);
+  kb[2]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"kb[2]:",0.,10,0.1,2,0.01);
+
+  //put km to [0,0,0] to disable magnetometers
+  km[0]=new DoubleSpinBox(parent->GetLayout()->NewRow(),"km[0]:",0.,50,0.1,2,0.01);
+  km[1]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"km[1]:",0.,50,0.1,2,0.01);
+  km[2]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"km[2]:",0.,50,0.1,2,0.01);
+  
+  magRef=new Vector3DSpinBox(parent->GetLayout()->NewRow(),"ref magnetic field (uT)",
+                                 0, 100, 1,
+                                 3,Vector3Df(20.5324,.2367,43.6682)); //Compiegne, France
+  SetIsReady(true);
+}
+
+AhrsComplementaryFilter::~AhrsComplementaryFilter() {
+
+}
+
+void AhrsComplementaryFilter::UpdateFrom(const io_data *data) {
+    ImuData *input=(ImuData*)data;
+    float delta_t;
+    AhrsData* ahrsData;
+    GetDatas(&ahrsData);
+    Vector3Df rawAcc,rawMag,rawGyr;
+    input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
+
+    delta_t=(float)(data->DataTime()-previous_time)/1000000000.;
+    previous_time=data->DataTime();
+
+    Vector3Df aBar,aHat,aTilde;
+    Vector3Df mBar,mHat,mTilde;
+    Vector3Df alpha,dBHat,omegaHat,magRef;
+    Quaternion dQHat;
+
+    //float ka[3]={0.5,0.5,0};
+    //float kb[3]={0.01,0.01,0.01};
+    //float k_m[3]= {0,0,0};
+    magRef=this->magRef->Value();
+
+    if(isInit==true) {
+        // CORRECTION FROM ACCELEROMETER
+        aBar = rawAcc;
+
+        // estimation of IMU vector using QHat (estimated quaternion): aHat = Inv(QHat) * g
+        /*
+          Inv(QHat) = [q0 -q1 -q2 -q3]'
+          Inv(QHat)*g = [1-2(q2^2+q3^2)     2(q1q2+q0q3)     2(q1q3-q0q2)]     [0]
+                         [  2(q1q2-q0q3)   1-2(q1^2+q3^2))    2(q2q3+q0q1)]  *  [0]
+                         [  2(q1q3+q0q2)     2(q2q3-q0q1)   1-2(q1^2+q2^2)]     [g]
+        */
+        aHat.x = -2*G*(QHat.q1*QHat.q3 - QHat.q0*QHat.q2);
+        aHat.y = -2*G*(QHat.q2*QHat.q3 + QHat.q0*QHat.q1);
+        aHat.z = -G*(1-2.0*(QHat.q1*QHat.q1 + QHat.q2*QHat.q2));
+
+        // cross(aHat, aBar)
+        aTilde=CrossProduct(aHat, aBar);
+
+        
+        // CORRECTION FROM MAGNETOMETER
+        // estimation of IMU vector using QHat (estimated quaternion): mHat = Inv(QHat) * m_ref = Inv(QHat) * magRef
+        /*
+          Inv(QHat) = [q0 -q1 -q2 -q3]'
+          Inv(QHat)*g = [1-2(q2^2+q3^2)     2(q1q2+q0q3)     2(q1q3-q0q2)]     [magRef.x]
+                         [  2(q1q2-q0q3)   1-2(q1^2+q3^2))    2(q2q3+q0q1)]  *  [magRef.x]
+                         [  2(q1q3+q0q2)     2(q2q3-q0q1)   1-2(q1^2+q2^2)]     [magRef.x]
+        */
+        mBar=rawMag;
+        
+        mHat.x = (1-2.0*(QHat.q2*QHat.q2 + QHat.q3*QHat.q3))*magRef.x+2.0*(QHat.q1*QHat.q2+QHat.q0*QHat.q3)*magRef.y+2.0*(QHat.q1*QHat.q3-QHat.q0*QHat.q2)*magRef.z;
+        mHat.y = 2.0*(QHat.q1*QHat.q2 - QHat.q0*QHat.q3)*magRef.x+(1-2.0*(QHat.q1*QHat.q1 + QHat.q3*QHat.q3))*magRef.y+2.0*(QHat.q2*QHat.q3 + QHat.q0*QHat.q1)*magRef.z;
+        mHat.z = 2.0*(QHat.q1*QHat.q3+QHat.q0*QHat.q2)*magRef.x+2.0*(QHat.q2*QHat.q3 - QHat.q0*QHat.q1)*magRef.y+(1-2.0*(QHat.q1*QHat.q1 + QHat.q2*QHat.q2))*magRef.z;
+       
+        
+        // compute the error between mHat and mTilde
+        mTilde=CrossProduct(mHat, mBar);
+
+        // Compute the debiased rotation speed
+        omegaHat = rawGyr - BHat;
+
+        // calculate the correction to apply to the quaternion
+        alpha.x = (ka[0]->Value()*aTilde.x)/(G*G) + (km[0]->Value()*mTilde.x)/(magRef.GetNorm()*magRef.GetNorm());
+        alpha.y = (ka[1]->Value()*aTilde.y)/(G*G) + (km[1]->Value()*mTilde.y)/(magRef.GetNorm()*magRef.GetNorm());
+        alpha.z = (ka[2]->Value()*aTilde.z)/(G*G) + (km[2]->Value()*mTilde.z)/(magRef.GetNorm()*magRef.GetNorm());
+
+        // Bias derivative
+        dBHat.x = kb[0]->Value() * alpha.x;
+        dBHat.y = kb[1]->Value() * alpha.y;
+        dBHat.z = kb[2]->Value() * alpha.z;
+
+        // Bias integration
+        BHat = BHat+dBHat*delta_t;
+
+        // Quaternion derivative: dQHat = 0.5*(QHat*Q_corr)
+        // Q_corr: Corrected pure rotation quaternion for integration
+        dQHat=QHat.GetDerivative(omegaHat - alpha);
+
+        // Quaternion integration
+        QHat = QHat +dQHat*delta_t;	// delta_t: sampling period [s]
+
+        QHat.Normalize();
+
+        ahrsData->SetQuaternionAndAngularRates(QHat,rawGyr - BHat);
+
+    } else {
+        isInit=true;
+    }
+
+    ahrsData->SetDataTime(data->DataTime());
+    ProcessUpdate(ahrsData);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.h
===================================================================
--- tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/AhrsComplementaryFilter.h	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AhrsComplementaryFilter.h
+ * \brief Class defining an Ahrs Kalman filter
+ * \author Augustin Manecy (RT-MaG Toolbox author, augustin.manecy@gmail.com), API changes by Guillaume Sanahuja to fit the Flair framework
+ * \date 2014/01/15
+ * \version 4.0
+ */
+
+#ifndef AHRSCOMPLEMENTARYFILTER_H
+#define AHRSCOMPLEMENTARYFILTER_H
+
+#include <Ahrs.h>
+#include <Vector3D.h>
+#include <Quaternion.h>
+
+namespace flair {
+    namespace sensor {
+        class Imu;
+    }
+    namespace gui {
+        class DoubleSpinBox;
+        class Vector3DSpinBox;
+    }
+}
+
+namespace flair { namespace filter {
+    /*! \class AhrsComplementaryFilter
+    *
+    * \brief Class defining an Ahrs complementary filter
+    *
+    * Implementation from Augustin Manecy
+    */
+    class AhrsComplementaryFilter : public Ahrs {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an AhrsComplementaryFilter.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            AhrsComplementaryFilter(const sensor::Imu* parent,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~AhrsComplementaryFilter();
+
+        private:
+            /*!
+            * \brief Update using provided datas
+            *
+            * Reimplemented from IODevice.
+            *
+            * \param data data from the parent to process
+            */
+            void UpdateFrom(const core::io_data *data);
+
+            core::Time previous_time;
+
+            bool isInit;
+            core::Quaternion QHat;
+            core::Vector3Df BHat;
+            gui::DoubleSpinBox *ka[3];
+            gui::DoubleSpinBox *kb[3];
+            gui::DoubleSpinBox *km[3];
+            gui::Vector3DSpinBox *magRef;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // AHRSCOMPLEMENTARYFILTER_H
Index: tags/latest/lib/FlairFilter/src/AhrsKalman.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/AhrsKalman.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/AhrsKalman.cpp	(revision 209)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/15
+//  filename:   AhrsKalman.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an Ahrs Kalman filter
+//
+//
+/*********************************************************************/
+
+#include "AhrsKalman.h"
+#include "AhrsKalman_impl.h"
+#include <Imu.h>
+#include <AhrsData.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+
+namespace flair { namespace filter {
+
+AhrsKalman::AhrsKalman(const Imu* parent,string name): Ahrs(parent,name) {
+    AhrsData* ahrsData;
+    GetDatas(&ahrsData);
+    pimpl_=new AhrsKalman_impl(parent->GetLayout(),ahrsData);
+    
+    SetIsReady(true);
+}
+
+AhrsKalman::~AhrsKalman() {
+    delete pimpl_;
+}
+
+void AhrsKalman::UpdateFrom(const io_data *data) {
+    pimpl_->UpdateFrom(data);
+    AhrsData* ahrsData;
+    GetDatas(&ahrsData);
+    ProcessUpdate(ahrsData);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/AhrsKalman.h
===================================================================
--- tags/latest/lib/FlairFilter/src/AhrsKalman.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/AhrsKalman.h	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AhrsKalman.h
+ * \brief Class defining an Ahrs Kalman filter
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/15
+ * \version 4.0
+ */
+
+#ifndef AHRSKALMAN_H
+#define AHRSKALMAN_H
+
+#include <Ahrs.h>
+
+namespace flair
+{
+    namespace sensor
+    {
+        class Imu;
+    }
+}
+
+class AhrsKalman_impl;
+
+namespace flair
+{
+namespace filter
+{
+    /*! \class AhrsKalman
+    *
+    * \brief Class defining an Ahrs Kalman filter
+    */
+    class AhrsKalman : public Ahrs
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an AhrsKalman.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            AhrsKalman(const sensor::Imu* parent,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~AhrsKalman();
+
+        private:
+            /*!
+            * \brief Update using provided datas
+            *
+            * Reimplemented from IODevice.
+            *
+            * \param data data from the parent to process
+            */
+            void UpdateFrom(const core::io_data *data);
+            AhrsKalman_impl* pimpl_;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // AHRSKALMAN_H
Index: tags/latest/lib/FlairFilter/src/AhrsKalman_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/AhrsKalman_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/AhrsKalman_impl.cpp	(revision 209)
@@ -0,0 +1,210 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2007/10/17, 2014/01/15
+//  filename:   AhrsKalman_impl.cpp
+//
+//  author:     Tom Pycke (tom.pycke@gmail.com)
+//		API changes by Guillaume Sanahuja to fit the Flair framework
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an Ahrs Kalman filter
+//
+//
+/*********************************************************************/
+
+/***********************************************************************
+ *                                                                     *
+ * This file contains the code for the kalman filter that uses the     *
+ * sensor data as inputs.                                              *
+ *                                                                     *
+ *                                                                     *
+ ***********************************************************************
+ *                                                                     *
+ * Comments:                                                           *
+ *   To help others to understand the kalman filter, I used one of     *
+ *   the most accessible sources with information on it:               *
+ *   http://en.wikipedia.org/wiki/Kalman_filter                        *
+ *   The code is split into 2 parts: a Predict function and an         *
+ *   Update function, just as the wikipedia page does.                 *
+ *   The model I used in the kalman filter is the following:           *
+ *   Our gyroscope measures the turnrate in degrees per second. This   *
+ *   is the derivative of the angle, called dotAngle. The bias is the  *
+ *   output of our gyro when the rotationrate is 0 degrees per second  *
+ *   (not rotating). Because of drift it changes over time.            *
+ *   So mathematically we just integrate the gyro (dt is timespan      *
+ *   since last integration):                                          *
+ *              angle = angle + (dotAngle - bias) * dt                 *
+ *   When we include the bias in our model, the kalman filter will     *
+ *   try to estimate the bias, thanks to our last input: the measured  *
+ *   angle. This is just an estimate and comes from the accelerometer. *
+ *   So the state used in our filter had 2 dimensions: [ angle, bias ] *
+ *   Jump to the functions to read more about the actual               *
+ *   implementation.                                                   *
+ *                                                                     *
+ ***********************************************************************/
+
+#include "AhrsKalman.h"
+#include "AhrsKalman_impl.h"
+#include <Imu.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+#include <ImuData.h>
+#include <AhrsData.h>
+#include <math.h>
+
+#define PI ((float)3.14159265358979323846)
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+AhrsKalman_impl::AhrsKalman_impl(const Layout* layout,AhrsData *inAhrsData): ahrsData(inAhrsData) {
+    is_init=false;
+    euler.yaw=0;
+
+    Q_angle=new DoubleSpinBox(layout->NewRow(),"Q_angle:",0.,10000,0.0001,4);
+    Q_gyro=new DoubleSpinBox(layout->NewRow(),"Q_gyro:",0.,10000,0.0001,4);
+    R_angle=new DoubleSpinBox(layout->NewRow(),"R_angle:",0.,1000000,0.0001,4);
+
+
+    //init ars
+    //ars_Init(&ars_roll, 1/*Q_angle*/, 0.1/*Q_gyro*/, 10000/*R_angle*/);
+    //ars_Init(&ars_pitch, 1/*Q_angle*/, 0.1/*Q_gyro*/, 10000/*R_angle*/);
+    ars_Init(&ars_roll, Q_angle->Value(), Q_gyro->Value(), R_angle->Value());
+    ars_Init(&ars_pitch, Q_angle->Value(), Q_gyro->Value(), R_angle->Value());
+}
+
+AhrsKalman_impl::~AhrsKalman_impl() {
+}
+
+void AhrsKalman_impl::UpdateFrom(const io_data *data) {
+    ImuData *input=(ImuData*)data;
+    float delta_t;
+    Vector3Df rawAcc,rawMag,rawGyr;
+
+    input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
+
+    delta_t=(float)(data->DataTime()-previous_time)/1000000000.;
+    previous_time=data->DataTime();
+
+    if(Q_angle->ValueChanged() || Q_gyro->ValueChanged() || R_angle->ValueChanged()) {
+        ars_Init(&ars_roll, Q_angle->Value(), Q_gyro->Value(), R_angle->Value());
+        ars_Init(&ars_pitch, Q_angle->Value(), Q_gyro->Value(), R_angle->Value());
+    }
+
+    if(is_init==true) {
+        //execute kalman roll filter
+        ars_predict(&ars_roll, rawGyr.x, delta_t);
+        ars_update(&ars_roll, atan2(-rawAcc.y, -rawAcc.z));//1 ou -az
+       
+        //execute kalman pitch filter
+        ars_predict(&ars_pitch, rawGyr.y, delta_t);
+        ars_update(&ars_pitch, -atan2(-rawAcc.x, -rawAcc.z));//1 ou -az
+
+
+        euler.roll=ars_roll.x_angle;
+        euler.pitch=ars_pitch.x_angle;
+        euler.yaw += rawGyr.z *delta_t;
+        if(euler.yaw>PI) euler.yaw-=2*PI;
+        if(euler.yaw<-PI) euler.yaw+=2*PI;
+
+        ahrsData->SetQuaternionAndAngularRates(euler.ToQuaternion(),
+                                               rawGyr-Vector3Df(ars_roll.x_bias,ars_pitch.x_bias,0));
+    } else {
+        is_init=true;
+    }
+
+    ahrsData->SetDataTime(data->DataTime());
+}
+
+
+void AhrsKalman_impl::ars_Init(ars_Gyro1DKalman *ars, double Q_angle, double Q_gyro, double R_angle) {
+    ars->Q_angle = Q_angle;
+    ars->Q_gyro  = Q_gyro;
+    ars->R_angle = R_angle;
+    ars->x_bias=0;
+    ars->x_angle=0;
+    ars->P_00 =0;
+    ars->P_01 =0;
+    ars->P_10 =0;
+    ars->P_11 =0;
+}
+
+/*
+ * The predict function. Updates 2 variables:
+ * our model-state x and the 2x2 matrix P
+ *
+ * x = [ angle, bias ]'
+ *
+ *   = F x + B u
+ *
+ *   = [ 1 -dt, 0 1 ] [ angle, bias ] + [ dt, 0 ] [ dotAngle 0 ]
+ *
+ *   => angle = angle + dt (dotAngle - bias)
+ *      bias  = bias
+ *
+ *
+ * P = F P transpose(F) + Q
+ *
+ *   = [ 1 -dt, 0 1 ] * P * [ 1 0, -dt 1 ] + Q
+ *
+ *  P(0,0) = P(0,0) - dt * ( P(1,0) + P(0,1) ) + dt * P(1,1) + Q(0,0)
+ *  P(0,1) = P(0,1) - dt * P(1,1) + Q(0,1)
+ *  P(1,0) = P(1,0) - dt * P(1,1) + Q(1,0)
+ *  P(1,1) = P(1,1) + Q(1,1)
+ *
+ *
+ */
+void AhrsKalman_impl::ars_predict(ars_Gyro1DKalman *ars, const double dotAngle, const double dt) {
+    ars->x_angle += dt * (dotAngle - ars->x_bias);
+
+    ars->P_00 +=  - dt * (ars->P_10 + ars->P_01) + ars->Q_angle * dt;
+    ars->P_01 +=  - dt * ars->P_11;
+    ars->P_10 +=  - dt * ars->P_11;
+    ars->P_11 +=  + ars->Q_gyro * dt;
+}
+
+/*
+ *  The update function updates our model using
+ *  the information from a 2nd measurement.
+ *  Input angle_m is the angle measured by the accelerometer.
+ *
+ *  y = z - H x
+ *
+ *  S = H P transpose(H) + R
+ *    = [ 1 0 ] P [ 1, 0 ] + R
+ *    = P(0,0) + R
+ *
+ *  K = P transpose(H) S^-1
+ *    = [ P(0,0), P(1,0) ] / S
+ *
+ *  x = x + K y
+ *
+ *  P = (I - K H) P
+ *
+ *    = ( [ 1 0,    [ K(0),
+ *          0 1 ] -   K(1) ] * [ 1 0 ] ) P
+ *
+ *    = [ P(0,0)-P(0,0)*K(0)  P(0,1)-P(0,1)*K(0),
+ *        P(1,0)-P(0,0)*K(1)  P(1,1)-P(0,1)*K(1) ]
+ */
+void AhrsKalman_impl::ars_update(ars_Gyro1DKalman *ars, const double angle_m) {
+    const double y = angle_m - ars->x_angle;
+
+    const double S = ars->P_00 + ars->R_angle;
+    const double K_0 = ars->P_00 / S;
+    const double K_1 = ars->P_10 / S;
+
+    ars->x_angle +=  K_0 * y;
+    ars->x_bias  +=  K_1 * y;
+
+    ars->P_00 -= K_0 * ars->P_00;
+    ars->P_01 -= K_0 * ars->P_01;
+    ars->P_10 -= K_1 * ars->P_00;
+    ars->P_11 -= K_1 * ars->P_01;
+}
Index: tags/latest/lib/FlairFilter/src/Ahrs_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/Ahrs_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Ahrs_impl.cpp	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/14
+//  filename:   Ahrs_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for Ahrs_impl
+//
+//
+/*********************************************************************/
+
+#include "Ahrs_impl.h"
+#include "Ahrs.h"
+#include <Imu.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <DataPlot1D.h>
+#include <AhrsData.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::sensor;
+
+Ahrs_impl::Ahrs_impl(Ahrs *inSelf) : self(inSelf) {
+  rollPlot = NULL;
+  pitchPlot = NULL;
+  yawPlot = NULL;
+  wXPlot = NULL;
+  wYPlot = NULL;
+  wZPlot = NULL;
+  q0Plot = NULL;
+  q1Plot = NULL;
+  q2Plot = NULL;
+  q3Plot = NULL;
+
+  eulerTab = NULL;
+  quaternionTab = NULL;
+
+  ahrsData = new AhrsData(self);
+}
+
+Ahrs_impl::~Ahrs_impl() {}
+
+void Ahrs_impl::UseDefaultPlot(void) {
+
+  eulerTab = new Tab(((Imu *)(self->Parent()))->tab, "AHRS");
+  rollPlot = new DataPlot1D(eulerTab->NewRow(), "roll", -30, 30);
+  rollPlot->AddCurve(ahrsData->Element(AhrsData::RollDeg));
+  pitchPlot = new DataPlot1D(eulerTab->LastRowLastCol(), "pitch", -30, 30);
+  pitchPlot->AddCurve(ahrsData->Element(AhrsData::PitchDeg));
+  yawPlot = new DataPlot1D(eulerTab->LastRowLastCol(), "yaw", -180, 180);
+  yawPlot->AddCurve(ahrsData->Element(AhrsData::YawDeg));
+
+  wXPlot = new DataPlot1D(eulerTab->NewRow(), "w_x", -200, 200);
+  wXPlot->AddCurve(ahrsData->Element(AhrsData::WxDeg));
+  wYPlot = new DataPlot1D(eulerTab->LastRowLastCol(), "w_y", -200, 200);
+  wYPlot->AddCurve(ahrsData->Element(AhrsData::WyDeg));
+  wZPlot = new DataPlot1D(eulerTab->LastRowLastCol(), "w_z", -200, 200);
+  wZPlot->AddCurve(ahrsData->Element(AhrsData::WzDeg));
+
+  quaternionTab = new Tab(((Imu *)(self->Parent()))->tab, "Quaternion");
+  q0Plot = new DataPlot1D(quaternionTab->NewRow(), "q0", -1, 1);
+  q0Plot->AddCurve(ahrsData->Element(AhrsData::Q0));
+  q1Plot = new DataPlot1D(quaternionTab->NewRow(), "q1", -1, 1);
+  q1Plot->AddCurve(ahrsData->Element(AhrsData::Q1));
+  q2Plot = new DataPlot1D(quaternionTab->LastRowLastCol(), "q2", -1, 1);
+  q2Plot->AddCurve(ahrsData->Element(AhrsData::Q2));
+  q3Plot = new DataPlot1D(quaternionTab->LastRowLastCol(), "q3", -1, 1);
+  q3Plot->AddCurve(ahrsData->Element(AhrsData::Q3));
+}
+
+void Ahrs_impl::AddPlot(const AhrsData *ahrsData, DataPlot::Color_t color) {
+  if (rollPlot != NULL) {
+    rollPlot->AddCurve(ahrsData->Element(AhrsData::RollDeg), color);
+    pitchPlot->AddCurve(ahrsData->Element(AhrsData::PitchDeg), color);
+    yawPlot->AddCurve(ahrsData->Element(AhrsData::YawDeg), color);
+  }
+  if (wXPlot != NULL) {
+    wXPlot->AddCurve(ahrsData->Element(AhrsData::WxDeg), color);
+    wYPlot->AddCurve(ahrsData->Element(AhrsData::WyDeg), color);
+    wZPlot->AddCurve(ahrsData->Element(AhrsData::WzDeg), color);
+  }
+  if (quaternionTab != NULL) {
+    q0Plot->AddCurve(ahrsData->Element(AhrsData::Q0), color);
+    q1Plot->AddCurve(ahrsData->Element(AhrsData::Q1), color);
+    q2Plot->AddCurve(ahrsData->Element(AhrsData::Q2), color);
+    q3Plot->AddCurve(ahrsData->Element(AhrsData::Q3), color);
+  }
+}
Index: tags/latest/lib/FlairFilter/src/ButterworthLowPass.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/12/10
+//  filename:   ButterworthLowPass.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a Butterworth low pass filter
+//
+//
+/*********************************************************************/
+
+#include "ButterworthLowPass.h"
+#include "ButterworthLowPass_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+ButterworthLowPass::ButterworthLowPass(const IODevice *parent,
+                                       const LayoutPosition *position,
+                                       string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
+    : IODevice(parent, name) {
+  pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
+  AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
+}
+
+ButterworthLowPass::ButterworthLowPass(const gui::LayoutPosition *position,
+                                       string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
+    : IODevice(position->getLayout(), name) {
+  pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
+  AddDataToLog(pimpl_->output);
+}
+
+ButterworthLowPass::~ButterworthLowPass() { delete pimpl_; }
+
+cvmatrix *ButterworthLowPass::Matrix(void) const { return pimpl_->output; }
+
+float ButterworthLowPass::Output(void) const {
+  return pimpl_->output->Value(0, 0);
+}
+
+void ButterworthLowPass::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(pimpl_->output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/ButterworthLowPass.h
===================================================================
--- tags/latest/lib/FlairFilter/src/ButterworthLowPass.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/ButterworthLowPass.h	(revision 209)
@@ -0,0 +1,109 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ButterworthLowPass.h
+ * \brief Class defining a Butterworth low pass filter
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/12/10
+ * \version 4.0
+ */
+
+#ifndef BUTTERWORTHLOWPASS_H
+#define BUTTERWORTHLOWPASS_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class ButterworthLowPass_impl;
+
+namespace flair {
+namespace filter {
+/*! \class ButterworthLowPass
+*
+* \brief Class defining a Butterworth low pass filter
+*/
+class ButterworthLowPass : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a ButterworthLowPass at position. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  * The filter is automatically updated when parent's
+  * IODevice::ProcessUpdate is called.
+  *
+  * \param parent parent
+  * \param position position to display settings
+  * \param name name
+  * \param order order of the filter
+  * \param nbRow number of rows of input/output
+  * \param nbCol number of cols of input/output
+  */
+  ButterworthLowPass(const IODevice *parent,
+                     const gui::LayoutPosition *position, std::string name,
+                     uint32_t order,uint32_t nbRow=1,uint32_t nbCol=1);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a ButterworthLowPass at position. \n
+  * The ButterworthLowPass will automatically be child of position->getLayout()
+  *Layout. After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  * The filter is updated manually with UpdateFrom method. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  * \param order order of the filter
+  * \param nbRow number of rows of input/output
+  * \param nbCol number of cols of input/output
+  */
+  ButterworthLowPass(const gui::LayoutPosition *position, std::string name,
+                     uint32_t order,uint32_t nbRow,uint32_t nbCol);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ButterworthLowPass();
+
+  /*!
+  * \brief Output value
+  *
+  * \return filtered output
+  */
+  float Output(void) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * \return filtered output
+  */
+  core::cvmatrix *Matrix(void) const;
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+private:
+  class ButterworthLowPass_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // BUTTERWORTHLOWPASS_H
Index: tags/latest/lib/FlairFilter/src/ButterworthLowPass_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/ButterworthLowPass_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/ButterworthLowPass_impl.cpp	(revision 209)
@@ -0,0 +1,135 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/12/10
+//  filename:   ButterworthLowPass_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet permettant le calcul d'un filtre passe bas de Butterworth
+//
+//
+/*********************************************************************/
+
+#include "ButterworthLowPass_impl.h"
+#include "ButterworthLowPass.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+ButterworthLowPass_impl::ButterworthLowPass_impl(ButterworthLowPass *self,
+                                                 const LayoutPosition *position,
+                                                 string name, uint32_t order,uint32_t nbRow,uint32_t nbCol) {
+  // init UI
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto", " s",
+                        0, 10, 0.01);
+  cutoff = new DoubleSpinBox(reglages_groupbox->NewRow(), "cutoff frequency",
+                             " Hz", 0, 10000, 0.1, 2, 1);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(nbRow, nbCol);
+  //desc->SetElementName(0, 0, "output");
+  output = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+
+  f=(PoleFilter**)malloc(sizeof(PoleFilter*)*nbRow*nbCol);
+  
+  for(uint32_t i=0;i<nbRow;i++) {
+    for(uint32_t j=0;j<nbCol;j++) {
+      f[i*nbCol+j] = new PoleFilter(order);
+      if (T->Value() != 0) {
+        f[i*nbCol+j]->setup(1. / T->Value(), cutoff->Value());
+      }
+      f[i*nbCol+j]->reset();
+    }
+  }
+
+  first_update = true;
+  this->order=order;
+  this->nbRow=nbRow;
+  this->nbCol=nbCol;
+}
+
+ButterworthLowPass_impl::~ButterworthLowPass_impl() { 
+  for(uint32_t i=0;i<nbRow;i++) {
+    for(uint32_t j=0;j<nbCol;j++) {
+     delete f[i*nbCol+j];
+    }
+  }
+  free(f);
+}
+
+void ButterworthLowPass_impl::UpdateFrom(const io_data *data) {
+  cvmatrix *input = (cvmatrix *)data;
+  float delta_t;
+  
+  if (T->ValueChanged() && T->Value() != 0) {
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / T->Value(), cutoff->Value());
+        //settingsChanged(f[i*nbCol+j],input->Value(i, j));
+      }
+    }
+  }
+
+  if (T->Value() == 0) {
+    delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / delta_t, cutoff->Value());
+      }
+    }
+  } else {
+    delta_t=T->Value();
+  }
+  
+  // on prend une fois pour toute les mutex et on fait des accès directs
+  output->GetMutex();
+  input->GetMutex();
+
+  if (cutoff->ValueChanged()) {
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / delta_t, cutoff->Value());
+        //settingsChanged(f[i*nbCol+j],input->ValueNoMutex(i, j));
+      }
+    }
+  }
+
+  if (first_update == true) {
+    first_update = false;
+  } else {
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        float result = f[i*nbCol+j]->filter(input->ValueNoMutex(i, j));
+        output->SetValueNoMutex(i, j, result);
+      }
+    }
+  }
+
+  input->ReleaseMutex();
+  output->ReleaseMutex();
+
+  output->SetDataTime(data->DataTime());
+  previous_time = data->DataTime();
+}
+
+//ne gere pas les oscillations (s'arrete des qu'une valeure est bonne a 5%)
+void ButterworthLowPass_impl::settingsChanged(PoleFilter*f,float inputValue) {
+  float result=f->filter(inputValue);
+  
+  while(result<inputValue*0.95 || result>inputValue*1.05) {
+      result=f->filter(inputValue);
+  }
+}
Index: tags/latest/lib/FlairFilter/src/ControlLaw.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/ControlLaw.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/ControlLaw.cpp	(revision 209)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/30
+//  filename:   ControlLaw.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for control law
+//
+//
+/*********************************************************************/
+
+#include "ControlLaw.h"
+#include <cvmatrix.h>
+#include <cvmatrix_descriptor.h>
+#include <DataPlot1D.h>
+#include <sstream>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+ControlLaw::ControlLaw(const Object *parent, string name, uint32_t nb_out)
+    : IODevice(parent, name) {
+  if (nb_out == 1) {
+    output = new cvmatrix(this, nb_out, 1, floatType, name);
+  } else {
+    cvmatrix_descriptor *desc = new cvmatrix_descriptor(nb_out, 1);
+    for (int i = 0; i < nb_out; i++) {
+      std::stringstream ss;
+      ss << i;
+      desc->SetElementName(i, 0, ss.str());
+    }
+    output = new cvmatrix(this, desc, floatType, name);
+    delete desc;
+  }
+
+  input = NULL;
+  AddDataToLog(output);
+}
+
+ControlLaw::~ControlLaw(void) {}
+
+void ControlLaw::Update(Time time) {
+  input->SetDataTime(time);
+  UpdateFrom(input);
+}
+
+float ControlLaw::Output(uint32_t index) const {
+  return output->Value(index, 0);
+}
+
+void ControlLaw::UseDefaultPlot(const LayoutPosition *position) {
+  if (output->Rows() != 1)
+    Warn("Output size is different from 1. Plotting only Output(1,1).\n");
+
+  DataPlot1D *plot = new DataPlot1D(position, ObjectName(), -1, 1);
+  plot->AddCurve(output->Element(0));
+}
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/ControlLaw.h
===================================================================
--- tags/latest/lib/FlairFilter/src/ControlLaw.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/ControlLaw.h	(revision 209)
@@ -0,0 +1,125 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ControlLaw.h
+ * \brief Base class for control law
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/30
+ * \version 4.0
+ */
+
+#ifndef CONTROLLAW_H
+#define CONTROLLAW_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+}
+namespace core {
+class cvmatrix;
+}
+}
+
+namespace flair {
+namespace filter {
+/*! \class ControlLaw
+*
+* \brief Base class for control law
+* input must be created by reimplemented class.\n
+* output is created by this class, it is of size (nb_out,1) and type float.\n
+* see constructor for nb_out
+*/
+class ControlLaw : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a ControlLaw
+  *
+  * \param parent parent
+  * \param name name
+  * \param nb_out number of output
+  */
+  ControlLaw(const core::Object *parent, std::string name, uint32_t nb_out = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ControlLaw();
+
+  /*!
+  * \brief Output value
+  *
+  * \param index output index, between 0 and nb_out-1
+  *
+  * \return output value
+  */
+  float Output(uint32_t index = 0) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  * Plot the output value at given position. \n
+  * Only Output(1,1) is plotted. \n
+  * In case of a mutliple output ControlLaw, this function should be
+  *reimplemented. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  *
+  * \param position position to display plot
+  */
+  virtual void UseDefaultPlot(const gui::LayoutPosition *position);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented class must fill input matrix before calling this.
+  *
+  * \param time time of the update
+  */
+  void Update(core::Time time);
+
+  /*!
+  * \brief Reset the internal state of the control law
+  *
+  * Doesn't do anything by default
+  *
+  */
+  virtual void Reset(){};
+
+protected:
+  /*!
+  * \brief input matrix
+  *
+  * This matrix must be created by the reimplemented class.
+  *
+  */
+  core::cvmatrix *input;
+
+  /*!
+  * \brief output matrix
+  *
+  * This matrix is created by this class. Its size is (nb_out,1) and its type
+  * is io_data::Float.
+  *
+  */
+  core::cvmatrix *output;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  virtual void UpdateFrom(const core::io_data *data) = 0;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // CONTROLLAW_H
Index: tags/latest/lib/FlairFilter/src/EulerDerivative.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/EulerDerivative.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/EulerDerivative.cpp	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   EulerDerivative.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an euler derivative
+//
+//
+/*********************************************************************/
+
+#include "EulerDerivative.h"
+#include "EulerDerivative_impl.h"
+#include <cvmatrix.h>
+#include <LayoutPosition.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+EulerDerivative::EulerDerivative(const IODevice *parent,
+                                 const LayoutPosition *position, string name,
+                                 const cvmatrix *init_value)
+    : IODevice(parent, name) {
+  pimpl_ = new EulerDerivative_impl(this, position, name, init_value);
+  AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
+}
+
+EulerDerivative::~EulerDerivative() { delete pimpl_; }
+
+cvmatrix *EulerDerivative::Matrix(void) const { return pimpl_->output; }
+
+float EulerDerivative::Output(int row, int col) const {
+  return pimpl_->output->Value(row, col);
+}
+
+void EulerDerivative::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(pimpl_->output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/EulerDerivative.h
===================================================================
--- tags/latest/lib/FlairFilter/src/EulerDerivative.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/EulerDerivative.h	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file EulerDerivative.h
+ * \brief Class defining an euler derivative
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef EULERDERIVATIVE_H
+#define EULERDERIVATIVE_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class EulerDerivative_impl;
+
+namespace flair {
+namespace filter {
+/*! \class EulerDerivative
+*
+* \brief Class defining an euler derivative
+*/
+
+class EulerDerivative : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an EulerDerivative at given position. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  * The filter is automatically updated when parent's
+  * IODevice::ProcessUpdate is called. \n
+  * The optional init_value parameters allow to specify
+  * the size of the input datas and output inital values.
+  * If unspecified, a 1*1 size is used, and values are
+  * initialized with 0.
+  *
+  * \param parent parent
+  * \param position position to display settings
+  * \param name name
+  * \param init_value initial value, it is safe to destroy it after calling this constructor
+  */
+  EulerDerivative(const core::IODevice *parent,
+                  const gui::LayoutPosition *position, std::string name,
+                  const core::cvmatrix *init_value = NULL);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~EulerDerivative();
+
+  /*!
+  * \brief Output value
+  *
+  * \param row row element
+  * \param col column element
+  *
+  * \return element value
+  */
+  float Output(int row, int col) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * \return filtered output
+  */
+  core::cvmatrix *Matrix(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  class EulerDerivative_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // EULERDERIVATIVE_H
Index: tags/latest/lib/FlairFilter/src/EulerDerivative_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/EulerDerivative_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/EulerDerivative_impl.cpp	(revision 209)
@@ -0,0 +1,110 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   EulerDerivative.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet permettant le calcul d'une derivee d'Euler
+//
+//
+/*********************************************************************/
+
+#include "EulerDerivative.h"
+#include "EulerDerivative_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+EulerDerivative_impl::EulerDerivative_impl(EulerDerivative *self,
+                                           const LayoutPosition *position,
+                                           string name,
+                                           const cvmatrix *init_value) {
+  first_update = true;
+  
+  if (init_value != NULL) {
+    // init output matrix of same size as init
+    cvmatrix_descriptor *desc =new cvmatrix_descriptor(init_value->Rows(), init_value->Cols());
+
+    for (int i = 0; i < init_value->Rows(); i++) {
+      for (int j = 0; j < init_value->Cols(); j++) {
+        desc->SetElementName(i, j, init_value->Name(i, j));
+      }
+    }
+    output = new cvmatrix(self, desc,init_value->GetDataType().GetElementDataType(), name);
+    delete desc;
+    for (int i = 0; i < init_value->Rows(); i++) {
+      for (int j = 0; j < init_value->Cols(); j++) {
+        output->SetValue(i, j, init_value->Value(i,j));
+      }
+    }
+  } else {
+    // if NULL, assume dimension 1, and init=0
+    cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+    desc->SetElementName(0, 0, "output");
+    output = new cvmatrix(self, desc, floatType, name);
+    delete desc;
+  }
+  
+ 
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(output->Rows(), output->Cols());
+  prev_value = new cvmatrix(self, desc, output->GetDataType().GetElementDataType(), name);
+
+
+  // init UI
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto:",
+                        " s", 0, 1, 0.01);
+}
+
+EulerDerivative_impl::~EulerDerivative_impl() {}
+
+void EulerDerivative_impl::UpdateFrom(const io_data *data) {
+  float delta_t;
+  cvmatrix *input = (cvmatrix *)data;
+
+  // on prend une fois pour toute les mutex et on fait des accès directs
+  output->GetMutex();
+  input->GetMutex();
+
+  if (first_update == true) {
+    for (int i = 0; i < input->Rows(); i++) {
+      for (int j = 0; j < input->Cols(); j++) {
+        prev_value->SetValueNoMutex(i, j, input->ValueNoMutex(i, j));
+      }
+    }
+    first_update = false;
+  } else {
+    if (T->Value() == 0) {
+      delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+    } else {
+      delta_t = T->Value();
+    }
+
+    for (int i = 0; i < input->Rows(); i++) {
+      for (int j = 0; j < input->Cols(); j++) {
+        output->SetValueNoMutex(
+            i, j, (input->ValueNoMutex(i, j) - prev_value->ValueNoMutex(i, j)) /
+                      delta_t);
+        prev_value->SetValueNoMutex(i, j, input->ValueNoMutex(i, j));
+      }
+    }
+  }
+
+  input->ReleaseMutex();
+  output->ReleaseMutex();
+
+  output->SetDataTime(data->DataTime());
+  previous_time = data->DataTime();
+}
Index: tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/01/16
+//  filename:   Gx3_25_ahrs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class for 3dmgx3-25 ahrs
+//
+//
+/*********************************************************************/
+
+#include "Gx3_25_ahrs.h"
+#include <AhrsData.h>
+#include <OneAxisRotation.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+
+namespace flair {
+namespace filter {
+
+Gx3_25_ahrs::Gx3_25_ahrs(string name,
+                         SerialPort *serialport, Gx3_25_imu::Command_t command,
+                         uint8_t priority)
+    : Ahrs(new Gx3_25_imu( "imu", serialport, command, priority), name) {
+
+  SetIsReady(true);
+}
+
+Gx3_25_ahrs::~Gx3_25_ahrs() {}
+
+// datas outputed from Gx3_25_imu are AhrsData!
+void Gx3_25_ahrs::UpdateFrom(const io_data *data) {
+  AhrsData *input = (AhrsData *)data;
+  AhrsData *output;
+  GetDatas(&output);
+
+  Quaternion quaternion;
+  Vector3Df filteredAngRates;
+  input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
+  output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
+  output->SetDataTime(input->DataTime());
+
+  ProcessUpdate(output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.h
===================================================================
--- tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Gx3_25_ahrs.h	(revision 209)
@@ -0,0 +1,61 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Gx3_25_ahrs.h
+ * \brief Class for 3dmgx3-25 ahrs
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/01/16
+ * \version 4.0
+ */
+
+#ifndef GX3_25_AHRS_H
+#define GX3_25_AHRS_H
+
+#include <Ahrs.h>
+#include <Gx3_25_imu.h>
+
+namespace flair {
+namespace filter {
+/*! \class Gx3_25_ahrs
+*
+* \brief Class for 3dmgx3-25 ahrs
+*
+* This class constructs a Gx3_25_imu as Imu of this Ahrs.
+*/
+class Gx3_25_ahrs : public Ahrs {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Ahrs for 3dmgx3-25. It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param serialport Imu SerialPort
+  * \param command command for the Gx3_25_imu continuous mode
+  * \param priority priority of the Gx3_25_imu Thread
+  */
+  Gx3_25_ahrs(std::string name,
+              core::SerialPort *serialport,
+              sensor::Gx3_25_imu::Command_t command, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Gx3_25_ahrs();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+};
+} // end namespace filter
+} // end namespace flair
+#endif // GX3_25_AHRS_H
Index: tags/latest/lib/FlairFilter/src/JoyReference.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/JoyReference.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/JoyReference.cpp	(revision 209)
@@ -0,0 +1,95 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/29
+//  filename:   JoyReference.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    generation de consignes a partir joystick
+//
+//
+/*********************************************************************/
+
+#include "JoyReference.h"
+#include "JoyReference_impl.h"
+#include <Layout.h>
+#include <LayoutPosition.h>
+#include <cvmatrix.h>
+#include <AhrsData.h>
+#include <Euler.h>
+#include <Quaternion.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+JoyReference::JoyReference(const LayoutPosition *position, string name)
+    : IODevice(position->getLayout(), name) {
+  pimpl_ = new JoyReference_impl(this, position, name);
+  AddDataToLog(pimpl_->output);
+  AddDataToLog(pimpl_->ahrsData);
+  
+  SetIsReady(true);
+}
+
+JoyReference::~JoyReference(void) { delete pimpl_; }
+
+AhrsData *JoyReference::GetReferenceOrientation(void) const {
+  return pimpl_->ahrsData;
+}
+
+void JoyReference::SetRollAxis(float value) { pimpl_->SetRollAxis(value); }
+
+void JoyReference::SetPitchAxis(float value) { pimpl_->SetPitchAxis(value); }
+
+void JoyReference::SetYawAxis(float value) { pimpl_->SetYawAxis(value); }
+
+void JoyReference::SetAltitudeAxis(float value) {
+  pimpl_->SetAltitudeAxis(value);
+}
+
+void JoyReference::RollTrimUp(void) { pimpl_->RollTrimUp(); }
+
+void JoyReference::RollTrimDown(void) { pimpl_->RollTrimDown(); }
+
+void JoyReference::PitchTrimUp(void) { pimpl_->PitchTrimUp(); }
+
+void JoyReference::PitchTrimDown(void) { pimpl_->PitchTrimDown(); }
+
+void JoyReference::SetYawRef(float value) { pimpl_->SetYawRef(value); }
+
+void JoyReference::SetYawRef(core::Quaternion const &value) {
+  Euler euler;
+  value.ToEuler(euler);
+  pimpl_->SetYawRef(euler.yaw);
+}
+void JoyReference::SetZRef(float value) { pimpl_->SetZRef(value); }
+
+float JoyReference::ZRef(void) const { return pimpl_->ZRef(); }
+
+float JoyReference::DzRef(void) const { return pimpl_->dZRef(); }
+
+float JoyReference::RollTrim(void) const { return pimpl_->RollTrim(); }
+
+float JoyReference::PitchTrim(void) const { return pimpl_->PitchTrim(); }
+
+void JoyReference::Update(Time time) {
+  pimpl_->Update(time);
+  ProcessUpdate(pimpl_->output);
+}
+
+void JoyReference::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(pimpl_->output);
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/JoyReference.h
===================================================================
--- tags/latest/lib/FlairFilter/src/JoyReference.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/JoyReference.h	(revision 209)
@@ -0,0 +1,208 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file JoyReference.h
+ * \brief Class creating references from a joystick
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/08/29
+ * \version 4.0
+ */
+
+#ifndef JOYREFERENCE_H
+#define JOYREFERENCE_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class Quaternion;
+class AhrsData;
+}
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class JoyReference_impl;
+
+namespace flair {
+namespace filter {
+/*! \class JoyReference
+*
+* \brief Class creating references from a joystick
+*/
+class JoyReference : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a JoyReference at given position. \n
+  * The JoyReference will automatically be child of position->getLayout()
+  *Layout. After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  * JoyReference compute reference in quaternion, wz, altitude and altitude
+  *speed.
+  *
+  * \param position position
+  * \param name name
+  */
+  JoyReference(const gui::LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~JoyReference();
+
+  /*!
+  * \brief Set roll axis value
+  *
+  * \param value value
+  */
+  void SetRollAxis(float value);
+
+  /*!
+  * \brief Set pitch axis value
+  *
+  * \param value value
+  */
+  void SetPitchAxis(float value);
+
+  /*!
+  * \brief Set yaw axis value
+  *
+  * \param value value
+  */
+  void SetYawAxis(float value);
+
+  /*!
+  * \brief Set thrust axis value
+  *
+  * \param value value
+  */
+  void SetAltitudeAxis(float value);
+
+  /*!
+  * \brief Get orientation reference
+  *
+  * \return reference
+  */
+  core::AhrsData *GetReferenceOrientation(void) const;
+
+  /*!
+  * \brief Get z reference
+  *
+  * \return reference
+  */
+  float ZRef(void) const;
+
+  /*!
+  * \brief Get z derivative reference
+  *
+  * \return reference
+  */
+  float DzRef(void) const;
+
+  /*!
+  * \brief Get roll trim
+  *
+  * \return trim value
+  */
+  float RollTrim(void) const;
+
+  /*!
+  * \brief Get pitch trim
+  *
+  * \return trim value
+  */
+  float PitchTrim(void) const;
+
+  /*!
+  * \brief Set yaw reference
+  *
+  * Yaw part of the output quaternion is obtained by integrating the wz desired
+  *angular speed.\n
+  * This method reset the yaw.
+  *
+  * \param value value
+  */
+  void SetYawRef(float value);
+
+  /*!
+  * \brief Set yaw reference
+  *
+  * Yaw part of the output quaternion is obtained by integrating the wz desired
+  *angular speed.\n
+  * This method reset the yaw.
+  *
+  * \param value value, only the yaw part of the quaternion is used
+  */
+  void SetYawRef(core::Quaternion const &value);
+
+  /*!
+  * \brief Set z reference
+  *
+  * Altitude of the output is obtained by integrating the vz desired altitude
+  *speed.\n
+  * This method reset z.
+  *
+  * \param value value
+  */
+  void SetZRef(float value);
+
+  /*!
+  * \brief Trim up roll
+  *
+  * Roll trim value is increased by one
+  */
+  void RollTrimUp(void);
+
+  /*!
+  * \brief Trim down roll
+  *
+  * Roll trim value is decreased by one
+  */
+  void RollTrimDown(void);
+
+  /*!
+  * \brief Trim up pitch
+  *
+  * Pitch trim value is increased by one
+  */
+  void PitchTrimUp(void);
+
+  /*!
+  * \brief Trim down pitch
+  *
+  * Pitch trim value is decreased by one
+  */
+  void PitchTrimDown(void);
+
+  /*!
+  * \brief Update references
+  *
+  * Calls UpdateFrom with values entered manually.
+  *
+  * \param time time
+  */
+  void Update(core::Time time);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  class JoyReference_impl *pimpl_;
+};
+} // end namespace sensor
+} // end namespace flair
+
+#endif // JOYREFERENCE_H
Index: tags/latest/lib/FlairFilter/src/JoyReference_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/JoyReference_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/JoyReference_impl.cpp	(revision 209)
@@ -0,0 +1,203 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/29
+//  filename:   JoyReference_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    generation de consignes a partir joystick
+//
+//
+/*********************************************************************/
+
+#include "JoyReference_impl.h"
+#include "JoyReference.h"
+#include <AhrsData.h>
+#include <Euler.h>
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <SpinBox.h>
+#include <Label.h>
+#include <PushButton.h>
+#include <math.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+JoyReference_impl::JoyReference_impl(JoyReference *inSelf,
+                                     const LayoutPosition *position,
+                                     string name)
+    : self(inSelf) {
+
+  ahrsData = new AhrsData(self);
+  input = new cvmatrix(self, 4, 1, floatType, name);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(4, 1);
+  desc->SetElementName(0, 0, "z");
+  ;
+  desc->SetElementName(1, 0, "dz");
+  desc->SetElementName(2, 0, "trim_roll");
+  desc->SetElementName(3, 0, "trim_pitch");
+  output = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+
+  reglages_groupbox = new GroupBox(position, name);
+  deb_roll = new DoubleSpinBox(reglages_groupbox->NewRow(), "debattement roll",
+                               " deg", -45, 45, 1, 0);
+  deb_pitch = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                                "debattement pitch", " deg", -45, 45, 1, 0);
+  deb_wz = new DoubleSpinBox(reglages_groupbox->NewRow(), "debattement wz",
+                             " deg/s", -180, 180, 1, 0);
+  deb_dz = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                             "debattement dz", " m/s", -2, 2, 0.1, 1);
+  trim = new DoubleSpinBox(reglages_groupbox->NewRow(), "trim", -1, 1, 0.01);
+  label_roll = new Label(reglages_groupbox->NewRow(), "trim roll");
+  button_roll =
+      new PushButton(reglages_groupbox->LastRowLastCol(), "reset roll trim");
+  label_pitch = new Label(reglages_groupbox->NewRow(), "trim pitch");
+  button_pitch =
+      new PushButton(reglages_groupbox->LastRowLastCol(), "reset pitch trim");
+
+  z_ref = 0;
+  previous_time = 0;
+  trim_roll = 0;
+  trim_pitch = 0;
+
+  label_roll->SetText("trim roll: %.2f", trim_roll);
+  label_pitch->SetText("trim pitch: %.2f", trim_pitch);
+}
+
+JoyReference_impl::~JoyReference_impl(void) {}
+
+void JoyReference_impl::SetRollAxis(float value) {
+  input->SetValue(0, 0, value);
+}
+
+void JoyReference_impl::SetPitchAxis(float value) {
+  input->SetValue(1, 0, value);
+}
+
+void JoyReference_impl::SetYawAxis(float value) {
+  input->SetValue(2, 0, value);
+}
+
+void JoyReference_impl::SetAltitudeAxis(float value) {
+  input->SetValue(3, 0, value);
+}
+
+void JoyReference_impl::RollTrimUp(void) {
+  trim_roll += trim->Value();
+  output->SetValue(2, 0, trim_roll);
+  label_roll->SetText("trim roll: %.2f", trim_roll);
+}
+
+void JoyReference_impl::RollTrimDown(void) {
+  trim_roll -= trim->Value();
+  output->SetValue(2, 0, trim_roll);
+  label_roll->SetText("trim roll: %.2f", trim_roll);
+}
+
+void JoyReference_impl::PitchTrimUp(void) {
+  trim_pitch += trim->Value();
+  output->SetValue(3, 0, trim_pitch);
+  label_pitch->SetText("trim pitch: %.2f", trim_pitch);
+}
+
+void JoyReference_impl::PitchTrimDown(void) {
+  trim_pitch -= trim->Value();
+  output->SetValue(3, 0, trim_pitch);
+  label_pitch->SetText("trim pitch: %.2f", trim_pitch);
+}
+
+void JoyReference_impl::SetYawRef(float value) {
+  Euler ref(0, 0, value);
+  input->GetMutex();
+  ref.ToQuaternion(q_z);
+  input->ReleaseMutex();
+
+  Update(GetTime());
+}
+
+void JoyReference_impl::SetZRef(float value) {
+  z_ref = value;
+  output->SetValue(0, 0, z_ref);
+}
+
+float JoyReference_impl::ZRef(void) const { return output->Value(0, 0); }
+
+float JoyReference_impl::dZRef(void) const { return output->Value(1, 0); }
+
+float JoyReference_impl::RollTrim(void) const { return trim_roll; }
+
+float JoyReference_impl::PitchTrim(void) const { return trim_pitch; }
+
+void JoyReference_impl::Update(Time time) {
+  input->SetDataTime(time);
+  UpdateFrom(input);
+}
+
+void JoyReference_impl::UpdateFrom(const io_data *data) {
+  cvmatrix *input = (cvmatrix *)data;
+
+  if (previous_time == 0)
+    previous_time = data->DataTime(); // pour la premiere iteration
+  float delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+  previous_time = data->DataTime();
+
+  if (button_roll->Clicked() == true) {
+    trim_roll = 0;
+    output->SetValue(2, 0, 0);
+    label_roll->SetText("trim roll: %.2f", trim_roll);
+  }
+  if (button_pitch->Clicked() == true) {
+    trim_pitch = 0;
+    output->SetValue(3, 0, 0);
+    label_pitch->SetText("trim pitch: %.2f", trim_pitch);
+  }
+
+  // les box sont en degrés
+  input->GetMutex();
+
+  Vector3Df theta_xy(
+      -Euler::ToRadian(input->ValueNoMutex(0, 0) * deb_roll->Value()),
+      -Euler::ToRadian(input->ValueNoMutex(1, 0) * deb_pitch->Value()), 0);
+  Vector3Df e_bar = theta_xy;
+  e_bar.Normalize();
+  Quaternion q_xy(cos(theta_xy.GetNorm() / 2.0f),
+                  e_bar.x * sin(theta_xy.GetNorm() / 2.0f),
+                  e_bar.y * sin(theta_xy.GetNorm() / 2.0f), 0);
+  q_xy.Normalize();
+
+  float wz_ref = Euler::ToRadian(input->ValueNoMutex(2, 0) * deb_wz->Value());
+  Quaternion w_zd(1, 0, 0, wz_ref * delta_t / 2);
+  w_zd.Normalize();
+  q_z = q_z * w_zd;
+  q_z.Normalize();
+
+  Quaternion q_ref = q_z * q_xy;
+  q_ref.Normalize();
+
+  z_ref += input->ValueNoMutex(3, 0) * deb_dz->Value() * delta_t;
+  float dz_ref = input->ValueNoMutex(3, 0) * deb_dz->Value();
+
+  input->ReleaseMutex();
+
+  ahrsData->SetQuaternionAndAngularRates(q_ref, Vector3Df(0, 0, wz_ref));
+
+  // ouput quaternion for control law
+  output->GetMutex();
+  output->SetValueNoMutex(0, 0, z_ref);
+  output->SetValueNoMutex(1, 0, dz_ref);
+  output->ReleaseMutex();
+
+  output->SetDataTime(data->DataTime());
+}
Index: tags/latest/lib/FlairFilter/src/LowPassFilter.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/LowPassFilter.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/LowPassFilter.cpp	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   LowPassFilter.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a first order low pass filter
+//
+//
+/*********************************************************************/
+
+#include "LowPassFilter.h"
+#include "LowPassFilter_impl.h"
+#include <cvmatrix.h>
+#include <LayoutPosition.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+LowPassFilter::LowPassFilter(const IODevice *parent,
+                             const LayoutPosition *position, string name,
+                             const cvmatrix *init_value)
+    : IODevice(parent, name) {
+  pimpl_ = new LowPassFilter_impl(this, position, name, init_value);
+  AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
+}
+
+LowPassFilter::~LowPassFilter() { delete pimpl_; }
+
+cvmatrix *LowPassFilter::Matrix(void) const { return pimpl_->output; }
+
+float LowPassFilter::Output(int row, int col) const {
+  return pimpl_->output->Value(row, col);
+}
+
+void LowPassFilter::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(pimpl_->output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/LowPassFilter.h
===================================================================
--- tags/latest/lib/FlairFilter/src/LowPassFilter.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/LowPassFilter.h	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file LowPassFilter.h
+ * \brief Class defining a first order low pass filter
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef LOWPASSFILTER_FILTER_H
+#define LOWPASSFILTER_FILTER_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class Layout;
+class LayoutPosition;
+}
+}
+
+class LowPassFilter_impl;
+
+namespace flair {
+namespace filter {
+/*! \class LowPassFilter
+*
+* \brief Class defining a first order low pass filter
+*/
+class LowPassFilter : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a LowPassFilter at position. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  * The filter is automatically updated when parent's
+  * IODevice::ProcessUpdate is called. \n
+  * The optional init_value parameters allow to specify
+  * the size of the input datas and its inital values.
+  * If unspecified, a 1*1 size is used, and values are
+  * initialized with 0.
+  *
+  * \param parent parent
+  * \param position position to display settings
+  * \param name name
+  * \param init_value initial value, it is safe to destroy it after calling this constructor
+  */
+  LowPassFilter(const core::IODevice *parent,
+                const gui::LayoutPosition *position, std::string name,
+                const core::cvmatrix *init_value = NULL);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~LowPassFilter();
+
+  /*!
+  * \brief Output value
+  *
+  * \param row row element
+  * \param col column element
+  *
+  * \return element value
+  */
+  float Output(int row, int col) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * \return filtered output
+  */
+  core::cvmatrix *Matrix(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  class LowPassFilter_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // LOWPASSFILTER_FILTER_H
Index: tags/latest/lib/FlairFilter/src/LowPassFilter_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/LowPassFilter_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/LowPassFilter_impl.cpp	(revision 209)
@@ -0,0 +1,106 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   LowPassFilter_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet permettant le calcul d'un filtre passe bas
+//
+//
+/*********************************************************************/
+
+#include "LowPassFilter_impl.h"
+#include "LowPassFilter.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+
+#define PI ((float)3.14159265358979323846)
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+LowPassFilter_impl::LowPassFilter_impl(const LowPassFilter *self,
+                                       const LayoutPosition *position,
+                                       string name,
+                                       const cvmatrix *init_value) {
+
+  if (init_value != NULL) {
+    // init output matrix of same size as init
+    cvmatrix_descriptor *desc =new cvmatrix_descriptor(init_value->Rows(), init_value->Cols());
+
+    for (int i = 0; i < init_value->Rows(); i++) {
+      for (int j = 0; j < init_value->Cols(); j++) {
+        desc->SetElementName(i, j, init_value->Name(i, j));
+      }
+    }
+    output = new cvmatrix(self, desc,init_value->GetDataType().GetElementDataType(), name);
+    for (int i = 0; i < init_value->Rows(); i++) {
+      for (int j = 0; j < init_value->Cols(); j++) {
+        output->SetValue(i, j, init_value->Value(i,j));
+      }
+    }
+    delete desc;
+  } else {
+    // if NULL, assume dimension 1, and init=0
+    cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+    desc->SetElementName(0, 0, "output");
+    output = new cvmatrix(self, desc, floatType, name);
+    delete desc;
+  }
+
+  // init UI
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto", " s",
+                        0, 10, 0.01);
+  freq = new DoubleSpinBox(reglages_groupbox->NewRow(), "cutoff frequency",
+                           " Hz", 0, 10000, 0.1, 2, 1);
+                           
+  previous_time=GetTime();
+}
+
+LowPassFilter_impl::~LowPassFilter_impl() {}
+
+void LowPassFilter_impl::UpdateFrom(const io_data *data) {
+  float delta_t;
+  cvmatrix *input = (cvmatrix *)data;
+
+  // on prend une fois pour toute les mutex et on fait des accès directs
+  output->GetMutex();
+  input->GetMutex();
+
+  if (T->Value() == 0) {
+    delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+  } else {
+    delta_t = T->Value();
+  }
+  for (int i = 0; i < input->Rows(); i++) {
+    for (int j = 0; j < input->Cols(); j++) {
+      float cutoff=freq->Value();
+      if (cutoff == 0 || freq->ValueChanged()) {
+        output->SetValueNoMutex(i, j, input->ValueNoMutex(i, j));
+      } else {
+        output->SetValueNoMutex(i, j, (1 - 2 * PI * cutoff * delta_t) *
+                                              output->ValueNoMutex(i, j) +
+                                          2 * PI * cutoff * delta_t *
+                                              input->ValueNoMutex(i, j));
+      }
+    }
+  }
+ 
+  input->ReleaseMutex();
+  output->ReleaseMutex();
+
+  output->SetDataTime(data->DataTime());
+  previous_time = data->DataTime();
+}
Index: tags/latest/lib/FlairFilter/src/NestedSat.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/NestedSat.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/NestedSat.cpp	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/15
+//  filename:   NestedSat.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a PID with saturations
+//
+//
+/*********************************************************************/
+
+#include "NestedSat.h"
+#include "NestedSat_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+#include <Euler.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+NestedSat::NestedSat(const LayoutPosition *position, string name)
+    : ControlLaw(position->getLayout(), name) {
+  pimpl_ = new NestedSat_impl(this, position, name);
+  
+  SetIsReady(true);
+}
+
+NestedSat::~NestedSat(void) { delete pimpl_; }
+
+void NestedSat::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(output);
+}
+
+void NestedSat::SetValues(float p_ref, float p, float d) {
+  input->SetValue(0, 0, p_ref);
+  input->SetValue(1, 0, p);
+  input->SetValue(2, 0, d);
+}
+// TODO: add a combobox to choose between rad and deg
+void NestedSat::ConvertSatFromDegToRad(void) { pimpl_->k = Euler::ToRadian(1); }
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/NestedSat.h
===================================================================
--- tags/latest/lib/FlairFilter/src/NestedSat.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/NestedSat.h	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file NestedSat.h
+ * \brief  Class defining a PID with saturations
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/15
+ * \version 4.0
+ */
+
+#ifndef NESTEDSAT_H
+#define NESTEDSAT_H
+
+#include <ControlLaw.h>
+
+namespace flair {
+namespace gui {
+class Layout;
+class LayoutPosition;
+}
+}
+
+class NestedSat_impl;
+
+namespace flair {
+namespace filter {
+/*! \class NestedSat
+*
+* \brief  Class defining a PID with saturations
+*
+* The output of this control law is calculated
+* as follows: \n
+* p_ref=Sat(p_ref,k*sat_ref) \n
+* d_ref=Sat[(p_ref-p)*kp,k*sat_dref] \n
+* law=Sat[(d-d_ref)*kd,sat_u] \n
+* where p, p_ref and d are input values (see SetValues()), \n
+* where sat_ref, sat_dref and sat_u are settings availables on the ground
+*station, \n
+* where k is a conversion factor (see ConvertSatFromDegToRad()).
+*/
+class NestedSat : public ControlLaw {
+  friend class ::NestedSat_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a NestedSat at given place position. \n
+  * The NestedSat will automatically be child of position->getLayout() Layout.
+  *After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  */
+  NestedSat(const gui::LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~NestedSat();
+
+  /*!
+  * \brief Set input values
+  *
+  * \param p_ref proportional reference
+  * \param p proportional value
+  * \param d derivative value
+  */
+  void SetValues(float p_ref, float p, float d);
+
+  /*!
+  * \brief Convert saturation parameters in radians
+  *
+  * If this function is called, saturation parameters
+  * on the ground station will be interpreted as degrees. \n
+  * Thus, an internal conversion from degrees to radians will
+  * be done (k=PI/180).
+  */
+  void ConvertSatFromDegToRad(void);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  NestedSat_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // NESTEDSAT_H
Index: tags/latest/lib/FlairFilter/src/NestedSat_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/NestedSat_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/NestedSat_impl.cpp	(revision 209)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/15
+//  filename:   NestedSat_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet permettant le calcul d'un Pid avec saturations
+//
+//
+/*********************************************************************/
+
+#include "NestedSat_impl.h"
+#include "NestedSat.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+NestedSat_impl::NestedSat_impl(NestedSat *self, const LayoutPosition *position,
+                               string name) {
+  this->self = self;
+  k = 1;
+
+  // init matrix
+  self->input = new cvmatrix(self, 3, 1, floatType, name);
+
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  sat =
+      new DoubleSpinBox(reglages_groupbox->NewRow(), "sat ref:", 0, 9000000, 1);
+  kp = new DoubleSpinBox(reglages_groupbox->NewRow(), "kp:", 0, 9000000, 1);
+  dsat = new DoubleSpinBox(reglages_groupbox->NewRow(), "sat dref:", 0, 9000000,
+                           1);
+  kd = new DoubleSpinBox(reglages_groupbox->NewRow(), "kd:", 0, 9000000, 0.1);
+  usat = new DoubleSpinBox(reglages_groupbox->NewRow(), "sat u:", 0, 1, .1);
+}
+
+NestedSat_impl::~NestedSat_impl(void) {}
+
+void NestedSat_impl::UpdateFrom(const io_data *data) {
+  float cons, dcons, law;
+  cvmatrix *input = (cvmatrix *)data;
+
+  input->GetMutex();
+
+  cons = Sat(input->ValueNoMutex(0, 0), k * sat->Value());
+  dcons = (cons - input->ValueNoMutex(1, 0)) * kp->Value();
+  dcons = Sat(dcons, k * dsat->Value());
+  law = (input->ValueNoMutex(2, 0) - dcons) * kd->Value();
+  law = Sat(law, usat->Value());
+
+  input->ReleaseMutex();
+
+  self->output->SetValue(0, 0, law);
+  self->output->SetDataTime(data->DataTime());
+}
+
+float NestedSat_impl::Sat(float value, float borne) {
+  if (value < -borne)
+    return -borne;
+  if (value > borne)
+    return borne;
+  return value;
+}
Index: tags/latest/lib/FlairFilter/src/Pid.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/Pid.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Pid.cpp	(revision 209)
@@ -0,0 +1,60 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   Pid.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a PID
+//
+//
+/*********************************************************************/
+
+#include "Pid.h"
+#include "Pid_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+Pid::Pid(const LayoutPosition *position, string name)
+    : ControlLaw(position->getLayout(), name) {
+  pimpl_ = new Pid_impl(this, position, name);
+  
+  SetIsReady(true);
+}
+
+Pid::~Pid(void) { delete pimpl_; }
+
+void Pid::UseDefaultPlot(const gui::LayoutPosition *position) {
+  pimpl_->UseDefaultPlot(position);
+}
+
+void Pid::Reset(void) {
+  pimpl_->i = 0;
+  pimpl_->first_update = true;
+}
+
+void Pid::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(output);
+}
+
+void Pid::SetValues(float p, float d) {
+  input->SetValue(0, 0, p);
+  input->SetValue(1, 0, d);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/Pid.h
===================================================================
--- tags/latest/lib/FlairFilter/src/Pid.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Pid.h	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Pid.h
+ * \brief Class defining a PID
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef PID_H
+#define PID_H
+
+#include <ControlLaw.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class Pid_impl;
+
+namespace flair {
+namespace filter {
+/*! \class Pid
+*
+* \brief Class defining a PID
+*/
+class Pid : public ControlLaw {
+  friend class ::Pid_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a PID at given position. \n
+  * The PID will automatically be child of position->getLayout() Layout. After
+  *calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  */
+  Pid(const gui::LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Pid();
+
+  /*!
+  * \brief Reset integral
+  *
+  */
+  void Reset(void);
+
+  /*!
+  * \brief Set input values
+  *
+  * \param p proportional value
+  * \param d derivative value
+  */
+  void SetValues(float p, float d);
+
+  /*!
+  * \brief Use default plot
+  *
+  * Plot the output values at position. \n
+  * Plot consists of 4 curves: proportional part,
+  * derivative part, integral part and
+  * the sum of the three. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  *
+  * \param position position to display plot
+  */
+  void UseDefaultPlot(const gui::LayoutPosition *position);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  Pid_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // PID_H
Index: tags/latest/lib/FlairFilter/src/PidThrust.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/PidThrust.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/PidThrust.cpp	(revision 209)
@@ -0,0 +1,84 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/11/07
+//  filename:   PidThrust.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a PidThrust
+//
+//
+/*********************************************************************/
+
+#include "PidThrust.h"
+#include "PidThrust_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+#include <DoubleSpinBox.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+PidThrust::PidThrust(const LayoutPosition *position, string name)
+    : ControlLaw(position->getLayout(), name) {
+  pimpl_ = new PidThrust_impl(this, position, name);
+  
+  SetIsReady(true);
+}
+
+PidThrust::~PidThrust(void) { delete pimpl_; }
+
+void PidThrust::UseDefaultPlot(const flair::gui::LayoutPosition *position) {
+  pimpl_->UseDefaultPlot(position);
+}
+
+void PidThrust::ResetI(void) { pimpl_->i = 0; }
+
+float PidThrust::GetOffset(void) { return pimpl_->offset_g; }
+
+void PidThrust::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+  ProcessUpdate(output);
+}
+
+void PidThrust::SetValues(float p, float d) {
+  input->SetValue(0, 0, p);
+  input->SetValue(1, 0, d);
+}
+
+void PidThrust::SetDefaultOffset(void) { pimpl_->offset_g = pimpl_->offset->Value(); }
+
+void PidThrust::SetOffset(float value) { pimpl_->offset_g = value; }
+
+bool PidThrust::OffsetStepUp(void) {
+  pimpl_->offset_g += pimpl_->pas_offset->Value();
+  if (pimpl_->offset_g > 1) {
+    pimpl_->offset_g = 1;
+    return false;
+  } else {
+    return true;
+  }
+}
+
+bool PidThrust::OffsetStepDown(void) {
+  pimpl_->offset_g -= pimpl_->pas_offset->Value();
+  if (pimpl_->offset_g < pimpl_->offset->Value()) {
+    pimpl_->offset_g = pimpl_->offset->Value();
+    return false;
+  } else {
+    return true;
+  }
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/PidThrust.h
===================================================================
--- tags/latest/lib/FlairFilter/src/PidThrust.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/PidThrust.h	(revision 209)
@@ -0,0 +1,133 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file PidThrust.h
+ * \brief Class defining a Pid for Thrust
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/11/07
+ * \version 4.0
+ */
+
+#ifndef PIDTHRUST_H
+#define PIDTHRUST_H
+
+#include <ControlLaw.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class PidThrust_impl;
+
+namespace flair {
+namespace filter {
+/*! \class PidThrust
+*
+* \brief Class defining a Pid for Thrust.\n
+* This Pid as an extra offset for compensating gravity.
+*/
+class PidThrust : public ControlLaw {
+  friend class ::PidThrust_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a PidThrust at given position
+  * The PidThrust will automatically be child of position->getLayout() Layout.
+  *After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  */
+  PidThrust(const gui::LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~PidThrust();
+
+  /*!
+  * \brief Reset integral to 0
+  *
+  */
+  void ResetI(void);
+
+  /*!
+  * \brief Set offset to a specified value
+  *
+  * \param value desired value
+  */
+  void SetOffset(float value);
+  
+  /*!
+  * \brief Set offset to specified value in ground station
+  *
+  */
+  void SetDefaultOffset(void);
+
+  /*!
+  * \brief Get offset
+  *
+  * \return current offset
+  */
+  float GetOffset(void);
+
+  /*!
+  * \brief Step up the offset according to specified value in ground station
+  *
+  * \return false if offset is at its maximum (1) value, true otherwise
+  */
+  bool OffsetStepUp(void);
+
+  /*!
+  * \brief Step down the offset according to specified value in ground station
+  *
+  * \return false if offset is at its minimum (specified in ground station)
+  *value, true otherwise
+  */
+  bool OffsetStepDown(void);
+
+  /*!
+  * \brief Set input values
+  *
+  * \param p proportional value
+  * \param d derivative value
+  */
+  void SetValues(float p, float d);
+
+  /*!
+  * \brief Use default plot
+  *
+  * Plot the output values at position. \n
+  * Plot consists of 4 curves: proportional part,
+  * derivative part, integral part and
+  * the sum of the three. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  *
+  * \param position position to display plot
+  */
+  void UseDefaultPlot(const gui::LayoutPosition *position);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  PidThrust_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // PIDTHRUST_H
Index: tags/latest/lib/FlairFilter/src/PidThrust_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/PidThrust_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/PidThrust_impl.cpp	(revision 209)
@@ -0,0 +1,120 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/11/07
+//  filename:   PidThrust_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a PID
+//
+//
+/*********************************************************************/
+#include "PidThrust_impl.h"
+#include "PidThrust.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <DataPlot1D.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+PidThrust_impl::PidThrust_impl(PidThrust *self, const LayoutPosition *position,
+                               string name) {
+  i = 0;
+  offset_g = 0;
+  first_update = true;
+  this->self = self;
+
+  // init matrix
+  self->input = new cvmatrix(self, 2, 1, floatType, name);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(5, 1);
+  desc->SetElementName(0, 0, "p");
+  desc->SetElementName(1, 0, "i");
+  desc->SetElementName(2, 0, "d");
+  desc->SetElementName(3, 0, "p+i+d");
+  desc->SetElementName(4, 0, "p+i+d+offset");
+  state = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto", " s",
+                        0, 1, 0.01);
+  kp = new DoubleSpinBox(reglages_groupbox->NewRow(), "kp:", 0, 90000000, 0.01);
+  ki = new DoubleSpinBox(reglages_groupbox->NewRow(), "ki:", 0, 90000000, 0.01);
+  sati = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "sat i:", 0, 1,
+                           0.01);
+  kd = new DoubleSpinBox(reglages_groupbox->NewRow(), "kd:", 0, 90000000, 0.01);
+  offset = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "offset g:",
+                             0, 1, 0.01);
+  sat = new DoubleSpinBox(reglages_groupbox->NewRow(), "sat:", 0, 1, 0.1);
+  pas_offset = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                                 "offset step:", 0, 1, .0001, 4);
+}
+
+PidThrust_impl::~PidThrust_impl(void) {}
+
+void PidThrust_impl::UseDefaultPlot(const LayoutPosition *position) {
+  DataPlot1D *plot = new DataPlot1D(position, self->ObjectName(), -1, 1);
+  plot->AddCurve(state->Element(0));
+  plot->AddCurve(state->Element(1), DataPlot::Green);
+  plot->AddCurve(state->Element(2), DataPlot::Blue);
+  plot->AddCurve(state->Element(3), DataPlot::Black);
+  plot->AddCurve(state->Element(4), DataPlot::Yellow);
+}
+
+void PidThrust_impl::UpdateFrom(const io_data *data) {
+  float p, d, total;
+  float delta_t;
+  cvmatrix *input = (cvmatrix *)data;
+
+  if (T->Value() == 0) {
+    delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+  } else {
+    delta_t = T->Value();
+  }
+  if (first_update == true) {
+    delta_t = 0;
+    first_update = false;
+  }
+
+  input->GetMutex();
+  p = kp->Value() * input->ValueNoMutex(0, 0);
+  i += ki->Value() * input->ValueNoMutex(0, 0) * delta_t;
+  if (i > sati->Value())
+    i = sati->Value();
+  if (i < -sati->Value())
+    i = -sati->Value();
+  d = kd->Value() * input->ValueNoMutex(1, 0);
+  input->ReleaseMutex();
+
+  total = p + i + d;
+  if (total > sat->Value())
+    total = sat->Value();
+  if (total < -sat->Value())
+    total = -sat->Value();
+
+  state->GetMutex();
+  state->SetValueNoMutex(0, 0, p);
+  state->SetValueNoMutex(1, 0, i);
+  state->SetValueNoMutex(2, 0, d);
+  state->SetValueNoMutex(3, 0, total);
+  state->SetValueNoMutex(4, 0, total - offset_g * offset_g);
+  state->ReleaseMutex();
+
+  //-offset_g, car on met -u_z dans le multiplex
+  // a revoir!
+  self->output->SetValue(0, 0, total - offset_g * offset_g);
+  self->output->SetDataTime(data->DataTime());
+
+  previous_time = data->DataTime();
+}
Index: tags/latest/lib/FlairFilter/src/Pid_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/Pid_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/Pid_impl.cpp	(revision 209)
@@ -0,0 +1,112 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   Pid_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a PID
+//
+//
+/*********************************************************************/
+#include "Pid_impl.h"
+#include "Pid.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <DataPlot1D.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+Pid_impl::Pid_impl(Pid *self, const LayoutPosition *position, string name) {
+  i = 0;
+  first_update = true;
+  this->self = self;
+
+  // init matrix
+  self->input = new cvmatrix(self, 2, 1, floatType, name);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(4, 1);
+  desc->SetElementName(0, 0, "p");
+  desc->SetElementName(1, 0, "i");
+  desc->SetElementName(2, 0, "d");
+  desc->SetElementName(3, 0, "p+i+d");
+  state = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto", " s",
+                        0, 1, 0.01);
+  kp = new DoubleSpinBox(reglages_groupbox->NewRow(), "kp:", 0, 90000000, 0.01,
+                         3);
+  ki = new DoubleSpinBox(reglages_groupbox->NewRow(), "ki:", 0, 90000000, 0.01,
+                         3);
+  sati = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "sat i:", 0, 1,
+                           0.01);
+  kd = new DoubleSpinBox(reglages_groupbox->NewRow(), "kd:", 0, 90000000, 0.01,
+                         3);
+  sat = new DoubleSpinBox(reglages_groupbox->NewRow(), "sat:", 0, 1, 0.1);
+}
+
+Pid_impl::~Pid_impl(void) {}
+
+void Pid_impl::UseDefaultPlot(const LayoutPosition *position) {
+  DataPlot1D *plot = new DataPlot1D(position, self->ObjectName(), -1, 1);
+  plot->AddCurve(state->Element(0));
+  plot->AddCurve(state->Element(1), DataPlot::Green);
+  plot->AddCurve(state->Element(2), DataPlot::Blue);
+  plot->AddCurve(state->Element(3), DataPlot::Black);
+}
+
+void Pid_impl::UpdateFrom(const io_data *data) {
+  float p, d, total;
+  float delta_t;
+  cvmatrix *input = (cvmatrix *)data;
+
+  if (T->Value() == 0) {
+    delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
+  } else {
+    delta_t = T->Value();
+  }
+  if (first_update == true) {
+    delta_t = 0;
+    first_update = false;
+  }
+
+  input->GetMutex();
+  p = kp->Value() * input->ValueNoMutex(0, 0);
+  i += ki->Value() * input->ValueNoMutex(0, 0) * delta_t;
+  if (i > sati->Value())
+    i = sati->Value();
+  if (i < -sati->Value())
+    i = -sati->Value();
+  d = kd->Value() * input->ValueNoMutex(1, 0);
+  input->ReleaseMutex();
+
+  total = p + i + d;
+  if (total > sat->Value())
+    total = sat->Value();
+  if (total < -sat->Value())
+    total = -sat->Value();
+
+  state->GetMutex();
+  state->SetValueNoMutex(0, 0, p);
+  state->SetValueNoMutex(1, 0, i);
+  state->SetValueNoMutex(2, 0, d);
+  state->SetValueNoMutex(3, 0, total);
+  state->ReleaseMutex();
+
+  self->output->SetValue(0, 0, total);
+  self->output->SetDataTime(data->DataTime());
+
+  previous_time = data->DataTime();
+}
Index: tags/latest/lib/FlairFilter/src/SimuAhrs.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/SimuAhrs.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/SimuAhrs.cpp	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuAhrs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation ahrs
+//
+//
+/*********************************************************************/
+
+#include "SimuAhrs.h"
+#include "SimuImu.h"
+#include <AhrsData.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+
+namespace flair {
+namespace filter {
+
+SimuAhrs::SimuAhrs(string name, uint32_t modelId,uint32_t deviceId,
+                   uint8_t priority)
+    : Ahrs(new SimuImu("imu", modelId,deviceId, priority), name) {
+  SetIsReady(true);
+}
+
+SimuAhrs::~SimuAhrs() {}
+
+// datas from SimuImu are AhrsData!
+void SimuAhrs::UpdateFrom(const io_data *data) {
+  AhrsData *input = (AhrsData *)data;
+  AhrsData *output;
+  GetDatas(&output);
+
+  Quaternion quaternion;
+  Vector3Df filteredAngRates;
+  input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
+  output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
+  output->SetDataTime(input->DataTime());
+
+  ProcessUpdate(output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/SimuAhrs.h
===================================================================
--- tags/latest/lib/FlairFilter/src/SimuAhrs.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/SimuAhrs.h	(revision 209)
@@ -0,0 +1,60 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuAhrs.h
+ * \brief Class for a simulation Ahrs
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMUAHRS_H
+#define SIMUAHRS_H
+
+#include <Ahrs.h>
+#include <stdint.h>
+
+namespace flair {
+namespace filter {
+/*! \class SimuAhrs
+*
+* \brief Class for a simulation Ahrs
+*
+* This class constructs a SimuImu as Imu of this Ahrs.
+*/
+class SimuAhrs : public filter::Ahrs {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a simulation Ahrs. It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId Ahrs id of the Model
+  * \param priority priority of the SimuImu Thread
+  */
+  SimuAhrs(std::string name,
+           uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuAhrs();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+};
+} // end namespace filter
+} // end namespace flair
+#endif // SIMUAHRS_H
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.cpp	(revision 209)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   TrajectoryGenerator1D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class generating a trajectory in 1D
+//
+//
+/*********************************************************************/
+
+#include "TrajectoryGenerator1D.h"
+#include "TrajectoryGenerator1D_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+TrajectoryGenerator1D::TrajectoryGenerator1D(const LayoutPosition *position,
+                                             string name, string unit)
+    : IODevice(position->getLayout(), name) {
+  pimpl_ = new TrajectoryGenerator1D_impl(this, position, name, unit);
+  AddDataToLog(pimpl_->output);
+  SetIsReady(true);
+}
+
+TrajectoryGenerator1D::~TrajectoryGenerator1D() { delete pimpl_; }
+
+cvmatrix *TrajectoryGenerator1D::Matrix(void) const { return pimpl_->output; }
+
+void TrajectoryGenerator1D::StartTraj(float startPosition, float endPosition,float startVelocity) {
+  pimpl_->StartTraj(startPosition,endPosition,startVelocity);
+}
+
+// revoir l'interet du stop?
+void TrajectoryGenerator1D::StopTraj(void) { pimpl_->StopTraj(); }
+
+bool TrajectoryGenerator1D::IsRunning(void) const {
+  if (pimpl_->is_started == true) {
+    if (pimpl_->is_finished == true) {
+      return false;
+    } else {
+      return true;
+    }
+  } else {
+    return false;
+  }
+}
+
+float TrajectoryGenerator1D::Position(void) const {
+  return pimpl_->output->Value(0, 0);
+}
+
+void TrajectoryGenerator1D::Reset(void) {
+  if (IsRunning() == false) {
+    pimpl_->Reset();
+  } else {
+    Err("impossible while running\n");
+  }
+}
+
+void TrajectoryGenerator1D::SetPositionOffset(float value) {
+  pimpl_->pos_off = value;
+}
+
+float TrajectoryGenerator1D::Speed(void) const {
+  return pimpl_->output->Value(1, 0);
+}
+
+void TrajectoryGenerator1D::SetSpeedOffset(float value) {
+  pimpl_->vel_off = value;
+}
+
+void TrajectoryGenerator1D::Update(Time time) {
+  pimpl_->Update(time);
+  ProcessUpdate(pimpl_->output);
+}
+
+float TrajectoryGenerator1D::GetPercentageOfCompletion(void) const {
+  return pimpl_->GetPercentageOfCompletion();
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.h
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D.h	(revision 209)
@@ -0,0 +1,170 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TrajectoryGenerator1D.h
+ * \brief Class generating a trajectory in 1D
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef TRAJECTORYGENERATOR1D_H
+#define TRAJECTORYGENERATOR1D_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class TrajectoryGenerator1D_impl;
+
+namespace flair {
+namespace filter {
+/*! \class TrajectoryGenerator1D
+*
+* \brief Class generating a trajectory in 1D
+*
+* This class generates position and velocity references, given
+* an absolute maximum velocity and an absolute acceleration. \n
+* When trajectory is started (see StartTraj()), position and velocity will
+*increase
+* at the given acceleration. If the maximum velocity is reached,
+* velocity will not increase anymore. Then, velocity will decrease according
+* to the given acceleration until velocity is null and final position is
+*reached. \n
+* Manual inputs can be introduced using SetPositionOffset() and
+*SetSpeedOffset().
+*
+*/
+class TrajectoryGenerator1D : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a TrajectoryGenerator1D at given position. \n
+  * The TrajectoryGenerator1D will automatically be child of
+  *position->getLayout() Layout. After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  * \param unit unit of the position (for exemple m, deg, etc). Its only used
+  *for display on ground station.
+  */
+  TrajectoryGenerator1D(const gui::LayoutPosition *position, std::string name,
+                        std::string unit = "");
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~TrajectoryGenerator1D();
+
+  /*!
+  * \brief Start trajectory
+  *
+  * \param startPosition start position
+  * \param endPosition end position
+  * \param startVelocity start velocity, should be actual velocity. This value will be saturated 
+  * max velocity defined in GCS.
+  */
+  void StartTraj(float startPosition, float endPosition,float startVelocity=0);
+
+  /*!
+  * \brief Stop trajectory
+  *
+  */
+  void StopTraj(void);
+
+  /*!
+  * \brief Reset
+  *
+  * Reset all outputs to 0. This can be done only when IsRunning()==false.
+  *
+  */
+  void Reset(void);
+
+  /*!
+  * \brief Is trajectory running?
+  *
+  * \return true if trajectory is running
+  */
+  bool IsRunning(void) const;
+
+  /*!
+  * \brief Set position offset
+  *
+  * \param value position offset
+  */
+  void SetPositionOffset(float value);
+
+  /*!
+  * \brief Set speed offset
+  *
+  * \param value speed offset
+  */
+  void SetSpeedOffset(float value);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Uses values specified by StartTraj(),
+  * SetPositionOffset() and SetSpeedOffset().
+  *
+  * \param time time of the update
+  */
+  void Update(core::Time time);
+
+  /*!
+  * \brief Position
+  *
+  * \return the actual position
+  */
+  float Position(void) const;
+
+  /*!
+  * \brief Speed
+  *
+  * \return the actual speed
+  */
+  float Speed(void) const;
+  
+  /*!
+  * \brief Get percentage of completion
+  * 
+  * Value is between 0 and 100.
+  *
+  * \return the percentage of completion (in position)
+  */
+  float GetPercentageOfCompletion(void) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * \return matrix
+  */
+  core::cvmatrix *Matrix(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice. Nothing to do in this IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  TrajectoryGenerator1D_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // TRAJECTORYGENERATOR1D_H
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator1D_impl.cpp	(revision 209)
@@ -0,0 +1,174 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   TrajectoryGenerator1D_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class generating a trajectory in 1D
+//
+//
+/*********************************************************************/
+
+#include "TrajectoryGenerator1D.h"
+#include "TrajectoryGenerator1D_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <cmath>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+TrajectoryGenerator1D_impl::TrajectoryGenerator1D_impl(
+    TrajectoryGenerator1D *self, const LayoutPosition *position, string name,
+    string unit) {
+  first_update = true;
+  is_started = false;
+
+  // init UI
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto:",
+                        " s", 0, 1, 0.01);
+  if (unit == "") {
+    max_veloctity =
+        new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                          "velocity max (absolute):", 0., 200000, 1);
+  } else {
+    max_veloctity = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                                      "velocity max (absolute):",
+                                      " " + unit + "/s", 0., 200000, 1);
+  }
+  if (unit == "") {
+    acceleration = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                                     "acceleration (absolute):", 0., 10, 1, 3);
+  } else {
+    acceleration = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                                     "acceleration (absolute):",
+                                     " " + unit + "/s²", 0., 200000, 1);
+  }
+
+  Reset();
+
+  // init matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(2, 1);
+  desc->SetElementName(0, 0, "pos");
+  desc->SetElementName(1, 0, "vel");
+  output = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+
+  output->SetValue(0, 0, pos);
+  output->SetValue(1, 0, v);
+}
+
+TrajectoryGenerator1D_impl::~TrajectoryGenerator1D_impl() {}
+
+void TrajectoryGenerator1D_impl::Reset(void) {
+  pos = 0;
+  v = 0;
+  pos_off = 0;
+  vel_off = 0;
+}
+
+void TrajectoryGenerator1D_impl::StartTraj(float start_pos, float end_pos,float startVelocity) {
+  is_started = true;
+  is_finished = false;
+  first_update = true;
+
+  // configure trajectory
+  this->start_pos = start_pos;
+  this->end_pos = end_pos;
+  pos = start_pos;
+  acc = acceleration->Value();
+  v = startVelocity;
+  if (fabs(v) > fabs(max_veloctity->Value())) {
+    if (v > 0)
+      v = max_veloctity->Value();
+    else
+      v = -max_veloctity->Value();
+  }
+  if (end_pos < start_pos) {
+    acc = -acc;
+    // max_veloctity=-max_veloctity;
+  }
+}
+
+// revoir l'interet du stop?
+void TrajectoryGenerator1D_impl::StopTraj(void) {
+  is_started = false;
+  v = 0;
+  // output->SetValue(1,0,v);
+}
+
+float TrajectoryGenerator1D_impl::GetPercentageOfCompletion(void) const {
+  if(!is_started) {
+    return 0;
+  } else {
+    return (pos-start_pos)/(end_pos-start_pos)*100;
+  }
+}
+
+void TrajectoryGenerator1D_impl::Update(Time time) {
+  float delta_t;
+
+  if (T->Value() == 0) {
+    if (first_update == true) {
+      first_update = false;
+      previous_time = time;
+      output->GetMutex();
+      output->SetValueNoMutex(0, 0, pos + pos_off);
+      output->SetValueNoMutex(1, 0, v + vel_off);
+      output->ReleaseMutex();
+
+      output->SetDataTime(time);
+      return;
+    } else {
+      delta_t = (float)(time - previous_time) / 1000000000.;
+    }
+  } else {
+    delta_t = T->Value();
+  }
+  previous_time = time;
+
+  if (is_started == true) {
+    if (is_finished == false) {
+      v += acc * delta_t;
+      if (fabs(v) > fabs(max_veloctity->Value())) {
+        if (v > 0)
+          v = max_veloctity->Value();
+        else
+          v = -max_veloctity->Value();
+      }
+      pos += v * delta_t;
+      if (end_pos - v * v / (2 * acc) <= pos && v >= 0)
+        acc = -acc;
+      if (end_pos - v * v / (2 * acc) >= pos && v < 0)
+        acc = -acc;
+      if (pos >= end_pos && v >= 0)
+        is_finished = true;
+      if (pos <= end_pos && v < 0)
+        is_finished = true;
+    }
+    // else
+    if (is_finished == true) {
+      v = 0;
+      pos = end_pos;
+    }
+  }
+
+  // on prend une fois pour toute les mutex et on fait des accès directs
+  output->GetMutex();
+  output->SetValueNoMutex(0, 0, pos + pos_off);
+  output->SetValueNoMutex(1, 0, v + vel_off);
+  output->ReleaseMutex();
+
+  output->SetDataTime(time);
+}
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 209)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   TrajectoryGenerator2DCircle.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class generating a circle trajectory in 2D
+//
+//
+/*********************************************************************/
+
+#include "TrajectoryGenerator2DCircle.h"
+#include "TrajectoryGenerator2DCircle_impl.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <LayoutPosition.h>
+#include <Vector2D.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+TrajectoryGenerator2DCircle::TrajectoryGenerator2DCircle(
+    const LayoutPosition *position, string name)
+    : IODevice(position->getLayout(), name) {
+  pimpl_ = new TrajectoryGenerator2DCircle_impl(this, position, name);
+  AddDataToLog(pimpl_->output);
+  SetIsReady(true);
+}
+
+TrajectoryGenerator2DCircle::~TrajectoryGenerator2DCircle() { delete pimpl_; }
+
+bool TrajectoryGenerator2DCircle::IsRunning(void) const {
+  return pimpl_->is_running;
+}
+
+cvmatrix *TrajectoryGenerator2DCircle::Matrix(void) const {
+  return pimpl_->output;
+}
+
+void TrajectoryGenerator2DCircle::StartTraj(const Vector2Df &start_pos,
+                                            float nb_lap) {
+  pimpl_->StartTraj(start_pos, nb_lap);
+}
+
+void TrajectoryGenerator2DCircle::FinishTraj(void) { pimpl_->FinishTraj(); }
+
+void TrajectoryGenerator2DCircle::StopTraj(void) { pimpl_->is_running = false; }
+
+void TrajectoryGenerator2DCircle::GetPosition(Vector2Df &point) const {
+  point.x = pimpl_->output->Value(0, 0);
+  point.y = pimpl_->output->Value(0, 1);
+}
+
+void TrajectoryGenerator2DCircle::SetCenter(const Vector2Df &value) {
+  pimpl_->pos_off = value;
+}
+
+void TrajectoryGenerator2DCircle::GetSpeed(Vector2Df &point) const {
+  point.x = pimpl_->output->Value(1, 0);
+  point.y = pimpl_->output->Value(1, 1);
+}
+
+void TrajectoryGenerator2DCircle::SetCenterSpeed(const Vector2Df &value) {
+  pimpl_->vel_off = value;
+}
+
+void TrajectoryGenerator2DCircle::Update(Time time) {
+  pimpl_->Update(time);
+  ProcessUpdate(pimpl_->output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h	(revision 209)
@@ -0,0 +1,156 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TrajectoryGenerator2DCircle.h
+ * \brief Class generating a circle trajectory in 2D
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/08
+ * \version 4.0
+ */
+
+#ifndef TRAJECTORYGENERATOR2DCIRCLE_H
+#define TRAJECTORYGENERATOR2DCIRCLE_H
+
+#include <IODevice.h>
+#include <Vector2D.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+}
+}
+
+class TrajectoryGenerator2DCircle_impl;
+
+namespace flair {
+namespace filter {
+/*! \class TrajectoryGenerator2DCircle
+*
+* \brief Class generating a circle trajectory in 2D
+*
+* This class generates position and velocity references, given
+* a maximum velocity and an absolute acceleration, for a circle. \n
+* When trajectory is started (StartTraj), position and velocity will increase
+* at the given acceleration untill maximum velocity is reached. \n
+* When trajectory is asked to be finished (see FinishTraj()), position
+* and velocity will decrease at the given acceleration untill null velocity is
+*reached. \n
+* Position and velocity of the center of the circle can be manually changed
+* through SetCenter() and SetCenterSpeed().
+*/
+class TrajectoryGenerator2DCircle : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a TrajectoryGenerator2DCircle at position. \n
+  * The TrajectoryGenerator2DCircle will automatically be child of
+  *position->getLayout() Layout. After calling this function,
+  * position will be deleted as it is no longer usefull. \n
+  *
+  * \param position position to display settings
+  * \param name name
+  */
+  TrajectoryGenerator2DCircle(const gui::LayoutPosition *position,
+                              std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~TrajectoryGenerator2DCircle();
+
+  /*!
+  * \brief Start trajectory
+  *
+  * \param start_pos start position
+  * \param nb_lap number of laps, -1 for infinite
+  */
+  void StartTraj(const core::Vector2Df &start_pos, float nb_lap = -1);
+
+  /*!
+  * \brief Stop trajectory
+  *
+  * Stop abruptly the trajectory.
+  */
+  void StopTraj(void);
+
+  /*!
+  * \brief Finish trajectory
+  *
+  * Finish smoothly the trajectory.
+  */
+  void FinishTraj(void);
+
+  /*!
+  * \brief Set center position
+  *
+  * \param value center position
+  */
+  void SetCenter(const core::Vector2Df &value);
+
+  /*!
+  * \brief Set center speed
+  *
+  * \param value center speed
+  */
+  void SetCenterSpeed(const core::Vector2Df &value);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Uses values specified by StartTraj(),
+  * SetCenter() and SetCenterSpeed().
+  *
+  * \param time time of the update
+  */
+  void Update(core::Time time);
+
+  /*!
+  * \brief Position
+  *
+  * \param point returned position
+  */
+  void GetPosition(core::Vector2Df &point) const;
+
+  /*!
+  * \brief Speed
+  *
+  * \param point returned speed
+  */
+  void GetSpeed(core::Vector2Df &point) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * \return matrix
+  */
+  core::cvmatrix *Matrix(void) const;
+
+  /*!
+  * \brief Is trajectory running?
+  *
+  * \return true if trajectory is running
+  */
+  bool IsRunning(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice. Nothing to do in this IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  TrajectoryGenerator2DCircle_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // TRAJECTORYGENERATOR2DCIRCLE_H
Index: tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp	(revision 209)
@@ -0,0 +1,167 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   TrajectoryGenerator2DCircle_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet permettant la generation d'une trajectoire cercle
+//
+//
+/*********************************************************************/
+
+#include "TrajectoryGenerator2DCircle_impl.h"
+#include "TrajectoryGenerator2DCircle.h"
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <cmath>
+
+#define PI ((float)3.14159265358979323846)
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+TrajectoryGenerator2DCircle_impl::TrajectoryGenerator2DCircle_impl(
+    TrajectoryGenerator2DCircle *self, const LayoutPosition *position,
+    string name) {
+  first_update = true;
+  is_running = false;
+  is_finishing = false;
+
+  // init UI
+  GroupBox *reglages_groupbox = new GroupBox(position, name);
+  T = new DoubleSpinBox(reglages_groupbox->NewRow(), "period, 0 for auto", " s",
+                        0, 1, 0.01);
+  rayon = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "R", " m", 0,
+                            1000, .1);
+  veloctity = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "velocity",
+                                " m/s", -10, 10, 1);
+  acceleration =
+      new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),
+                        "acceleration (absolute)", " m/s²", 0, 10, .1);
+
+  // init matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(2, 2);
+  desc->SetElementName(0, 0, "pos.x");
+  desc->SetElementName(0, 1, "pos.y");
+  desc->SetElementName(1, 0, "vel.x");
+  desc->SetElementName(1, 1, "vel.y");
+  output = new cvmatrix(self, desc, floatType, name);
+  delete desc;
+}
+
+TrajectoryGenerator2DCircle_impl::~TrajectoryGenerator2DCircle_impl() {
+  delete output;
+}
+
+void TrajectoryGenerator2DCircle_impl::StartTraj(const Vector2Df &start_pos,
+                                                 float nb_lap) {
+  is_running = true;
+  first_update = true;
+  is_finishing = false;
+  this->nb_lap = nb_lap;
+
+  // configure trajectory
+  angle_off = atan2(start_pos.y - pos_off.y, start_pos.x - pos_off.x);
+  CurrentTime = 0;
+}
+
+void TrajectoryGenerator2DCircle_impl::FinishTraj(void) {
+  if (!is_finishing) {
+    is_finishing = true;
+    FinishTime = CurrentTime;
+  }
+}
+
+void TrajectoryGenerator2DCircle_impl::Update(Time time) {
+  float delta_t;
+  float theta;
+  float V = veloctity->Value();
+  float A = acceleration->Value();
+  float R = rayon->Value();
+  Vector2Df v;
+
+  if (V < 0)
+    A = -A;
+
+  if (T->Value() == 0) {
+    if (first_update) {
+      first_update = false;
+      previous_time = time;
+      return;
+    } else {
+      delta_t = (float)(time - previous_time) / 1000000000.;
+    }
+  } else {
+    delta_t = T->Value();
+  }
+  previous_time = time;
+  CurrentTime += delta_t;
+
+  if (is_finishing && CurrentTime > FinishTime + V / A)
+    is_running = false;
+
+  if (is_running) {
+    if (R == 0) {
+      pos.x = 0;
+      pos.y = 0;
+      v.x = 0;
+      v.y = 0;
+    } else {
+      if (CurrentTime < V / A) {
+        theta = angle_off + A / 2 * CurrentTime * CurrentTime / R;
+        pos.x = R * cos(theta);
+        pos.y = R * sin(theta);
+        v.x = -A * CurrentTime * sin(theta);
+        v.y = A * CurrentTime * cos(theta);
+      } else {
+        if (!is_finishing) {
+          theta =
+              angle_off + V * V / (2 * A * R) + (CurrentTime - V / A) * V / R;
+          pos.x = R * cos(theta);
+          pos.y = R * sin(theta);
+          v.x = -V * sin(theta);
+          v.y = V * cos(theta);
+        } else {
+          theta = angle_off + V * V / (2 * A * R) +
+                  (FinishTime - V / A) * V / R -
+                  A / 2 * (FinishTime - CurrentTime) *
+                      (FinishTime - CurrentTime) / R +
+                  V * (CurrentTime - FinishTime) / R;
+          pos.x = R * cos(theta);
+          pos.y = R * sin(theta);
+          v.x = -(V + A * (FinishTime - CurrentTime)) * sin(theta);
+          v.y = (V + A * (FinishTime - CurrentTime)) * cos(theta);
+        }
+      }
+    }
+
+    if (theta - angle_off >= nb_lap * 2 * PI - (-A / 2 * (V / A) * (V / A) / R +
+                                                V * (V / A) / R) &&
+        nb_lap > 0) {
+      FinishTraj();
+    }
+  } else {
+    v.x = 0;
+    v.y = 0;
+  }
+
+  // on prend une fois pour toute les mutex et on fait des accès directs
+  output->GetMutex();
+  output->SetValueNoMutex(0, 0, pos.x + pos_off.x);
+  output->SetValueNoMutex(0, 1, pos.y + pos_off.y);
+  output->SetValueNoMutex(1, 0, v.x + vel_off.x);
+  output->SetValueNoMutex(1, 1, v.y + vel_off.y);
+  output->ReleaseMutex();
+
+  output->SetDataTime(time);
+}
Index: tags/latest/lib/FlairFilter/src/UavMultiplex.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/UavMultiplex.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/UavMultiplex.cpp	(revision 209)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/11
+//  filename:   UavMultiplex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining uav multiplexing
+//
+//
+/*********************************************************************/
+
+#include "UavMultiplex.h"
+#include "UavMultiplex_impl.h"
+#include <cvmatrix.h>
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include "compile_info.h"
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+//todo: put it on seprate file, but not possible with static lib?
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairFilter");
+}
+
+
+namespace flair {
+namespace filter {
+
+UavMultiplex::UavMultiplex(std::string name)
+    : IODevice(getFrameworkManager(), name) {
+  pimpl_ = new UavMultiplex_impl(this, name);
+}
+
+UavMultiplex::~UavMultiplex(void) { delete pimpl_; }
+
+void UavMultiplex::Update(core::Time time) {
+  pimpl_->input->SetDataTime(time);
+  UpdateFrom(pimpl_->input);
+}
+
+void UavMultiplex::SetMultiplexComboBox(string name, int index) {
+  pimpl_->SetMultiplexComboBox(name, index);
+}
+
+int UavMultiplex::MultiplexValue(int index) const {
+  return pimpl_->MultiplexValue(index);
+}
+
+TabWidget *UavMultiplex::GetTabWidget(void) const { return pimpl_->tabwidget; }
+
+Layout *UavMultiplex::GetLayout(void) const { return pimpl_->setup_tab; }
+
+void UavMultiplex::LockUserInterface(void) const {
+  pimpl_->setup_tab->setEnabled(false);
+}
+
+void UavMultiplex::UnlockUserInterface(void) const {
+  pimpl_->setup_tab->setEnabled(true);
+}
+
+void UavMultiplex::SetRoll(float value) {
+  pimpl_->input->SetValue(0, 0, value);
+}
+
+void UavMultiplex::SetPitch(float value) {
+  pimpl_->input->SetValue(1, 0, value);
+}
+
+void UavMultiplex::SetYaw(float value) { pimpl_->input->SetValue(2, 0, value); }
+
+void UavMultiplex::SetThrust(float value) {
+  pimpl_->input->SetValue(3, 0, value);
+}
+
+void UavMultiplex::SetRollTrim(float value) {
+  pimpl_->input->SetValue(4, 0, value);
+}
+
+void UavMultiplex::SetPitchTrim(float value) {
+  pimpl_->input->SetValue(5, 0, value);
+}
+
+void UavMultiplex::SetYawTrim(float value) {
+  pimpl_->input->SetValue(6, 0, value);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/UavMultiplex.h
===================================================================
--- tags/latest/lib/FlairFilter/src/UavMultiplex.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/UavMultiplex.h	(revision 209)
@@ -0,0 +1,217 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UavMultiplex.h
+ * \brief Class defining uav multiplexing
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/11
+ * \version 4.0
+ */
+
+#ifndef UAVMULTIPLEX_H
+#define UAVMULTIPLEX_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class io_data;
+}
+namespace gui {
+class TabWidget;
+class Layout;
+}
+}
+
+class UavMultiplex_impl;
+
+namespace flair {
+namespace filter {
+/*! \class UavMultiplex
+*
+* \brief Class defining uav multiplexing
+*/
+class UavMultiplex : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a uav multiplexing. It will be child of the FrameworkManager.
+  *
+  * \param name name
+  */
+  UavMultiplex(std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~UavMultiplex();
+
+  /*!
+  * \brief Set roll torque
+  *
+  * roll torque is placed in input(0,0)
+  *
+  * \param value value between -1 and 1
+  */
+  void SetRoll(float value);
+
+  /*!
+  * \brief Set pitch torque
+  *
+  * pitch torque is placed in input(1,0)
+  *
+  * \param value value between -1 and 1
+  */
+  void SetPitch(float value);
+
+  /*!
+  * \brief Set yaw torque
+  *
+  * yaw torque is placed in input(2,0)
+  *
+  * \param value value between -1 and 1
+  */
+  void SetYaw(float value);
+
+  /*!
+  * \brief Set thrust
+  *
+  * thrust is placed in input(3,0)
+  *
+  * \param value value between 0 and 1
+  */
+  void SetThrust(float value);
+
+  /*!
+  * \brief Set roll trim
+  *
+  * trim is placed in input(4,0)
+  *
+  * \param value value
+  */
+  void SetRollTrim(float value);
+
+  /*!
+  * \brief Set pitch trim
+  *
+  * trim is placed in input(5,0)
+  *
+  * \param value value
+  */
+  void SetPitchTrim(float value);
+
+  /*!
+  * \brief Set yaw trim
+  *
+  * trim is placed in input(6,0)
+  *
+  * \param value value
+  */
+  void SetYawTrim(float value);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Uses values specified by Set*().
+  *
+  * \param time time of the update
+  */
+  void Update(core::Time time);
+
+  /*!
+  * \brief Lock user interface
+  *
+  * User interface will be grayed out.\n
+  * Use it do disallow changes when flying.
+  *
+  */
+  void LockUserInterface(void) const;
+
+  /*!
+  * \brief Unlock user interface
+  *
+  * User interface will be enabled.\n
+  *
+  */
+  void UnlockUserInterface(void) const;
+
+  /*!
+  * \brief Layout
+  *
+  * Layout to place custom widgets.\n
+  *
+  * \return the layout
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  * Derived class can implement this function do draw default plot.
+  *
+  */
+  virtual void UseDefaultPlot(void){};
+
+  /*!
+  * \brief Motors count
+  *
+  * This function must be reimplemented, in order to get the number of motors.
+  *
+  * \return motors count
+  */
+  virtual uint8_t MotorsCount(void) const = 0;
+
+  /*!
+  * \brief Multiplex value
+  *
+  * Get the mutliplexed value of a motor, if SetMultiplexComboBox() was used.\n
+  *
+  * \param index index of the motor, from 0 to MotorsCount()
+  * \return multiplexed index of the motor
+  */
+  int MultiplexValue(int index) const;
+
+  /*!
+  * \brief Get TabWidget
+  *
+  * Usefull to add tabs.\n
+  *
+  * \return the TabWidget
+  */
+  gui::TabWidget *GetTabWidget(void) const;
+
+protected:
+  /*!
+  * \brief Set multiplex ComboBox
+  *
+  * Draws a ComboBox to define motor multiplexing. \n
+  * This is used to change the order of the output motors.
+  *
+  * \param name description of the motor (ex front left)
+  * \param index index of the motor, from 0 to MotorsCount()
+  */
+  void SetMultiplexComboBox(std::string name, int index);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * This function is automatically called by ProcessUpdate()
+  * of the Object::Parent's if its Object::ObjectType is "IODevice". \n
+  * This function must be reimplemented, in order to process the data from the
+  *parent.
+  *
+  * \param data data from the parent to process
+  */
+  virtual void UpdateFrom(const core::io_data *data) = 0;
+
+  UavMultiplex_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // UAVMULTIPLEX_H
Index: tags/latest/lib/FlairFilter/src/UavMultiplex_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/UavMultiplex_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/UavMultiplex_impl.cpp	(revision 209)
@@ -0,0 +1,87 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/11
+//  filename:   UavMultiplex_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining uav multiplexing
+//
+//
+/*********************************************************************/
+
+#include "UavMultiplex_impl.h"
+#include "UavMultiplex.h"
+#include <cvmatrix.h>
+#include <FrameworkManager.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <ComboBox.h>
+#include <GroupBox.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+UavMultiplex_impl::UavMultiplex_impl(UavMultiplex *self, std::string name) {
+  input = new cvmatrix(self, 7, 1, floatType);
+  multiplexcombobox = NULL;
+  this->self = self;
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tabwidget = new TabWidget(main_tab->NewRow(), "UavMultiplex");
+  setup_tab = new Tab(tabwidget, "Setup");
+}
+
+UavMultiplex_impl::~UavMultiplex_impl(void) {
+  delete main_tab;
+  if (multiplexcombobox != NULL)
+    free(multiplexcombobox);
+}
+
+void UavMultiplex_impl::SetMultiplexComboBox(string name, int index) {
+  // we do not know motorcount at constructor time, so allocation is done here
+  if (multiplexcombobox == NULL) {
+    multiplexcombobox =
+        (ComboBox **)malloc(self->MotorsCount() * sizeof(ComboBox *));
+    for (int i = 0; i < self->MotorsCount(); i++)
+      multiplexcombobox[i] = NULL;
+    groupbox = new GroupBox(setup_tab->NewRow(), "motor attribution");
+  }
+  if (index > self->MotorsCount()) {
+    self->Err("index out of bound %i/%i\n", index, self->MotorsCount());
+    return;
+  }
+  if (multiplexcombobox[index] != NULL) {
+    self->Err("index already setup\n");
+    return;
+  }
+
+  multiplexcombobox[index] =
+      new ComboBox(groupbox->At(index / 4, index % 4), name);
+
+  for (int i = 0; i < self->MotorsCount(); i++) {
+    ostringstream oss;
+    oss << i;
+    multiplexcombobox[index]->AddItem(oss.str());
+  }
+}
+
+int UavMultiplex_impl::MultiplexValue(int index) const {
+  if (multiplexcombobox[index] != NULL) {
+    return multiplexcombobox[index]->CurrentIndex();
+  } else {
+    self->Err("multiplex not setup for motor %i\n", index);
+    return 0;
+  }
+}
Index: tags/latest/lib/FlairFilter/src/X4X8Multiplex.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/X4X8Multiplex.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/X4X8Multiplex.cpp	(revision 209)
@@ -0,0 +1,64 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/10
+//  filename:   X4X8Multiplex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining X4 and X8 multiplexing
+//
+//
+/*********************************************************************/
+
+#include "X4X8Multiplex.h"
+#include "X4X8Multiplex_impl.h"
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace filter {
+
+X4X8Multiplex::X4X8Multiplex(std::string name,UavType_t type)
+    : UavMultiplex( name) {
+  int nb_mot;
+
+  switch (type) {
+  case X4:
+    nb_mot = 4;
+    break;
+  case X8:
+    nb_mot = 8;
+    break;
+  default:
+    Err("uav type not supported\n");
+    break;
+  }
+
+  pimpl_ = new X4X8Multiplex_impl(this, nb_mot);
+
+  for (int i = 0; i < nb_mot; i++) {
+    SetMultiplexComboBox(pimpl_->MotorName(i), i);
+  }
+  
+  SetIsReady(true);
+}
+
+X4X8Multiplex::~X4X8Multiplex(void) { delete pimpl_; }
+
+uint8_t X4X8Multiplex::MotorsCount(void) const { return pimpl_->nb_mot; }
+
+void X4X8Multiplex::UseDefaultPlot(void) { pimpl_->UseDefaultPlot(); }
+
+void X4X8Multiplex::UpdateFrom(const io_data *data) {
+  pimpl_->UpdateFrom(data);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairFilter/src/X4X8Multiplex.h
===================================================================
--- tags/latest/lib/FlairFilter/src/X4X8Multiplex.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/X4X8Multiplex.h	(revision 209)
@@ -0,0 +1,105 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file X4X8Multiplex.h
+ * \brief Class defining X4 and X8 multiplexing
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/10
+ * \version 4.0
+ */
+
+#ifndef X4X8MULTIPLEX_H
+#define X4X8MULTIPLEX_H
+
+#include <UavMultiplex.h>
+
+class X4X8Multiplex_impl;
+
+namespace flair {
+namespace filter {
+/*! \class X4X8Multiplex
+*
+* \brief Class defining X4 and X8 multiplexing
+*
+* The output order of the motors can be changed through ground station.
+*/
+class X4X8Multiplex : public UavMultiplex {
+  friend class ::X4X8Multiplex_impl;
+
+public:
+  /*!
+ \enum UavType_t
+ \brief type of UAV
+ */
+  typedef enum {
+    X4, /*!< 4 motors: front left, front right, rear left, rear right */
+    X8  /*!< 8 motors: top front left, top front right, top rear left, top rear
+           right, bottom front left, bottom front right, bottom rear left, bottom
+           rear right */
+  } UavType_t;
+
+  /*!
+  \enum MotorNames_t
+  \brief Motor names
+  */
+  typedef enum {
+    TopFrontLeft = 0,     /*!< Top front left, X4 or X8 */
+    TopFrontRight = 1,    /*!< Top front right, X4 or X8 */
+    TopRearLeft = 2,      /*!< Top rear left, X4 or X8 */
+    TopRearRight = 3,     /*!< Top rear right, X4 or X8 */
+    BottomFrontLeft = 4,  /*!< Bottom front left, X8 */
+    BottomFrontRight = 5, /*!< Bottom front right, X8 */
+    BottomRearLeft = 6,   /*!< Bottom rear left, X8 */
+    BottomRearRight = 7,  /*!< Bottom rear right, X8 */
+  } MotorNames_t;
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a X4 and X8 multiplexing. It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param type type
+  */
+  X4X8Multiplex(std::string name, UavType_t type);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~X4X8Multiplex();
+
+  /*!
+  * \brief Use default plot
+  *
+  * Plot the output values.
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief Motors count
+  *
+  * Reimplemented from UavMultiplex.
+  *
+  * \return motors count
+  */
+  uint8_t MotorsCount(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  X4X8Multiplex_impl *pimpl_;
+};
+} // end namespace filter
+} // end namespace flair
+#endif // X4X8MULTIPLEX_H
Index: tags/latest/lib/FlairFilter/src/X4X8Multiplex_impl.cpp
===================================================================
--- tags/latest/lib/FlairFilter/src/X4X8Multiplex_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairFilter/src/X4X8Multiplex_impl.cpp	(revision 209)
@@ -0,0 +1,215 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/10
+//  filename:   X4X8Multiplex_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining X4 and X8 multiplexing
+//
+//
+/*********************************************************************/
+
+#include "X4X8Multiplex_impl.h"
+#include "X4X8Multiplex.h"
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <GroupBox.h>
+#include <ComboBox.h>
+#include <DataPlot1D.h>
+#include <math.h>
+
+#define MAX_MOTORS 8
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+
+X4X8Multiplex_impl::X4X8Multiplex_impl(flair::filter::X4X8Multiplex *self,
+                                       int nb_mot) {
+  this->nb_mot = nb_mot;
+  this->self = self;
+
+  if (nb_mot == 4) {
+    GroupBox *groupbox =
+        new GroupBox(self->GetLayout()->NewRow(), "x4 multiplex");
+    pas = new ComboBox(groupbox->NewRow(), "front left blade pitch:");
+  } else {
+    GroupBox *groupbox =
+        new GroupBox(self->GetLayout()->NewRow(), "x8 multiplex");
+    pas = new ComboBox(groupbox->NewRow(), "top front left blade pitch:");
+  }
+  pas->AddItem("counter clockwise");
+  pas->AddItem("clockwise");
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(nb_mot, 1);
+  for (int i = 0; i < nb_mot; i++) {
+    desc->SetElementName(i, 0, MotorName(i));
+  }
+
+  output = new cvmatrix(self, desc, floatType);
+  delete desc;
+  self->AddDataToLog(output);
+}
+
+X4X8Multiplex_impl::~X4X8Multiplex_impl(void) {}
+
+void X4X8Multiplex_impl::UseDefaultPlot(void) {
+  Tab *plot_tab = new Tab(self->GetTabWidget(), "Values");
+  plots[0] = new DataPlot1D(plot_tab->NewRow(), "front left", 0, 1);
+  plots[1] = new DataPlot1D(plot_tab->LastRowLastCol(), "front right", 0, 1);
+  plots[2] = new DataPlot1D(plot_tab->NewRow(), "rear left", 0, 1);
+  plots[3] = new DataPlot1D(plot_tab->LastRowLastCol(), "rear right", 0, 1);
+
+  for (int i = 0; i < 4; i++)
+    plots[i]->AddCurve(output->Element(i));
+
+  if (nb_mot == 8) {
+    for (int i = 0; i < 4; i++)
+      plots[i]->AddCurve(output->Element(i + 4), DataPlot::Blue);
+  }
+}
+
+void X4X8Multiplex_impl::UpdateFrom(const io_data *data) {
+  float u_roll, u_pitch, u_yaw, u_thrust;
+  float trim_roll, trim_pitch, trim_yaw;
+  float value[MAX_MOTORS];
+
+  cvmatrix *input = (cvmatrix *)data;
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  input->GetMutex();
+
+  u_roll = input->ValueNoMutex(0, 0);
+  u_pitch = input->ValueNoMutex(1, 0);
+  u_yaw = input->ValueNoMutex(2, 0);
+  u_thrust = input->ValueNoMutex(3, 0);
+  trim_roll = input->ValueNoMutex(4, 0);
+  trim_pitch = input->ValueNoMutex(5, 0);
+  trim_yaw = input->ValueNoMutex(6, 0);
+
+  input->ReleaseMutex();
+
+  if (pas->CurrentIndex() == 1) {
+    trim_yaw = -trim_yaw;
+    u_yaw = -u_yaw;
+  }
+
+  if (nb_mot == 2) {
+    //(top) front left
+    value[self->MultiplexValue(X4X8Multiplex::TopFrontLeft)] = Set(
+        trim_pitch + trim_roll + trim_yaw, u_thrust + u_pitch + u_roll + u_yaw);
+
+    //(top) front right
+    value[self->MultiplexValue(X4X8Multiplex::TopFrontRight)] = Set(
+        trim_pitch - trim_roll - trim_yaw, u_thrust + u_pitch - u_roll - u_yaw);
+  }
+  if (nb_mot == 4 || nb_mot == 8) {
+    //(top) front left
+    value[self->MultiplexValue(X4X8Multiplex::TopFrontLeft)] = Set(
+        trim_pitch + trim_roll + trim_yaw, u_thrust + u_pitch + u_roll + u_yaw);
+
+    //(top) front right
+    value[self->MultiplexValue(X4X8Multiplex::TopFrontRight)] = Set(
+        trim_pitch - trim_roll - trim_yaw, u_thrust + u_pitch - u_roll - u_yaw);
+
+    //(top) rear left
+    value[self->MultiplexValue(X4X8Multiplex::TopRearLeft)] =
+        Set(-trim_pitch + trim_roll - trim_yaw,
+            u_thrust - u_pitch + u_roll - u_yaw);
+
+    //(top) rear right
+    value[self->MultiplexValue(X4X8Multiplex::TopRearRight)] =
+        Set(-trim_pitch - trim_roll + trim_yaw,
+            u_thrust - u_pitch - u_roll + u_yaw);
+  }
+
+  if (nb_mot == 8) {
+    // bottom front left
+    value[self->MultiplexValue(X4X8Multiplex::BottomFrontLeft)] = Set(
+        trim_pitch + trim_roll - trim_yaw, u_thrust + u_pitch + u_roll - u_yaw);
+
+    // bottom front right
+    value[self->MultiplexValue(X4X8Multiplex::BottomFrontRight)] = Set(
+        trim_pitch - trim_roll + trim_yaw, u_thrust + u_pitch - u_roll + u_yaw);
+
+    // bottom rear left
+    value[self->MultiplexValue(X4X8Multiplex::BottomRearLeft)] =
+        Set(-trim_pitch + trim_roll + trim_yaw,
+            u_thrust - u_pitch + u_roll + u_yaw);
+
+    // bottom rear right
+    value[self->MultiplexValue(X4X8Multiplex::BottomRearRight)] =
+        Set(-trim_pitch - trim_roll - trim_yaw,
+            u_thrust - u_pitch - u_roll - u_yaw);
+  }
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  output->GetMutex();
+  for (int i = 0; i < nb_mot; i++)
+    output->SetValueNoMutex(i, 0, value[i]);
+  output->ReleaseMutex();
+
+  output->SetDataTime(data->DataTime());
+
+  self->ProcessUpdate(output);
+}
+
+float X4X8Multiplex_impl::Set(float trim, float u) {
+  float value = trim;
+
+  if (u > 0) {
+    value += sqrtf(u);
+  }
+
+  return value;
+}
+
+string X4X8Multiplex_impl::MotorName(int index) {
+  switch (nb_mot) {
+  case 4: {
+    switch (index) {
+    case 0:
+      return "front left";
+    case 1:
+      return "front rigth";
+    case 2:
+      return "rear left";
+    case 3:
+      return "rear rigth";
+    default:
+      return "unammed motor";
+    }
+  }
+  case 8: {
+    switch (index) {
+    case 0:
+      return "top front left";
+    case 1:
+      return "top front rigth";
+    case 2:
+      return "top rear left";
+    case 3:
+      return "top rear rigth";
+    case 4:
+      return "bottom front left";
+    case 5:
+      return "bottom front rigth";
+    case 6:
+      return "bottom rear left";
+    case 7:
+      return "bottom rear rigth";
+    default:
+      return "unammed motor";
+    }
+  }
+  default: { return "unammed motor"; }
+  }
+}
Index: tags/latest/lib/FlairFilter/src/groups.dox
===================================================================
--- tags/latest/lib/FlairFilter/src/groups.dox	(revision 209)
+++ tags/latest/lib/FlairFilter/src/groups.dox	(revision 209)
@@ -0,0 +1,4 @@
+/*! \namespace flair::filter
+ * 
+ * \brief Filter classes
+ */
Index: tags/latest/lib/FlairFilter/src/unexported/AhrsKalman_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/AhrsKalman_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/AhrsKalman_impl.h	(revision 209)
@@ -0,0 +1,87 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AhrsKalman_impl.h
+ * \brief Class defining an Ahrs Kalman filter
+ * \author Tom Pycke, API changes by Guillaume Sanahuja to fit the Flair framework
+ * \date 2007/10/17, 2014/01/15
+ * \version
+ */
+
+#ifndef AHRSKALMAN_IMPL_H
+#define AHRSKALMAN_IMPL_H
+
+#include <Ahrs.h>
+#include <Euler.h>
+
+namespace flair {
+    namespace core {
+        class AhrsData;
+    }
+    namespace gui {
+        class Layout;
+        class DoubleSpinBox;
+    }
+}
+
+/*! \class AhrsKalman_impl
+* \brief Class defining an Ahrs Kalman filter
+*/
+
+class AhrsKalman_impl {
+    public:
+        AhrsKalman_impl(const flair::gui::Layout *layout,flair::core::AhrsData *ahrsData);
+        ~AhrsKalman_impl();
+        void UpdateFrom(const flair::core::io_data *data);
+
+    private:
+        flair::core::AhrsData *ahrsData;
+        typedef struct ars_Gyro1DKalman
+        {
+            /* These variables represent our state matrix x */
+            double x_angle,
+                  x_bias;
+
+            /* Our error covariance matrix */
+            double P_00,
+                  P_01,
+                  P_10,
+                  P_11;
+
+            /*
+             * Q is a 2x2 matrix of the covariance. Because we
+             * assume the gyro and accelero noise to be independend
+             * of eachother, the covariances on the / diagonal are 0.
+             *
+             * Covariance Q, the process noise, from the assumption
+             *    x = F x + B u + w
+             * with w having a normal distribution with covariance Q.
+             * (covariance = E[ (X - E[X])*(X - E[X])' ]
+             * We assume is linair with dt
+             */
+            double Q_angle, Q_gyro;
+            /*
+             * Covariance R, our observation noise (from the accelerometer)
+             * Also assumed to be linair with dt
+             */
+            double R_angle;
+        } ars_Gyro1DKalman;
+
+        // Initializing the struct
+        void ars_Init(ars_Gyro1DKalman *filterdata, double Q_angle, double Q_gyro, double R_angle);
+        // Kalman predict
+        void ars_predict(ars_Gyro1DKalman *filterdata, const double gyro, const double dt);
+        // Kalman update
+        void ars_update(ars_Gyro1DKalman *filterdata, const double angle_m);
+
+        ars_Gyro1DKalman ars_roll;
+        ars_Gyro1DKalman ars_pitch;
+        flair::core::Time previous_time;
+        bool is_init;
+        flair::gui::DoubleSpinBox *Q_angle,*Q_gyro,*R_angle;
+        flair::core::Euler euler;
+};
+
+#endif // AHRSKALMAN_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/Ahrs_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/Ahrs_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/Ahrs_impl.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Ahrs_impl.h
+ * \brief Virtual class for Ahrs_impl
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/14
+ * \version 4.0
+ */
+
+#ifndef AHRS_IMPL_H
+#define AHRS_IMPL_H
+
+#include <DataPlot.h>
+
+namespace flair {
+namespace core {
+class AhrsData;
+}
+namespace gui {
+class Tab;
+class DataPlot1D;
+}
+namespace filter {
+class Ahrs;
+}
+}
+
+/*! \class Ahrs_impl
+* \brief Abstract class for Ahrs_impl
+*
+* Use this class to define a custom Ahrs_impl. \n
+*
+*/
+
+class Ahrs_impl {
+public:
+  Ahrs_impl(flair::filter::Ahrs *self);
+  ~Ahrs_impl();
+  void UseDefaultPlot(void);
+  void AddPlot(const flair::core::AhrsData *ahrsData,
+               flair::gui::DataPlot::Color_t color);
+  flair::gui::DataPlot1D *rollPlot, *pitchPlot, *yawPlot;
+  flair::gui::DataPlot1D *wXPlot, *wYPlot, *wZPlot;
+  flair::gui::DataPlot1D *q0Plot, *q1Plot, *q2Plot, *q3Plot;
+  flair::core::AhrsData *ahrsData;
+
+private:
+  flair::gui::Tab *eulerTab, *quaternionTab;
+  flair::filter::Ahrs *self;
+};
+
+#endif // AHRS_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h	(revision 209)
@@ -0,0 +1,139 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ButterworthLowPass_impl.h
+ * \brief Classe permettant le calcul d'un filtre passe bas de Butterworth
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef BUTTERWORTHLOWPASS_H_IMPL_H
+#define BUTTERWORTHLOWPASS_H_IMPL_H
+
+#include <IODevice.h>
+#include <Butterworth.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class SpinBox;
+class DoubleSpinBox;
+}
+namespace filter {
+class ButterworthLowPass;
+}
+}
+
+// Storage for Layout
+// de-templatized for pimpl idom
+// comes from iir from Bernd Porr
+class LayoutStorage {
+public:
+  LayoutStorage(int MaxPoles) {
+    this->MaxPoles = MaxPoles;
+    m_pairs = (Iir::PoleZeroPair *)malloc((MaxPoles + 1) / 2 *
+                                          sizeof(Iir::PoleZeroPair));
+  }
+  ~LayoutStorage() { free(m_pairs); }
+  operator Iir::LayoutBase() { return Iir::LayoutBase(MaxPoles, m_pairs); }
+
+private:
+  Iir::PoleZeroPair *m_pairs;
+  int MaxPoles;
+};
+
+// Storage for Cascade
+// de-templatized for pimpl idom
+// comes from iir from Bernd Porr
+class CascadeStages {
+public:
+  CascadeStages(int MaxStages) {
+    this->MaxStages = MaxStages;
+    m_stages =
+        (Iir::Cascade::Stage *)malloc(MaxStages * sizeof(Iir::Cascade::Stage));
+    m_states =
+        (Iir::DirectFormII *)malloc(MaxStages * sizeof(Iir::DirectFormII));
+  }
+  ~CascadeStages() {
+    free(m_stages);
+    free(m_states);
+  }
+  void reset() {
+    Iir::DirectFormII *state = m_states;
+    for (int i = MaxStages; --i >= 0; ++state)
+      state->reset();
+  }
+
+  template <typename Sample> inline Sample filter(const Sample in) {
+    double out = in;
+    Iir::DirectFormII *state = m_states;
+    Iir::Biquad const *stage = m_stages;
+    for (int i = MaxStages; --i >= 0; ++state, ++stage)
+      out = state->process1(out, *stage);
+    return static_cast<Sample>(out);
+  }
+
+  Iir::Cascade::Storage getCascadeStorage() {
+    return Iir::Cascade::Storage(MaxStages, m_stages);
+  }
+
+private:
+  int MaxStages;
+  Iir::Cascade::Stage *m_stages;
+  Iir::DirectFormII *m_states;
+};
+
+// de-templatized for pimpl idom
+// comes from iir from Bernd Porr
+class PoleFilter : Iir::Butterworth::LowPassBase, public CascadeStages {
+public:
+  PoleFilter(int MaxPoles) : CascadeStages((MaxPoles + 1) / 2) {
+    this->MaxPoles = MaxPoles;
+    m_analogStorage = new LayoutStorage(MaxPoles);
+    m_digitalStorage = new LayoutStorage(MaxPoles);
+    // This glues together the factored base classes
+    // with the templatized storage classes.
+    Iir::Butterworth::LowPassBase::setCascadeStorage(this->getCascadeStorage());
+    Iir::Butterworth::LowPassBase::setPrototypeStorage(*m_analogStorage,
+                                                       *m_digitalStorage);
+  }
+  ~PoleFilter() {
+    delete m_analogStorage;
+    delete m_digitalStorage;
+  }
+  void setup(double sampleRate, double cutoffFrequency) {
+    Iir::Butterworth::LowPassBase::setup(MaxPoles, sampleRate, cutoffFrequency);
+  }
+
+private:
+  int MaxPoles;
+  LayoutStorage *m_analogStorage;
+  LayoutStorage *m_digitalStorage;
+};
+
+class ButterworthLowPass_impl {
+public:
+  ButterworthLowPass_impl(flair::filter::ButterworthLowPass *self,
+                          const flair::gui::LayoutPosition *position,
+                          std::string name, uint32_t order,uint32_t nbRow,uint32_t nbCol);
+  ~ButterworthLowPass_impl();
+  void UpdateFrom(const flair::core::io_data *data);
+  flair::core::cvmatrix *output;
+
+private:
+  void settingsChanged(PoleFilter*f,float inputValue);
+  flair::gui::DoubleSpinBox *cutoff, *T;
+  PoleFilter **f;
+  bool first_update;
+  flair::core::Time previous_time;
+  uint32_t order;
+  uint32_t nbRow, nbCol;
+};
+
+#endif // BUTTERWORTHLOWPASS_H_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/EulerDerivative_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/EulerDerivative_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/EulerDerivative_impl.h	(revision 209)
@@ -0,0 +1,52 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file EulerDerivative.h
+ * \brief Classe permettant le calcul d'une derivee d'Euler
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef EULERDERIVATIVE_IMPL_H
+#define EULERDERIVATIVE_IMPL_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class DoubleSpinBox;
+}
+namespace filter {
+class EulerDerivative;
+}
+}
+
+/*! \class EulerDerivative
+* \brief Classe permettant le calcul d'une derivee d'Euler
+*/
+
+class EulerDerivative_impl {
+public:
+  EulerDerivative_impl(flair::filter::EulerDerivative *self,
+                       const flair::gui::LayoutPosition *position,
+                       std::string name,
+                       const flair::core::cvmatrix *init_value = NULL);
+  ~EulerDerivative_impl();
+  void UpdateFrom(const flair::core::io_data *data);
+  flair::core::cvmatrix *output;
+
+private:
+  flair::gui::DoubleSpinBox *T;
+  flair::core::Time previous_time;
+  bool first_update;
+  flair::core::cvmatrix *prev_value;
+};
+
+#endif // EULERDERIVATIVE_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/JoyReference_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/JoyReference_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/JoyReference_impl.h	(revision 209)
@@ -0,0 +1,87 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/29
+//  filename:   JoyReference_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    generation de consignes a partir joystick
+//
+//
+/*********************************************************************/
+
+#ifndef JOYREFERENCE_IMPL_H
+#define JOYREFERENCE_IMPL_H
+
+#include <stdint.h>
+#include <Object.h>
+#include <Quaternion.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+class AhrsData;
+}
+namespace gui {
+class LayoutPosition;
+class GroupBox;
+class DoubleSpinBox;
+class SpinBox;
+class Label;
+class PushButton;
+}
+namespace filter {
+class JoyReference;
+}
+}
+
+class JoyReference_impl {
+
+public:
+  JoyReference_impl(flair::filter::JoyReference *self,
+                    const flair::gui::LayoutPosition *position,
+                    std::string name);
+  ~JoyReference_impl();
+  void SetRollAxis(float value);
+  void SetPitchAxis(float value);
+  void SetYawAxis(float value);
+  void SetAltitudeAxis(float value);
+  float ZRef(void) const;
+  float dZRef(void) const;
+  float RollTrim(void) const;
+  float PitchTrim(void) const;
+  void SetYawRef(float value);
+  void SetZRef(float value);
+  void RollTrimUp(void);
+  void RollTrimDown(void);
+  void PitchTrimUp(void);
+  void PitchTrimDown(void);
+  void Update(flair::core::Time time);
+  void UpdateFrom(const flair::core::io_data *data);
+  flair::core::cvmatrix *output;
+  flair::core::AhrsData *ahrsData;
+
+private:
+  flair::core::cvmatrix *input;
+
+  flair::gui::GroupBox *reglages_groupbox;
+  flair::gui::DoubleSpinBox *deb_roll, *deb_pitch, *deb_wz, *deb_dz;
+  flair::gui::DoubleSpinBox *trim;
+  flair::gui::Label *label_roll, *label_pitch;
+  flair::gui::PushButton *button_roll, *button_pitch;
+
+  float z_ref;
+  flair::core::Quaternion q_z = flair::core::Quaternion(1, 0, 0, 0);
+  float trim_roll, trim_pitch;
+  flair::core::Time previous_time;
+
+  flair::filter::JoyReference *self;
+};
+
+#endif // JOYREFERENCE_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/LowPassFilter_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/LowPassFilter_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/LowPassFilter_impl.h	(revision 209)
@@ -0,0 +1,48 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file LowPassFilter_impl.h
+ * \brief Classe permettant le calcul d'un filtre passe bas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef LOWPASSFILTER_FILTER_IMPL_H
+#define LOWPASSFILTER_FILTER_IMPL_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class SpinBox;
+class DoubleSpinBox;
+}
+namespace filter {
+class LowPassFilter;
+}
+}
+
+class LowPassFilter_impl {
+
+public:
+  LowPassFilter_impl(const flair::filter::LowPassFilter *self,
+                     const flair::gui::LayoutPosition *position,
+                     std::string name,
+                     const flair::core::cvmatrix *init_value = NULL);
+  ~LowPassFilter_impl();
+  void UpdateFrom(const flair::core::io_data *data);
+  flair::core::cvmatrix *output;
+
+private:
+  flair::core::Time previous_time;
+  flair::gui::DoubleSpinBox *freq, *T;
+};
+
+#endif // LOWPASSFILTER_FILTER_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/NestedSat_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/NestedSat_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/NestedSat_impl.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file NestedSat.h
+ * \brief Classe permettant le calcul d'un Pid avec saturations
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/15
+ * \version 4.0
+ */
+
+#ifndef NESTEDSAT_IMPL_H
+#define NESTEDSAT_IMPL_H
+
+#include <Object.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class Layout;
+class LayoutPosition;
+class DoubleSpinBox;
+class DataPlot1D;
+}
+namespace filter {
+class NestedSat;
+}
+}
+
+/*! \class NestedSat
+* \brief Classe permettant le calcul d'un Pid avec saturations
+*/
+class NestedSat_impl {
+public:
+  NestedSat_impl(flair::filter::NestedSat *self,
+                 const flair::gui::LayoutPosition *position, std::string name);
+  ~NestedSat_impl();
+  float Value(void);
+  void UseDefaultPlot(const flair::gui::Layout *layout, int row, int col);
+  void UpdateFrom(const flair::core::io_data *data);
+  void ConvertSatFromDegToRad(void);
+  float k;
+
+private:
+  flair::filter::NestedSat *self;
+  flair::gui::DoubleSpinBox *kp, *kd, *sat, *dsat, *usat;
+  flair::gui::DataPlot1D *plot;
+  float Sat(float value, float borne);
+};
+
+#endif // NESTEDSAT_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/PidThrust_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/PidThrust_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/PidThrust_impl.h	(revision 209)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file PidThrust_impl.h
+ * \brief Classe permettant le calcul d'un Pid
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/11/07
+ * \version 4.0
+ */
+
+#ifndef PIDTHRUST_IMPL_H
+#define PIDTHRUST_IMPL_H
+
+#include <Object.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class LayoutPosition;
+class DoubleSpinBox;
+}
+namespace filter {
+class PidThrust;
+}
+}
+
+/*! \class PidThrust_impl
+* \brief Class defining a PID
+*/
+
+class PidThrust_impl {
+public:
+  PidThrust_impl(flair::filter::PidThrust *self,
+                 const flair::gui::LayoutPosition *position, std::string name);
+  ~PidThrust_impl();
+  void UseDefaultPlot(const flair::gui::LayoutPosition *position);
+  void UpdateFrom(const flair::core::io_data *data);
+  float i, offset_g;
+  flair::gui::DoubleSpinBox *offset, *pas_offset;
+
+private:
+  flair::filter::PidThrust *self;
+  flair::core::Time previous_time;
+  bool first_update;
+
+  // matrix
+  flair::core::cvmatrix *state;
+
+  flair::gui::DoubleSpinBox *T, *kp, *ki, *kd, *sat, *sati;
+};
+
+#endif // PIDTHRUST_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/Pid_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/Pid_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/Pid_impl.h	(revision 209)
@@ -0,0 +1,56 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Pid_impl.h
+ * \brief Classe permettant le calcul d'un Pid
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef PID_IMPL_H
+#define PID_IMPL_H
+
+#include <Object.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class LayoutPosition;
+class DoubleSpinBox;
+}
+namespace filter {
+class Pid;
+}
+}
+
+/*! \class Pid_impl
+* \brief Class defining a PID
+*/
+
+class Pid_impl {
+public:
+  Pid_impl(flair::filter::Pid *self, const flair::gui::LayoutPosition *position,
+           std::string name);
+  ~Pid_impl();
+  void UseDefaultPlot(const flair::gui::LayoutPosition *position);
+  void UpdateFrom(const flair::core::io_data *data);
+  float i;
+  bool first_update;
+
+private:
+  flair::filter::Pid *self;
+  flair::core::Time previous_time;
+
+  // matrix
+  flair::core::cvmatrix *state;
+
+  flair::gui::DoubleSpinBox *T, *kp, *ki, *kd, *sat, *sati;
+};
+
+#endif // PID_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator1D_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator1D_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator1D_impl.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TrajectoryGenerator1D_impl.h
+ * \brief Class generating a trajectory in 1D
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef TRAJECTORYGENERATOR1D_IMPL_H
+#define TRAJECTORYGENERATOR1D_IMPL_H
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class DoubleSpinBox;
+}
+}
+
+/*! \class TrajectoryGenerator1D_impl
+* \brief Class generating a trajectory in 1D
+*/
+class TrajectoryGenerator1D_impl {
+
+public:
+  TrajectoryGenerator1D_impl(flair::filter::TrajectoryGenerator1D *self,
+                             const flair::gui::LayoutPosition *position,
+                             std::string name, std::string unit);
+  ~TrajectoryGenerator1D_impl();
+  void Update(flair::core::Time time);
+  void StartTraj(float start_pos, float end_pos,float startVelocity);
+  void StopTraj(void);
+  void Reset(void);
+  float GetPercentageOfCompletion(void) const;
+  flair::core::cvmatrix *output;
+  float pos_off, vel_off;
+  bool is_finished, is_started;
+
+private:
+  float start_pos,end_pos;
+  float pos, v, acc;
+  flair::core::Time previous_time;
+  bool first_update;
+  flair::gui::DoubleSpinBox *T, *max_veloctity, *acceleration;
+};
+
+#endif // TRAJECTORYGENERATOR1D_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h	(revision 209)
@@ -0,0 +1,61 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TrajectoryGenerator2DCircle_impl.h
+ * \brief Class generating a circle trajectory in 2D
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/08
+ * \version 4.0
+ */
+
+#ifndef TRAJECTORYGENERATOR2DCIRCLE_IMPL_H
+#define TRAJECTORYGENERATOR2DCIRCLE_IMPL_H
+
+#include <Object.h>
+#include <Vector2D.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class LayoutPosition;
+class DoubleSpinBox;
+}
+namespace filter {
+class TrajectoryGenerator2DCircle;
+}
+}
+
+/*! \class TrajectoryGenerator2DCircle_impl
+* \brief Class generating a circle trajectory in 2D
+*/
+
+class TrajectoryGenerator2DCircle_impl {
+
+public:
+  TrajectoryGenerator2DCircle_impl(
+      flair::filter::TrajectoryGenerator2DCircle *self,
+      const flair::gui::LayoutPosition *position, std::string name);
+  ~TrajectoryGenerator2DCircle_impl();
+  void Update(flair::core::Time time);
+  void StartTraj(const flair::core::Vector2Df &start_pos, float nb_lap);
+  void FinishTraj(void);
+  bool is_running;
+  flair::core::cvmatrix *output;
+  flair::core::Vector2Df pos_off, vel_off;
+
+private:
+  flair::core::Time previous_time;
+  float CurrentTime, FinishTime;
+  bool first_update, is_finishing;
+  flair::core::Vector2Df pos;
+  float angle_off;
+  flair::gui::DoubleSpinBox *T, *veloctity, *acceleration, *rayon;
+  float nb_lap;
+};
+
+#endif // TRAJECTORYGENERATOR2DCIRCLE_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/UavMultiplex_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/UavMultiplex_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/UavMultiplex_impl.h	(revision 209)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UavMultiplex_impl.h
+ * \brief Class defining uav multiplexing
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/11
+ * \version 4.0
+ */
+
+#ifndef UAVMULTIPLEX_IMPL_H
+#define UAVMULTIPLEX_IMPL_H
+
+#include <stdint.h>
+#include <string>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class Tab;
+class ComboBox;
+class GroupBox;
+class TabWidget;
+}
+namespace filter {
+class UavMultiplex;
+}
+}
+
+/*! \class UavMultiplex_impl
+*
+* \brief Class defining uav multiplexing
+*/
+class UavMultiplex_impl {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a uav multiplexing
+  *
+  * \param self UavMultiplex
+  * \param name name
+  */
+  UavMultiplex_impl(flair::filter::UavMultiplex *self, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~UavMultiplex_impl();
+
+  flair::core::cvmatrix *input;
+  void SetMultiplexComboBox(std::string name, int index);
+  int MultiplexValue(int index) const;
+
+  flair::gui::TabWidget *tabwidget;
+  flair::gui::Tab *setup_tab;
+
+private:
+  flair::gui::Tab *main_tab;
+  flair::gui::ComboBox **multiplexcombobox;
+  flair::gui::GroupBox *groupbox;
+  flair::filter::UavMultiplex *self;
+};
+
+#endif // UAVMULTIPLEX_IMPL_H
Index: tags/latest/lib/FlairFilter/src/unexported/X4X8Multiplex_impl.h
===================================================================
--- tags/latest/lib/FlairFilter/src/unexported/X4X8Multiplex_impl.h	(revision 209)
+++ tags/latest/lib/FlairFilter/src/unexported/X4X8Multiplex_impl.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file X4X8Multiplex_impl.h
+ * \brief Class defining X4 and X8 multiplexing
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/10
+ * \version 4.0
+ */
+
+#ifndef X4X8MULTIPLEX_IMPL_H
+#define X4X8MULTIPLEX_IMPL_H
+
+#include <string>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class io_data;
+}
+namespace gui {
+class DataPlot1D;
+class ComboBox;
+}
+namespace filter {
+class X4X8Multiplex;
+}
+}
+
+/*! \class X4X8Multiplex_impl
+*
+* \brief Class defining X4 and X8 multiplexing
+*/
+class X4X8Multiplex_impl {
+public:
+  X4X8Multiplex_impl(flair::filter::X4X8Multiplex *self, int nb_mot);
+  ~X4X8Multiplex_impl();
+  void UseDefaultPlot(void);
+  void UpdateFrom(const flair::core::io_data *data);
+  int nb_mot;
+  std::string MotorName(int index);
+
+private:
+  flair::core::cvmatrix *output;
+  flair::gui::ComboBox *pas;
+  flair::gui::DataPlot1D *plots[4];
+  flair::filter::X4X8Multiplex *self;
+  float Set(float trim, float u);
+};
+
+#endif // X4X8MULTIPLEX_IMPL_H
Index: tags/latest/lib/FlairMeta/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairMeta/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairMeta/CMakeLists.txt	(revision 209)
@@ -0,0 +1,52 @@
+PROJECT(FlairMeta)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairSensorActuator/src
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairFilter/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+	${CMAKE_CURRENT_SOURCE_DIR}/src/
+	${CMAKE_SYSROOT}/usr/include/opencv
+)
+
+FILE(GLOB SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SRC_FILES}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+#copie des entetes
+FILE(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
+INSTALL(FILES ${HEADER_FILES} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
Index: tags/latest/lib/FlairMeta/src/HdsX8.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/HdsX8.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/HdsX8.cpp	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/02/08
+//  filename:   HdsX8.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a HDS X8 uav
+//
+//
+/*********************************************************************/
+
+#include "HdsX8.h"
+#include <FrameworkManager.h>
+#include <RTDM_I2cPort.h>
+#include <RTDM_SerialPort.h>
+#include <Srf08.h>
+#include <Gx3_25_ahrs.h>
+#include <BlCtrlV2.h>
+#include <X4X8Multiplex.h>
+#include <Ps3Eye.h>
+#include <Mb800.h>
+#include <FindArgument.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::actuator;
+
+namespace flair {
+namespace meta {
+
+HdsX8::HdsX8(string name,string options,
+             filter::UavMultiplex *multiplex)
+    : Uav(name, multiplex) {
+  RTDM_I2cPort *i2cport = new RTDM_I2cPort(getFrameworkManager(), "rtdm_i2c", "rti2c3");
+  RTDM_SerialPort *imu_port = new RTDM_SerialPort(getFrameworkManager(), "imu_port", "rtser1");
+
+  if (multiplex == NULL)
+    SetMultiplex(new X4X8Multiplex( "motors", X4X8Multiplex::X8));
+
+  SetBldc(new BlCtrlV2(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
+                       "motors", GetUavMultiplex()->MotorsCount(), i2cport));
+  SetUsRangeFinder(new Srf08("SRF08", i2cport, 0x70, 60));
+  SetAhrs(new Gx3_25_ahrs("ahrs", imu_port,
+                          Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
+  SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor());
+  SetVerticalCamera(new Ps3Eye("camv", 0, 50));
+  
+  string useGps=FindArgument(options,"use_gps=",false);
+  if(useGps=="true") {
+    RTDM_SerialPort *gps_port = new RTDM_SerialPort(getFrameworkManager(), "gps_port", "rtser2");
+    SetGps(new Mb800("gps",gps_port,(NmeaGps::NMEAFlags_t)(NmeaGps::GGA|NmeaGps::VTG|NmeaGps::GSA),40));
+  } 
+}
+
+HdsX8::~HdsX8() {}
+
+void HdsX8::StartSensors(void) {
+  ((Gx3_25_imu *)(GetAhrs()->GetImu()))->Start();
+  ((Srf08 *)GetUsRangeFinder())->Start();
+  ((Ps3Eye *)GetVerticalCamera())->Start();
+  if(GetGps()) ((Mb800 *)GetGps())->Start();
+}
+
+bool HdsX8::isReadyToFly(void) const {
+  return GetAhrs()->GetImu()->IsReady();
+}
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/HdsX8.h
===================================================================
--- tags/latest/lib/FlairMeta/src/HdsX8.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/HdsX8.h	(revision 209)
@@ -0,0 +1,38 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file HdsX8.h
+ * \brief Class defining a HDS X8 uav
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/08
+ * \version 4.0
+ */
+
+#ifndef HDSX8_H
+#define HDSX8_H
+
+#include "Uav.h"
+
+namespace flair {
+namespace meta {
+/*! \class HdsX8
+*
+* \brief Class defining a HDS X8 uav
+*/
+class HdsX8 : public Uav {
+public:
+  HdsX8(std::string name,std::string options="",
+        filter::UavMultiplex *multiplex = NULL);
+  ~HdsX8();
+  void StartSensors(void);
+	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
+  bool isReadyToFly(void) const;
+  virtual std::string GetType(void) const{return "hds_x8";}
+
+private:
+};
+} // end namespace meta
+} // end namespace flair
+#endif // HDSX8_H
Index: tags/latest/lib/FlairMeta/src/MetaDualShock3.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaDualShock3.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaDualShock3.cpp	(revision 209)
@@ -0,0 +1,102 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/14
+//  filename:   MetaDualShock3.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant la manette DualShock3 et les consignes joystick
+//
+//
+/*********************************************************************/
+
+#include "MetaDualShock3.h"
+#include "MetaDualShock3_impl.h"
+#include "TargetController.h"
+#include "JoyReference.h"
+#include <Tab.h>
+#include <FrameworkManager.h>
+#include <cvmatrix.h>
+#include <Ahrs.h>
+#include <AhrsData.h>
+#include <DataPlot1D.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::filter;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+namespace flair {
+namespace meta {
+
+MetaDualShock3::MetaDualShock3(string name,
+                               TargetController *controller)
+    : controller(controller),IODevice((IODevice*)controller, name) {
+  pimpl_ = new MetaDualShock3_impl(this, name);
+  getFrameworkManager()->AddDeviceToLog(pimpl_->joy_ref);
+  controller->Start();
+  
+  SetIsReady(true);
+}
+
+MetaDualShock3::~MetaDualShock3() { delete pimpl_; }
+
+AhrsData *MetaDualShock3::GetReferenceOrientation(void) const {
+  return pimpl_->joy_ref->GetReferenceOrientation();
+}
+
+void MetaDualShock3::ErrorNotify(void) {
+    controller->FlashLed(4,10,0);
+    controller->Rumble(0xff,20,0,0);
+}
+
+void MetaDualShock3::Rumble(uint8_t left_force,uint8_t left_timeout,uint8_t right_force,uint8_t right_timeout) {
+    controller->Rumble(left_force,left_timeout,right_force,right_timeout);
+}
+
+void MetaDualShock3::SetLedON(unsigned int ledId) {
+    controller->SetLedOn(ledId);
+}
+
+void MetaDualShock3::SetLedOFF(unsigned int ledId) {
+    controller->SetLedOff(ledId);
+}
+
+void MetaDualShock3::FlashLed(unsigned int ledId,uint8_t on_timeout,uint8_t off_timeout) {
+    controller->FlashLed(ledId,on_timeout,off_timeout);
+}
+
+float MetaDualShock3::ZRef(void) const { return pimpl_->joy_ref->ZRef(); }
+
+float MetaDualShock3::DzRef(void) const { return pimpl_->joy_ref->DzRef(); }
+
+void MetaDualShock3::SetYawRef(float value) {
+  pimpl_->joy_ref->SetYawRef(value);
+}
+
+void MetaDualShock3::SetYawRef(Quaternion const &value) {
+  pimpl_->joy_ref->SetYawRef(value);
+}
+
+void MetaDualShock3::SetZRef(float value) { pimpl_->joy_ref->SetZRef(value); }
+
+float MetaDualShock3::RollTrim(void) const {
+  return pimpl_->joy_ref->RollTrim();
+}
+
+float MetaDualShock3::PitchTrim(void) const {
+    return pimpl_->joy_ref->PitchTrim();
+}
+
+void MetaDualShock3::UpdateFrom(const flair::core::io_data *data) {
+    pimpl_->UpdateFrom(data);
+}
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/MetaDualShock3.h
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaDualShock3.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaDualShock3.h	(revision 209)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file MetaDualShock3.h
+ * \brief Classe intégrant la manette DualShock3 et les consignes joystick
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/14
+ * \version 3.4
+ */
+
+#ifndef METADUALSHOCK3_H
+#define METADUALSHOCK3_H
+
+#include <TargetController.h>
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class AhrsData;
+class Quaternion;
+}
+namespace filter {
+class Ahrs;
+}
+}
+
+class MetaDualShock3_impl;
+
+namespace flair {
+namespace meta {
+
+/*! \class MetaDualShock3
+*
+* \brief Classe intégrant la manette MetaDualShock3
+*/
+class MetaDualShock3 : public core::IODevice {
+  friend class ::MetaDualShock3_impl;
+
+public:
+  MetaDualShock3(std::string name,
+                 sensor::TargetController *controller);
+  ~MetaDualShock3();
+  core::AhrsData *GetReferenceOrientation(void) const;
+  float ZRef(void) const;
+  float DzRef(void) const;
+  void SetYawRef(float value);
+  /*!
+  * \brief Set yaw reference
+  *
+  * Yaw part of the output quaternion is obtained by integrating the wz desired
+  *angular speed.\n
+  * This method reset the yaw.
+  *
+  * \param value value, only the yaw part of the quaternion is used
+  */
+  void SetYawRef(core::Quaternion const &value);
+  void SetZRef(float value);
+  float RollTrim(void) const;
+  float PitchTrim(void) const;
+  void ErrorNotify(void);
+  void Rumble(uint8_t left_force, uint8_t left_timeout = 20,
+              uint8_t right_force = 0, uint8_t right_timeout = 0);
+  void SetLedON(unsigned int ledId);
+  void SetLedOFF(unsigned int ledId);
+  void FlashLed(unsigned int ledId, uint8_t on_timeout, uint8_t off_timeout);
+
+        private:
+            class MetaDualShock3_impl* pimpl_;
+            void UpdateFrom(const flair::core::io_data *data);
+            sensor::TargetController *controller;
+    };
+} // end namespace meta
+} // end namespace flair
+#endif // METADUALSHOCK3_H
Index: tags/latest/lib/FlairMeta/src/MetaDualShock3_impl.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaDualShock3_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaDualShock3_impl.cpp	(revision 209)
@@ -0,0 +1,111 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/14
+//  filename:   MetaDualShock3_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant la manette DualShock3 et les consignes joystick
+//
+//
+/*********************************************************************/
+
+#include "MetaDualShock3_impl.h"
+#include "MetaDualShock3.h"
+#include <JoyReference.h>
+#include <Tab.h>
+#include <cvmatrix.h>
+#include <FrameworkManager.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::meta;
+
+MetaDualShock3_impl::MetaDualShock3_impl(MetaDualShock3 *self, string name) {
+  joy_ref=new JoyReference(self->controller->GetTab()->NewRow(),"consignes joy");
+  this->self = self;
+  joy_init = false;
+  wasRollTrimUpButtonPressed = false;
+  wasRollTrimDownButtonPressed = false;
+  wasPitchTrimUpButtonPressed = false;
+  wasPitchTrimDownButtonPressed = false;
+}
+
+MetaDualShock3_impl::~MetaDualShock3_impl() {}
+
+// receives updates from the controler
+void MetaDualShock3_impl::UpdateFrom(const io_data *data) {
+  cvmatrix *input = (cvmatrix *)data;
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  input->GetMutex();
+
+  // up
+  if (self->controller->IsButtonPressed(12)) {
+    if (!wasPitchTrimDownButtonPressed) {
+      joy_ref->PitchTrimDown();
+      wasPitchTrimDownButtonPressed = true;
+    }
+  } else {
+    wasPitchTrimDownButtonPressed = false;
+  }
+
+  // down
+  if (self->controller->IsButtonPressed(13)) {
+    if (!wasPitchTrimUpButtonPressed) {
+      joy_ref->PitchTrimUp();
+      wasPitchTrimUpButtonPressed = true;
+    }
+  } else {
+    wasPitchTrimUpButtonPressed = false;
+  }
+
+  // right
+  if (self->controller->IsButtonPressed(15)) {
+    if (!wasRollTrimUpButtonPressed) {
+      joy_ref->RollTrimUp();
+      wasRollTrimUpButtonPressed = true;
+    }
+  } else {
+    wasRollTrimUpButtonPressed = false;
+  }
+
+  // left
+  if (self->controller->IsButtonPressed(14)) {
+    if (!wasRollTrimDownButtonPressed) {
+      joy_ref->RollTrimDown();
+      wasRollTrimDownButtonPressed = true;
+    }
+  } else {
+    wasRollTrimDownButtonPressed = false;
+  }
+
+  if (!getFrameworkManager()->ConnectionLost()) {
+    input->GetMutex();
+    joy_ref->SetRollAxis(input->ValueNoMutex(0, 0));
+    joy_ref->SetPitchAxis(input->ValueNoMutex(1, 0));
+    joy_ref->SetYawAxis(input->ValueNoMutex(2, 0));
+    joy_ref->SetAltitudeAxis(input->ValueNoMutex(3, 0));
+    input->ReleaseMutex();
+  } else {
+    joy_ref->SetRollAxis(0);
+    joy_ref->SetPitchAxis(0);
+    joy_ref->SetYawAxis(0);
+    joy_ref->SetAltitudeAxis(0);
+  }
+  input->ReleaseMutex();
+
+  joy_ref->Update(data->DataTime());
+
+  if (!joy_init) {
+    self->controller->FlashLed(1, 10, 10);
+    joy_init = true;
+  }
+}
Index: tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.cpp	(revision 209)
@@ -0,0 +1,71 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   MetaUsRangeFinder.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant une dérivée
+//              d'euler, un passe bas et un generateur de consigne
+//              -> adapté pour un capteur d'altitude
+//
+//
+/*********************************************************************/
+
+#include "MetaUsRangeFinder.h"
+#include "UsRangeFinder.h"
+#include <LowPassFilter.h>
+#include <ButterworthLowPass.h>
+#include <Layout.h>
+#include <DataPlot1D.h>
+#include <Tab.h>
+#include <EulerDerivative.h>
+#include <GroupBox.h>
+#include <cvmatrix.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::sensor;
+
+namespace flair {
+namespace meta {
+
+MetaUsRangeFinder::MetaUsRangeFinder(UsRangeFinder *us)
+    : Object(us, us->ObjectName()) {
+  this->us = us;
+  pbas_z =
+      new ButterworthLowPass(us, us->GetLayout()->NewRow(), "Passe bas", 3);
+  vz_euler = new EulerDerivative(pbas_z, us->GetLayout()->NewRow(), "Vz");
+  pbas_vz = new ButterworthLowPass(vz_euler, us->GetLayout()->NewRow(),
+                                   "Passe bas v", 3);
+}
+
+MetaUsRangeFinder::~MetaUsRangeFinder() {}
+
+void MetaUsRangeFinder::UseDefaultPlot(void) {
+  us->UseDefaultPlot();
+
+  us->GetPlot()->AddCurve(pbas_z->Matrix()->Element(0), DataPlot::Blue);
+
+  vz_plot = new DataPlot1D(us->GetPlotTab()->LastRowLastCol(), "vz", -2, 2);
+  vz_plot->AddCurve(vz_euler->Matrix()->Element(0));
+  vz_plot->AddCurve(pbas_vz->Matrix()->Element(0), DataPlot::Blue);
+}
+
+gui::DataPlot1D *MetaUsRangeFinder::GetZPlot() { return us->GetPlot(); }
+
+gui::DataPlot1D *MetaUsRangeFinder::GetVzPlot() { return vz_plot; }
+
+float MetaUsRangeFinder::z(void) const { return pbas_z->Output(); }
+
+float MetaUsRangeFinder::Vz(void) const { return pbas_vz->Output(); }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.h
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaUsRangeFinder.h	(revision 209)
@@ -0,0 +1,58 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file MetaUsRangeFinder.h
+ * \brief Classe haut niveau pour capteur à ultra son
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/08
+ * \version 3.4
+ */
+
+#ifndef METAUSRANGEFINDER_H
+#define METAUSRANGEFINDER_H
+
+#include <Object.h>
+
+namespace flair {
+namespace filter {
+class ButterworthLowPass;
+class EulerDerivative;
+}
+namespace sensor {
+class UsRangeFinder;
+}
+namespace gui {
+class DataPlot1D;
+}
+}
+
+namespace flair {
+namespace meta {
+/*! \class MetaUsRangeFinder
+*
+* \brief Classe haut niveau pour capteur à ultra son
+*
+* Contient une dérivée d'euler et un passe bas.
+* Cette classe est adaptée pour un capteur d'altitude.
+*/
+class MetaUsRangeFinder : public core::Object {
+public:
+  MetaUsRangeFinder(sensor::UsRangeFinder *us);
+  ~MetaUsRangeFinder();
+  void UseDefaultPlot(void);
+  float z(void) const;
+  float Vz(void) const;
+  gui::DataPlot1D *GetZPlot();
+  gui::DataPlot1D *GetVzPlot();
+
+private:
+  sensor::UsRangeFinder *us;
+  filter::ButterworthLowPass *pbas_z, *pbas_vz;
+  filter::EulerDerivative *vz_euler;
+  gui::DataPlot1D *vz_plot;
+};
+} // end namespace meta
+} // end namespace flair
+#endif // METAUSRANGEFINDER_H
Index: tags/latest/lib/FlairMeta/src/MetaVrpnObject.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 209)
@@ -0,0 +1,103 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   MetaVrpnObject.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant objet vrpn et une dérivée
+//              d'euler
+//
+//
+/*********************************************************************/
+
+#include "MetaVrpnObject.h"
+#include "VrpnClient.h"
+#include <EulerDerivative.h>
+#include <LowPassFilter.h>
+#include <IODevice.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <DataPlot2D.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <cvmatrix.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+
+namespace flair {
+namespace meta {
+
+MetaVrpnObject::MetaVrpnObject(string name)
+    : VrpnObject( name, GetVrpnClient()->GetTabWidget()) {
+  ConstructorCommon(name);
+}
+
+MetaVrpnObject::MetaVrpnObject(std::string name,
+                               uint8_t id)
+    : VrpnObject(name, id, GetVrpnClient()->GetTabWidget()) {
+  ConstructorCommon( name);
+}
+
+void MetaVrpnObject::ConstructorCommon(string name) {
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(7, 1);
+  for (int i = 0; i < desc->Rows(); i++) {
+    desc->SetElementName(i, 0, Output()->Name(i, 0));
+  }
+  cvmatrix *prev_value = new cvmatrix(this, desc, floatType, name);
+  delete desc;
+
+  pbas = new LowPassFilter(this, GetVrpnClient()->GetLayout()->NewRow(),
+                           name + " Passe bas", prev_value);
+  delete prev_value;
+
+  desc = new cvmatrix_descriptor(7, 1);
+  for (int i = 0; i < desc->Rows(); i++) {
+    desc->SetElementName(i, 0, "d" + Output()->Name(i, 0));
+  }
+  prev_value = new cvmatrix(this, desc, floatType, name);
+  delete desc;
+
+  euler = new EulerDerivative(pbas, GetVrpnClient()->GetLayout()->NewRow(),
+                              name + "_euler", prev_value);
+  delete prev_value;
+
+  vx_opti_plot = new DataPlot1D(GetPlotTab()->NewRow(), "vx", -3, 3);
+  vx_opti_plot->AddCurve(euler->Matrix()->Element(4));
+  vy_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vy", -3, 3);
+  vy_opti_plot->AddCurve(euler->Matrix()->Element(5));
+  vz_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vz", -2, 2);
+  vz_opti_plot->AddCurve(euler->Matrix()->Element(6));
+
+  plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name);
+  xy_plot = new DataPlot2D(plot_tab->NewRow(), "xy", "y", -5, 5, "x", -5, 5);
+  xy_plot->AddCurve(Output()->Element(5, 0), Output()->Element(4, 0));
+}
+
+MetaVrpnObject::~MetaVrpnObject() { delete plot_tab; }
+
+DataPlot1D *MetaVrpnObject::VxPlot(void) const { return vx_opti_plot; }
+
+DataPlot1D *MetaVrpnObject::VyPlot(void) const { return vy_opti_plot; }
+
+DataPlot1D *MetaVrpnObject::VzPlot(void) const { return vz_opti_plot; }
+
+DataPlot2D *MetaVrpnObject::XyPlot(void) const { return xy_plot; }
+
+void MetaVrpnObject::GetSpeed(Vector3Df &speed) const {
+  speed.x = euler->Output(4, 0);
+  speed.y = euler->Output(5, 0);
+  speed.z = euler->Output(6, 0);
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/MetaVrpnObject.h
===================================================================
--- tags/latest/lib/FlairMeta/src/MetaVrpnObject.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/MetaVrpnObject.h	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file MetaVrpnObject.h
+ * \brief Classe haut niveau intégrant un objet VRPN
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/08
+ * \version 3.4
+ */
+
+#ifndef METAVRPNOBJECT_H
+#define METAVRPNOBJECT_H
+
+#include <VrpnObject.h>
+#include <io_data.h>
+#include <Vector3D.h>
+
+namespace flair {
+	namespace gui {
+		class DataPlot1D;
+		class DataPlot2D;
+		class Tab;
+	}
+	namespace filter {
+		class EulerDerivative;
+		class LowPassFilter;
+	}
+}
+
+namespace flair {
+namespace meta {
+
+/*! \class MetaVrpnObject
+*
+* \brief Classe haut niveau intégrant un objet VRPN
+*
+* Contient un objet VRPN et une dérivée, d'euler.
+*/
+class MetaVrpnObject : public sensor::VrpnObject {
+public:
+  MetaVrpnObject(std::string name);
+  MetaVrpnObject(std::string name,uint8_t id);
+  ~MetaVrpnObject();
+  gui::DataPlot1D *VxPlot(void) const; // 1,0
+  gui::DataPlot1D *VyPlot(void) const; // 1,1
+  gui::DataPlot1D *VzPlot(void) const; // 1,2
+  gui::DataPlot2D *XyPlot(void) const;
+  void GetSpeed(core::Vector3Df &speed) const;
+
+private:
+  void ConstructorCommon(std::string name);
+  filter::LowPassFilter *pbas;
+  filter::EulerDerivative *euler;
+  gui::DataPlot2D *xy_plot;
+  gui::DataPlot1D *vx_opti_plot, *vy_opti_plot, *vz_opti_plot;
+  gui::Tab *plot_tab;
+};
+} // end namespace meta
+} // end namespace flair
+#endif // METAVRPNOBJECT_H
Index: tags/latest/lib/FlairMeta/src/SimuX4.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/SimuX4.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/SimuX4.cpp	(revision 209)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/08
+//  filename:   SimuX4.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a simulation x4 uav
+//
+//
+/*********************************************************************/
+
+#include "SimuX4.h"
+#include <FrameworkManager.h>
+#include <X4X8Multiplex.h>
+#include <SimuImu.h>
+#include <SimuAhrs.h>
+#include <SimuBldc.h>
+#include <SimuUs.h>
+#include <SimuCamera.h>
+#include <BatteryMonitor.h>
+#include <SimuGps.h>
+#include <Tab.h>
+#include <FindArgument.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::actuator;
+
+namespace flair {
+namespace meta {
+
+SimuX4::SimuX4(string name, uint32_t simu_id,string options,
+               filter::UavMultiplex *multiplex)
+    : Uav(name, multiplex) {
+
+  if (multiplex == NULL)
+    SetMultiplex(new X4X8Multiplex("motors", X4X8Multiplex::X4));
+
+  SetBldc(new SimuBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
+                       "motors", GetUavMultiplex()->MotorsCount(), simu_id,0));
+  SetUsRangeFinder(new SimuUs("us", simu_id,0, 60));
+  SetAhrs(new SimuAhrs("ahrs", simu_id, 0,70));
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
+  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
+  GetBatteryMonitor()->SetBatteryValue(12);
+  
+  uint16_t camvWidth=320,camvHeight=240;
+	ReadCameraResolutionOption(options,"camv",camvWidth,camvHeight);
+  Info("using vertical camera resolution: %ix%i\n",camvWidth, camvHeight);
+  SetVerticalCamera(new SimuCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id,0, 10));
+  
+  uint16_t camhWidth=320,camhHeight=240;
+  ReadCameraResolutionOption(options,"camh",camhWidth,camhHeight);
+  Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight);
+  SetHorizontalCamera(new SimuCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
+  
+  string useGps=FindArgument(options,"use_gps=",false);
+  if(useGps=="true") {
+    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
+  } 
+}
+
+SimuX4::~SimuX4() {}
+
+void SimuX4::StartSensors(void) {
+  ((SimuImu *)(GetAhrs()->GetImu()))->Start();
+  ((SimuUs *)GetUsRangeFinder())->Start();
+  ((SimuCamera *)GetVerticalCamera())->Start();
+  //((SimuCamera *)GetHorizontalCamera())->Start();
+  if(GetGps()) ((SimuGps *)GetGps())->Start();
+}
+
+void SimuX4::ReadCameraResolutionOption(string options,string cameraName,uint16_t &camWidth,uint16_t &camHeight) const {
+  string camOpts=FindArgument(options,cameraName +"=",false);
+	if(camOpts!="") {
+    size_t position=camOpts.find("x");
+    if(position!=std::string::npos) {
+        camWidth=std::stoi(camOpts.substr(0,position));
+        camHeight=std::stoi(camOpts.substr(position+1,std::string::npos));
+    } else {
+      Warn("bad camera resolution parameter (%s) should be WIDTHxHEIGHT format\n",camOpts.c_str());
+    }
+  }
+}
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/SimuX4.h
===================================================================
--- tags/latest/lib/FlairMeta/src/SimuX4.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/SimuX4.h	(revision 209)
@@ -0,0 +1,41 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuX4.h
+ * \brief Class defining a simulation x4 uav
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/08
+ * \version 4.0
+ */
+
+#ifndef SIMUX4_H
+#define SIMUX4_H
+
+#include "Uav.h"
+
+namespace flair {
+namespace meta {
+  
+/*! \class SimuX4
+*
+* \brief Class defining a simulation x4 uav
+*/
+class SimuX4 : public Uav {
+  public:
+    // simu_id: 0 if simulating only one UAV
+    //>0 otherwise
+    SimuX4(std::string name, uint32_t simu_id = 0,std::string options="",
+           filter::UavMultiplex *multiplex = NULL);
+    ~SimuX4();
+    void StartSensors(void);
+    virtual std::string GetType(void) const{return "x4_simu";}
+
+  private:
+    void ReadCameraResolutionOption(std::string options,std::string cameraName,uint16_t &camWidth,uint16_t &camHeight) const;
+  
+};
+} // end namespace meta
+} // end namespace flair
+#endif // SIMUX4_H
Index: tags/latest/lib/FlairMeta/src/SimuX8.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/SimuX8.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/SimuX8.cpp	(revision 209)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/08
+//  filename:   SimuX8.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a simulation x8 uav
+//
+//
+/*********************************************************************/
+
+#include "SimuX8.h"
+#include <FrameworkManager.h>
+#include <X4X8Multiplex.h>
+#include <SimuImu.h>
+#include <SimuAhrs.h>
+#include <SimuBldc.h>
+#include <SimuUs.h>
+#include <SimuCamera.h>
+#include <BatteryMonitor.h>
+#include <SimuGps.h>
+#include <Tab.h>
+#include <FindArgument.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::actuator;
+
+namespace flair {
+namespace meta {
+
+SimuX8::SimuX8(string name, uint32_t simu_id,string options,
+               filter::UavMultiplex *multiplex)
+    : Uav(name, multiplex) {
+
+  if (multiplex == NULL)
+    SetMultiplex(new X4X8Multiplex("motors", X4X8Multiplex::X8));
+
+  SetBldc(new SimuBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
+                       "motors", GetUavMultiplex()->MotorsCount(), simu_id,0));
+  SetUsRangeFinder(new SimuUs("us", simu_id,0, 60));
+  SetAhrs(new SimuAhrs("ahrs", simu_id, 0,70));
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
+  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
+  GetBatteryMonitor()->SetBatteryValue(12);
+  
+  uint16_t camvWidth=320,camvHeight=240;
+	ReadCameraResolutionOption(options,"camv",camvWidth,camvHeight);
+  Info("using vertical camera resolution: %ix%i\n",camvWidth, camvHeight);
+  SetVerticalCamera(new SimuCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id,0, 10));
+  
+  uint16_t camhWidth=320,camhHeight=240;
+  ReadCameraResolutionOption(options,"camh",camhWidth,camhHeight);
+  Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight);
+  SetHorizontalCamera(new SimuCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
+  
+  string useGps=FindArgument(options,"use_gps=",false);
+  if(useGps=="true") {
+    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
+  } 
+}
+
+SimuX8::~SimuX8() {}
+
+void SimuX8::StartSensors(void) {
+  ((SimuImu *)(GetAhrs()->GetImu()))->Start();
+  ((SimuUs *)GetUsRangeFinder())->Start();
+  ((SimuCamera *)GetVerticalCamera())->Start();
+  ((SimuCamera *)GetHorizontalCamera())->Start();
+  if(GetGps()) ((SimuGps *)GetGps())->Start();
+}
+
+void SimuX8::ReadCameraResolutionOption(string options,string cameraName,uint16_t &camWidth,uint16_t &camHeight) const {
+  string camOpts=FindArgument(options,cameraName +"=",false);
+	if(camOpts!="") {
+    size_t position=camOpts.find("x");
+    if(position!=std::string::npos) {
+        camWidth=std::stoi(camOpts.substr(0,position));
+        camHeight=std::stoi(camOpts.substr(position+1,std::string::npos));
+    } else {
+      Warn("bad camera resolution parameter (%s) should be WIDTHxHEIGHT format\n",camOpts.c_str());
+    }
+  }
+}
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/SimuX8.h
===================================================================
--- tags/latest/lib/FlairMeta/src/SimuX8.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/SimuX8.h	(revision 209)
@@ -0,0 +1,40 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuX8.h
+ * \brief Class defining a simulation x8 uav
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/08
+ * \version 4.0
+ */
+
+#ifndef SIMUX8_H
+#define SIMUX8_H
+
+#include "Uav.h"
+
+namespace flair {
+namespace meta {
+/*! \class SimuX8
+*
+* \brief Class defining a simulation x8 uav
+*/
+class SimuX8 : public Uav {
+  public:
+    // simu_id: 0 if simulating only one UAV
+    //>0 otherwise
+    SimuX8(std::string name, uint32_t simu_id = 0,std::string options="",
+           filter::UavMultiplex *multiplex = NULL);
+    ~SimuX8();
+    void StartSensors(void);
+    virtual std::string GetType(void) const{return "simu_x8";}
+  
+  private:
+    void ReadCameraResolutionOption(std::string options,std::string cameraName,uint16_t &camWidth,uint16_t &camHeight) const;
+ 
+};
+} // end namespace meta
+} // end namespace flair
+#endif // SIMUX8_H
Index: tags/latest/lib/FlairMeta/src/Uav.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/Uav.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/Uav.cpp	(revision 209)
@@ -0,0 +1,182 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/06/10
+//  filename:   Uav.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class to construct sensors/actuators depending on uav type
+//
+//
+/*********************************************************************/
+
+#include "Uav.h"
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <VrpnClient.h>
+#include <Ahrs.h>
+#include <Imu.h>
+#include <UavMultiplex.h>
+#include <UsRangeFinder.h>
+#include <NmeaGps.h>
+#include <Bldc.h>
+#include <cvmatrix.h>
+#include "MetaUsRangeFinder.h"
+#include "MetaVrpnObject.h"
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::filter;
+using namespace flair::sensor;
+using namespace flair::actuator;
+
+namespace {
+  flair::meta::Uav *uavSingleton = NULL;
+}
+
+namespace flair {
+namespace meta {
+
+Uav *GetUav(void) { return uavSingleton; }
+	
+Uav::Uav(string name, UavMultiplex *multiplex)
+    : Object(getFrameworkManager(), name) {
+	if (uavSingleton != NULL) {
+    Err("Uav must be instanced only one time\n");
+    return;
+  }
+
+  uavSingleton = this;
+  verticalCamera = NULL;
+  horizontalCamera = NULL;
+  gps = NULL;
+  this->multiplex = multiplex;
+}
+
+Uav::~Uav() {}
+
+void Uav::SetUsRangeFinder(const UsRangeFinder *inUs) {
+  us = (UsRangeFinder *)inUs;
+  meta_us = new MetaUsRangeFinder(us);
+  getFrameworkManager()->AddDeviceToLog(us);
+}
+
+void Uav::SetAhrs(const Ahrs *inAhrs) {
+  ahrs = (Ahrs *)inAhrs;
+  imu = (Imu *)ahrs->GetImu();
+  //only add imu; as ahrs is son of imu, it will be logged together
+  getFrameworkManager()->AddDeviceToLog(imu);
+}
+
+void Uav::SetBldc(const Bldc *inBldc) { bldc = (Bldc *)inBldc; }
+
+void Uav::SetBatteryMonitor(const BatteryMonitor *inBattery) {
+  battery = (BatteryMonitor *)inBattery;
+}
+
+void Uav::SetMultiplex(const UavMultiplex *inMultiplex) {
+  multiplex = (UavMultiplex *)inMultiplex;
+  getFrameworkManager()->AddDeviceToLog(multiplex);
+}
+
+void Uav::SetVerticalCamera(const Camera *inVerticalCamera) {
+  verticalCamera = (Camera *)inVerticalCamera;
+}
+
+void Uav::SetHorizontalCamera(const Camera *inHorizontalCamera) {
+  horizontalCamera = (Camera *)inHorizontalCamera;
+}
+
+void Uav::SetGps(const NmeaGps *inGps) {
+  gps=(NmeaGps*)inGps;
+  getFrameworkManager()->AddDeviceToLog(gps);
+}
+
+void Uav::UseDefaultPlot(void) {
+  multiplex->UseDefaultPlot();
+
+  if (bldc->HasSpeedMeasurement()) {
+    Tab *plot_tab = new Tab(multiplex->GetTabWidget(), "Speeds");
+    DataPlot1D *plots[4];
+    plots[0] = new DataPlot1D(plot_tab->NewRow(), "front left", 0, 7000);
+    plots[1] =
+        new DataPlot1D(plot_tab->LastRowLastCol(), "front right", 0, 7000);
+    plots[2] = new DataPlot1D(plot_tab->NewRow(), "rear left", 0, 7000);
+    plots[3] =
+        new DataPlot1D(plot_tab->LastRowLastCol(), "rear right", 0, 7000);
+
+    if (bldc->MotorsCount() == 8) {
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i), 0),
+            DataPlot::Red, "top");
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i + 4), 0),
+            DataPlot::Blue, "bottom");
+    } else {
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i), 0));
+    }
+  }
+
+  if (bldc->HasCurrentMeasurement()) {
+    Tab *plot_tab = new Tab(multiplex->GetTabWidget(), "Currents");
+    DataPlot1D *plots[4];
+    plots[0] = new DataPlot1D(plot_tab->NewRow(), "front left", 0, 10);
+    plots[1] = new DataPlot1D(plot_tab->LastRowLastCol(), "front right", 0, 10);
+    plots[2] = new DataPlot1D(plot_tab->NewRow(), "rear left", 0, 10);
+    plots[3] = new DataPlot1D(plot_tab->LastRowLastCol(), "rear right", 0, 10);
+
+    if (bldc->MotorsCount() == 8) {
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i), 1),
+            DataPlot::Red, "top");
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i + 4), 1),
+            DataPlot::Blue, "bottom");
+    } else {
+      for (int i = 0; i < 4; i++)
+        plots[i]->AddCurve(
+            bldc->Output()->Element(multiplex->MultiplexValue(i), 1));
+    }
+  }
+
+  meta_us->UseDefaultPlot();
+  ahrs->UseDefaultPlot();
+  if(gps!=NULL) gps->UseDefaultPlot();
+}
+
+UavMultiplex *Uav::GetUavMultiplex(void) const { return multiplex; }
+
+Bldc *Uav::GetBldc(void) const { return bldc; }
+
+Ahrs *Uav::GetAhrs(void) const { return ahrs; }
+
+Imu *Uav::GetImu(void) const { return imu; }
+
+MetaUsRangeFinder *Uav::GetMetaUsRangeFinder(void) const { return meta_us; }
+
+UsRangeFinder *Uav::GetUsRangeFinder(void) const { return us; }
+
+BatteryMonitor *Uav::GetBatteryMonitor(void) const { return battery; }
+
+Camera *Uav::GetVerticalCamera(void) const { return verticalCamera; }
+
+Camera *Uav::GetHorizontalCamera(void) const { return horizontalCamera; }
+
+NmeaGps *Uav::GetGps(void) const { return gps; }
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/Uav.h
===================================================================
--- tags/latest/lib/FlairMeta/src/Uav.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/Uav.h	(revision 209)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Uav.h
+ * \brief Base class to construct sensors/actuators depending on uav type
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/22
+ * \version 3.4
+ */
+
+#ifndef HDSUAV_H
+#define HDSUAV_H
+
+#include <Object.h>
+#include <UsRangeFinder.h>
+
+namespace flair {
+	namespace filter {
+		class Ahrs;
+		class UavMultiplex;
+	}
+	namespace actuator {
+		class Bldc;
+	}
+	namespace sensor {
+		class UsRangeFinder;
+		class BatteryMonitor;
+		class Imu;
+		class Camera;
+		class NmeaGps;
+	}
+}
+
+namespace flair {
+namespace meta {
+class MetaUsRangeFinder;
+
+/*! \class Uav
+*
+* \brief Base class to construct sensors/actuators depending on uav type.
+* The Object is created with 
+*  the FrameworkManager as parent. FrameworkManager must be created before.
+* Only one instance of this class is allowed by program.
+*/
+class Uav : public core::Object {
+public:
+
+  Uav(std::string name,
+      filter::UavMultiplex *multiplex = NULL);
+  ~Uav();
+
+  virtual void StartSensors(void)=0;
+  void UseDefaultPlot(void);
+  actuator::Bldc *GetBldc(void) const;
+  filter::UavMultiplex *GetUavMultiplex(void) const;
+  sensor::Imu *GetImu(void) const;
+  filter::Ahrs *GetAhrs(void) const;
+  MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
+  sensor::UsRangeFinder *GetUsRangeFinder(void) const;
+  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
+  sensor::Camera *GetVerticalCamera(void) const;
+  sensor::Camera *GetHorizontalCamera(void) const;
+  sensor::NmeaGps *GetGps(void) const;
+	virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
+  virtual bool isReadyToFly(void) const { return true;}
+  virtual std::string GetType(void) const=0;
+
+protected:
+  void SetBldc(const actuator::Bldc *bldc);
+  void SetMultiplex(const filter::UavMultiplex *multiplex);
+  void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
+  void SetUsRangeFinder(const sensor::UsRangeFinder *us);
+  void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
+  void SetVerticalCamera(const sensor::Camera *verticalCamera);
+  void SetHorizontalCamera(const sensor::Camera *verticalCamera);
+  void SetGps(const sensor::NmeaGps *gps);
+
+private:
+  sensor::Imu *imu;
+  sensor::NmeaGps *gps;
+  filter::Ahrs *ahrs;
+  actuator::Bldc *bldc;
+  filter::UavMultiplex *multiplex;
+  sensor::UsRangeFinder *us;
+  MetaUsRangeFinder *meta_us;
+  sensor::BatteryMonitor *battery;
+  sensor::Camera *verticalCamera,*horizontalCamera;
+};
+
+/*!
+* \brief get Uav
+*
+* \return the Uav
+*/
+Uav *GetUav(void);
+
+} // end namespace meta
+} // end namespace flair
+#endif // HDSUAV_H
Index: tags/latest/lib/FlairMeta/src/UavFactory.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/UavFactory.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/UavFactory.cpp	(revision 209)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/05
+//  filename:   UavFactory.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:   construct a Uav based on the type name
+//
+//
+/*********************************************************************/
+
+#include "UavFactory.h"
+#include "FrameworkManager.h"
+#include "SimuX4.h"
+#include "SimuX8.h"
+#include "HdsX8.h"
+#include "XAir.h"
+#include "compile_info.h"
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::filter;
+using namespace flair::meta;
+
+namespace { // anonymous
+     vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)> *vectoroffunctions=NULL;
+}
+
+
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairMeta");
+}
+
+
+Uav *CreateUav(string name, string type,string options,
+               UavMultiplex *multiplex) {
+
+  Uav *uav;
+
+  if(vectoroffunctions!=NULL) {
+    for(int i=0;i<vectoroffunctions->size();i++) {
+      uav=vectoroffunctions->at(i)(name,type,options,multiplex);
+      if(uav!=NULL) {
+        free(vectoroffunctions);
+        vectoroffunctions=NULL;
+        return uav;
+      }
+    }
+  }
+
+  if (type == "hds_x4") {
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", type.c_str());
+    return NULL;
+  } else if (type == "hds_x8") {
+    return new HdsX8(name,options, multiplex);
+  } else if (type == "xair") {
+    return new XAir(name,options, multiplex);
+  } else if (type == "hds_xufo") {
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", type.c_str());
+    return NULL;
+  } else if (type.compare(0, 7, "x4_simu") == 0) {
+    int simu_id = 0;
+    if (type.size() > 7) {
+      simu_id = atoi(type.substr(7, type.size() - 7).c_str());
+    }
+    return new SimuX4(name, simu_id,options, multiplex);
+  } else if (type.compare(0, 7, "x8_simu") == 0) {
+    int simu_id = 0;
+    if (type.size() > 7) {
+      simu_id = atoi(type.substr(7, type.size() - 7).c_str());
+    }
+    return new SimuX8(name, simu_id,options, multiplex);
+  } else {
+    getFrameworkManager()->Err("UAV type %s unknown\n", type.c_str());
+    return NULL;
+  }
+}
+
+void RegisterUavCreator(flair::meta::Uav*(*func)(string,string,string,UavMultiplex*)) {
+  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)>));
+
+  vectoroffunctions->push_back(func);
+}
Index: tags/latest/lib/FlairMeta/src/UavFactory.h
===================================================================
--- tags/latest/lib/FlairMeta/src/UavFactory.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/UavFactory.h	(revision 209)
@@ -0,0 +1,28 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/05
+//  filename:   UavFactory.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:   construct a Uav based on the type name
+//
+//
+/*********************************************************************/
+
+#ifndef UAVFACTORY
+#define UAVFACTORY
+
+#include <Uav.h>
+
+flair::meta::Uav *CreateUav(std::string name, std::string type,std::string options="",
+                            flair::filter::UavMultiplex *multiplex = NULL);
+
+void RegisterUavCreator(flair::meta::Uav*(*func)(std::string,std::string,std::string,
+                                   flair::filter::UavMultiplex*));
+#endif // UAVFACTORY
Index: tags/latest/lib/FlairMeta/src/UavStateMachine.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/UavStateMachine.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/UavStateMachine.cpp	(revision 209)
@@ -0,0 +1,768 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/29
+//  filename:   UavStateMachine.cpp
+//
+//  author:     Gildas Bayard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    meta class for UAV
+//
+//
+/*********************************************************************/
+
+#include "UavStateMachine.h"
+#include "Uav.h"
+#include <DataPlot1D.h>
+#include <GridLayout.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <PushButton.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+#include <X4X8Multiplex.h>
+#include <Bldc.h>
+#include <Ahrs.h>
+#include <MetaUsRangeFinder.h>
+#include <ControlLaw.h>
+#include <Pid.h>
+#include <PidThrust.h>
+#include <NestedSat.h>
+#include <MetaDualShock3.h>
+#include <AhrsData.h>
+#include <BatteryMonitor.h>
+#include <FrameworkManager.h>
+#include <Vector3D.h>
+#include <Vector2D.h>
+#include <cvmatrix.h>
+#include <stdio.h>
+#include <TrajectoryGenerator1D.h>
+#include <math.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::actuator;
+using namespace flair::filter;
+using namespace flair::meta;
+
+UavStateMachine::UavStateMachine(TargetController *controller):
+        Thread(getFrameworkManager(),"UavStateMachine",50),
+        uav(GetUav()),controller(controller),failSafeMode(true),flagConnectionLost(false),flagBatteryLow(false),flagCriticalSensorLost(false),flagZTrajectoryFinished(false),safeToFly(true){
+    altitudeState=AltitudeState_t::Stopped;
+    uav->UseDefaultPlot();
+
+  Tab *uavTab = new Tab(getFrameworkManager()->GetTabWidget(), "uav", 0);
+  buttonslayout = new GridLayout(uavTab->NewRow(), "buttons");
+  button_kill = new PushButton(buttonslayout->NewRow(), "kill");
+  button_start_log = new PushButton(buttonslayout->NewRow(), "start_log");
+  button_stop_log = new PushButton(buttonslayout->LastRowLastCol(), "stop_log");
+  button_take_off = new PushButton(buttonslayout->NewRow(), "take_off");
+  button_land = new PushButton(buttonslayout->LastRowLastCol(), "land");
+
+  Tab *lawTab = new Tab(getFrameworkManager()->GetTabWidget(), "control laws");
+  TabWidget *tabWidget = new TabWidget(lawTab->NewRow(), "laws");
+  setupLawTab = new Tab(tabWidget, "Setup");
+  graphLawTab = new Tab(tabWidget, "Graphes");
+
+  uRoll = new NestedSat(setupLawTab->At(0, 0), "u_roll");
+  uRoll->ConvertSatFromDegToRad();
+  uRoll->UseDefaultPlot(graphLawTab->NewRow());
+
+  uPitch = new NestedSat(setupLawTab->At(0, 1), "u_pitch");
+  uPitch->ConvertSatFromDegToRad();
+  uPitch->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+  uYaw = new Pid(setupLawTab->At(0, 2), "u_yaw");
+  uYaw->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+  uZ = new PidThrust(setupLawTab->At(1, 2), "u_z");
+  uZ->UseDefaultPlot(graphLawTab->LastRowLastCol());
+
+  getFrameworkManager()->AddDeviceToLog(uZ);
+  uZ->AddDeviceToLog(uRoll);
+  uZ->AddDeviceToLog(uPitch);
+  uZ->AddDeviceToLog(uYaw);
+
+    joy=new MetaDualShock3("uav high level controller",controller);
+    uav->GetAhrs()->AddPlot(joy->GetReferenceOrientation(),DataPlot::Blue);
+
+  altitudeMode = AltitudeMode_t::Manual;
+  orientationMode = OrientationMode_t::Manual;
+  thrustMode = ThrustMode_t::Default;
+  torqueMode = TorqueMode_t::Default;
+
+  GroupBox *reglagesGroupbox =
+      new GroupBox(uavTab->NewRow(), "takeoff/landing");
+  desiredTakeoffAltitude =
+      new DoubleSpinBox(reglagesGroupbox->NewRow(), "desired takeoff altitude",
+                        " m", 0, 5, 0.1, 2, 1);
+  desiredLandingAltitude =
+      new DoubleSpinBox(reglagesGroupbox->LastRowLastCol(),
+                        "desired landing altitude", " m", 0, 1, 0.1, 1);
+  altitudeTrajectory =
+      new TrajectoryGenerator1D(uavTab->NewRow(), "alt cons", "m");
+  uav->GetMetaUsRangeFinder()->GetZPlot()->AddCurve(
+      altitudeTrajectory->Matrix()->Element(0), DataPlot::Green);
+  uav->GetMetaUsRangeFinder()->GetVzPlot()->AddCurve(
+      altitudeTrajectory->Matrix()->Element(1), DataPlot::Green);
+}
+
+UavStateMachine::~UavStateMachine() {}
+
+void UavStateMachine::AddDeviceToControlLawLog(const IODevice *device) {
+  uZ->AddDeviceToLog(device);
+}
+
+void UavStateMachine::AddDataToControlLawLog(const core::io_data *data) {
+  uZ->AddDataToLog(data);
+}
+
+const TargetController *UavStateMachine::GetJoystick(void) const {
+    return controller;
+}
+
+const Quaternion &UavStateMachine::GetCurrentQuaternion(void) const {
+  return currentQuaternion;
+}
+
+const Vector3Df &UavStateMachine::GetCurrentAngularSpeed(void) const {
+  return currentAngularSpeed;
+}
+
+void UavStateMachine::AltitudeValues(float &altitude,
+                                     float &verticalSpeed) const {
+  FailSafeAltitudeValues(altitude, verticalSpeed);
+}
+
+void UavStateMachine::FailSafeAltitudeValues(float &altitude,
+                                             float &verticalSpeed) const {
+  altitude = uav->GetMetaUsRangeFinder()->z();
+  verticalSpeed = uav->GetMetaUsRangeFinder()->Vz();
+}
+
+void UavStateMachine::Run() {
+  WarnUponSwitches(true);
+  uav->StartSensors();
+
+  if (getFrameworkManager()->ErrorOccured() == true) {
+    SafeStop();
+  }
+
+  while (!ToBeStopped()) {
+    SecurityCheck();
+
+    // get controller inputs
+    CheckJoystick();
+    CheckPushButton();
+
+    if (IsPeriodSet()) {
+      WaitPeriod();
+    } else {
+      WaitUpdate(uav->GetAhrs());
+    }
+    needToComputeDefaultTorques = true;
+    needToComputeDefaultThrust = true;
+
+    SignalEvent(Event_t::EnteringControlLoop);
+
+    ComputeOrientation();
+    ComputeAltitude();
+
+    // compute thrust and torques to apply
+    ComputeTorques();
+    ComputeThrust(); // logs are added to uz, so it must be updated at last
+
+    //check nan/inf problems
+    if(!IsValuePossible(currentTorques.roll,"roll torque")
+       || !IsValuePossible(currentTorques.pitch,"pitch torque")
+       || !IsValuePossible(currentTorques.yaw,"yaw torque")
+       || !IsValuePossible(currentThrust,"thrust")) {
+
+        if(altitudeState==AltitudeState_t::Stopped) {
+            SafeStop();
+        } else {
+
+          if(failSafeMode) {
+            Warn("We are already in safe mode, the uav is going to crash!\n");
+          } else {
+            Thread::Warn("switching back to safe mode\n");
+            EnterFailSafeMode();
+            needToComputeDefaultTorques = true;//should not be necessary, but put it to be sure to compute default thrust/torques
+            needToComputeDefaultThrust = true;
+
+            ComputeTorques();
+            ComputeThrust();
+          }
+        }
+    }
+
+    // Set torques for roll, pitch and yaw angles (value between -1 and 1). Set
+    // thrust (value between 0 and 1)
+    uav->GetUavMultiplex()->SetRoll(-currentTorques.roll);
+    uav->GetUavMultiplex()->SetPitch(-currentTorques.pitch);
+    uav->GetUavMultiplex()->SetYaw(-currentTorques.yaw);
+    uav->GetUavMultiplex()->SetThrust(-currentThrust); // on raisonne en negatif
+                                                       // sur l'altitude, a
+                                                       // revoir avec les
+                                                       // equations
+    uav->GetUavMultiplex()->SetRollTrim(joy->RollTrim());
+    uav->GetUavMultiplex()->SetPitchTrim(joy->PitchTrim());
+    uav->GetUavMultiplex()->SetYawTrim(0);
+    uav->GetUavMultiplex()->Update(GetTime());
+  }
+
+  WarnUponSwitches(false);
+}
+
+bool UavStateMachine::IsValuePossible(float value,std::string desc) {
+  if(isnan(value)) {
+    Warn("%s is not an number\n",desc.c_str());
+    return false;
+  } else if(isinf(value)) {
+    Warn("%s is infinite\n",desc.c_str());
+    return false;
+  } else {
+    return true;
+  }
+}
+
+
+void UavStateMachine::ComputeOrientation(void) {
+  if (failSafeMode) {
+    GetDefaultOrientation()->GetQuaternionAndAngularRates(currentQuaternion,
+                                                          currentAngularSpeed);
+  } else {
+    GetOrientation()->GetQuaternionAndAngularRates(currentQuaternion,
+                                                   currentAngularSpeed);
+  }
+}
+
+const AhrsData *UavStateMachine::GetOrientation(void) const {
+  return GetDefaultOrientation();
+}
+
+const AhrsData *UavStateMachine::GetDefaultOrientation(void) const {
+  return uav->GetAhrs()->GetDatas();
+}
+
+void UavStateMachine::ComputeAltitude(void) {
+  if (failSafeMode) {
+    FailSafeAltitudeValues(currentAltitude, currentVerticalSpeed);
+  } else {
+    AltitudeValues(currentAltitude, currentVerticalSpeed);
+  }
+}
+
+void UavStateMachine::ComputeReferenceAltitude(float &refAltitude,
+                                               float &refVerticalVelocity) {
+  if (altitudeMode == AltitudeMode_t::Manual) {
+    GetDefaultReferenceAltitude(refAltitude, refVerticalVelocity);
+  } else {
+    GetReferenceAltitude(refAltitude, refVerticalVelocity);
+  }
+}
+
+void UavStateMachine::GetDefaultReferenceAltitude(float &refAltitude,
+                                                  float &refVerticalVelocity) {
+  float zc, dzc;
+
+  switch (altitudeState) {
+  // initiate a takeoff: increase motor speed in open loop (see ComputeThrust)
+  // until we detect a take off of 0.03m (hard coded value) above the ground.
+  case AltitudeState_t::TakingOff: {
+    if (currentAltitude > groundAltitude + 0.03) {
+      altitudeTrajectory->StartTraj(currentAltitude,
+                                    desiredTakeoffAltitude->Value(),currentVerticalSpeed);
+      altitudeState = AltitudeState_t::Stabilized;
+      SignalEvent(Event_t::Stabilized);
+    }
+    break;
+  }
+  // landing, only check if we reach desired landing altitude
+  case AltitudeState_t::StartLanding: {
+    if (altitudeTrajectory->Position() == desiredLandingAltitude->Value()) {
+      // The Uav target altitude has reached its landing value (typically 0)
+      // but the real Uav altitude may not have reach this value yet because of
+      // command delay. Moreover, it may never exactly reach this value if the
+      // ground is not perfectly leveled (critical case: there's a
+      // deep and narrow hole right in the sensor line of sight). That's why we
+      // have a 2 phases landing strategy.
+      altitudeState = AltitudeState_t::FinishLanding;
+      SignalEvent(Event_t::FinishLanding);
+      joy->SetLedOFF(1); // DualShock3::led1
+    }
+  }
+  // stabilized: check if z trajectory is finished
+  case AltitudeState_t::Stabilized: {
+    if (!altitudeTrajectory->IsRunning() && !flagZTrajectoryFinished) {
+      flagZTrajectoryFinished = true;
+      SignalEvent(Event_t::ZTrajectoryFinished);
+    }
+    if (flagZTrajectoryFinished && desiredTakeoffAltitude->ValueChanged()) {
+      flagZTrajectoryFinished = false;
+      altitudeTrajectory->StartTraj(currentAltitude,
+                                    desiredTakeoffAltitude->Value());
+      joy->SetZRef(0);
+    }
+  }
+  }
+
+  // Récupère les consignes (du joystick dans l'implémentation par défaut). La
+  // consigne joystick est une vitesse ("delta_z", dzc). le zc est calculé par
+  // la manette
+  zc = joy->ZRef(); // a revoir, la position offset devrait se calculer dans le
+                    // generator
+  dzc = joy->DzRef();
+
+  // z control law
+  altitudeTrajectory->SetPositionOffset(zc);
+  altitudeTrajectory->SetSpeedOffset(dzc);
+
+  altitudeTrajectory->Update(GetTime());
+  refAltitude = altitudeTrajectory->Position();
+  refVerticalVelocity = altitudeTrajectory->Speed();
+}
+
+void UavStateMachine::GetReferenceAltitude(float &refAltitude,
+                                           float &refVerticalVelocity) {
+  Thread::Warn("Default GetReferenceAltitude method is not overloaded => "
+               "switching back to safe mode\n");
+  EnterFailSafeMode();
+};
+
+void UavStateMachine::ComputeThrust(void) {
+  if (altitudeMode == AltitudeMode_t::Manual) {
+    currentThrust = ComputeDefaultThrust();
+  } else {
+    currentThrust = ComputeCustomThrust();
+  }
+}
+
+float UavStateMachine::ComputeDefaultThrust(void) {
+  if (needToComputeDefaultThrust) {
+    // compute desired altitude
+    float refAltitude, refVerticalVelocity;
+    ComputeReferenceAltitude(refAltitude, refVerticalVelocity);
+
+    switch (altitudeState) {
+    case AltitudeState_t::TakingOff: {
+      // The progressive increase in motor speed is used to evaluate the motor
+      // speed that compensate the uav weight. This value
+      // will be used as an offset for altitude control afterwards
+      uZ->OffsetStepUp();
+      break;
+    }
+    case AltitudeState_t::StartLanding:
+    case AltitudeState_t::Stabilized: {
+      float p_error = currentAltitude - refAltitude;
+      float d_error = currentVerticalSpeed - refVerticalVelocity;
+      uZ->SetValues(p_error, d_error);
+      break;
+    }
+    // decrease motor speed in open loop until value offset_g , uav should have
+    // already landed or be very close to at this point
+    case AltitudeState_t::FinishLanding: {
+      if (uZ->OffsetStepDown() == false) {
+        StopMotors();
+      }
+      break;
+    }
+    }
+    uZ->Update(GetTime());
+
+    savedDefaultThrust = uZ->Output();
+    needToComputeDefaultThrust = false;
+  }
+
+  return savedDefaultThrust;
+}
+
+float UavStateMachine::ComputeCustomThrust(void) {
+  Thread::Warn("Default GetThrust method is not overloaded => switching back "
+               "to safe mode\n");
+  EnterFailSafeMode();
+  return ComputeDefaultThrust();
+}
+
+const AhrsData *UavStateMachine::ComputeReferenceOrientation(void) {
+  if (orientationMode == OrientationMode_t::Manual) {
+    return GetDefaultReferenceOrientation();
+  } else {
+    return GetReferenceOrientation();
+  }
+}
+
+const AhrsData *UavStateMachine::GetDefaultReferenceOrientation(void) const {
+  // We directly control yaw, pitch, roll angles
+  return joy->GetReferenceOrientation();
+}
+
+const AhrsData *UavStateMachine::GetReferenceOrientation(void) {
+  Thread::Warn("Default GetReferenceOrientation method is not overloaded => "
+               "switching back to safe mode\n");
+  EnterFailSafeMode();
+  return GetDefaultReferenceOrientation();
+}
+
+void UavStateMachine::ComputeTorques(void) {
+  if (torqueMode == TorqueMode_t::Default) {
+    ComputeDefaultTorques(currentTorques);
+  } else {
+    ComputeCustomTorques(currentTorques);
+  }
+}
+
+void UavStateMachine::ComputeDefaultTorques(Euler &torques) {
+  if (needToComputeDefaultTorques) {
+    const AhrsData *refOrientation = ComputeReferenceOrientation();
+    Quaternion refQuaternion;
+    Vector3Df refAngularRates;
+    refOrientation->GetQuaternionAndAngularRates(refQuaternion,
+                                                 refAngularRates);
+    Euler refAngles = refQuaternion.ToEuler();
+    Euler currentAngles = currentQuaternion.ToEuler();
+
+    uYaw->SetValues(currentAngles.YawDistanceFrom(refAngles.yaw),
+                    currentAngularSpeed.z - refAngularRates.z);
+    uYaw->Update(GetTime());
+    torques.yaw = uYaw->Output();
+
+    uPitch->SetValues(refAngles.pitch, currentAngles.pitch,
+                      currentAngularSpeed.y);
+    uPitch->Update(GetTime());
+    torques.pitch = uPitch->Output();
+
+    uRoll->SetValues(refAngles.roll, currentAngles.roll, currentAngularSpeed.x);
+    uRoll->Update(GetTime());
+    torques.roll = uRoll->Output();
+
+    savedDefaultTorques = torques;
+    needToComputeDefaultTorques = false;
+  } else {
+    torques = savedDefaultTorques;
+  }
+}
+
+void UavStateMachine::ComputeCustomTorques(Euler &torques) {
+  Thread::Warn("Default ComputeCustomTorques method is not overloaded => "
+               "switching back to safe mode\n");
+  EnterFailSafeMode();
+  ComputeDefaultTorques(torques);
+}
+
+void UavStateMachine::TakeOff(void) {
+  flagZTrajectoryFinished = false;
+
+  if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly()  && uav->GetBatteryMonitor()->IsBatteryLow()==false && !flagConnectionLost) {
+    //The uav always takes off in fail safe mode
+    flagBatteryLow=false;
+    EnterFailSafeMode();
+    joy->SetLedOFF(4);//DualShock3::led4
+    joy->SetLedOFF(1);//DualShock3::led1
+    joy->Rumble(0x70);
+    joy->SetZRef(0);
+
+    uZ->SetDefaultOffset(); // positionne l'offset de compensation de la gravité à sa
+                     // valeur initiale (station sol)
+
+    uav->GetUavMultiplex()->LockUserInterface();
+    // Active les moteurs. Pouvoir les désactiver permet de pouvoir observer les
+    // consignes moteurs
+    // sans les faire tourner effectivement (en déplaçant à la main le drone)
+    uav->GetBldc()->SetEnabled(true);
+    groundAltitude = currentAltitude;
+    altitudeState = AltitudeState_t::TakingOff;
+    SignalEvent(Event_t::TakingOff);
+  } else {
+    Warn("cannot takeoff\n");
+    joy->ErrorNotify();
+  }
+}
+
+void UavStateMachine::Land(void) {
+  if (altitudeMode != AltitudeMode_t::Manual) {
+    SetAltitudeMode(AltitudeMode_t::Manual);
+  }
+  if (altitudeState == AltitudeState_t::Stabilized) {
+    joy->SetLedOFF(4); // DualShock3::led4
+    joy->Rumble(0x70);
+
+        altitudeTrajectory->StopTraj();
+        joy->SetZRef(0);
+        altitudeTrajectory->StartTraj(currentAltitude,desiredLandingAltitude->Value()); //shouldn't it be groundAltitude?
+        altitudeState=AltitudeState_t::StartLanding;
+        SignalEvent(Event_t::StartLanding);
+    } else if (altitudeState==AltitudeState_t::TakingOff) {
+        EmergencyLand();
+    } else {
+        joy->ErrorNotify();
+    }
+}
+
+void UavStateMachine::EmergencyLand(void) {
+    //Gradually decrease motor speed
+    //Called if landing is required during take off (motors are accelerating but Uav did not actually left the ground yet), or if critical sensors have been lost (attitude is lost)
+    altitudeState=AltitudeState_t::FinishLanding;
+    safeToFly=false;
+Printf("Emergency landing!\n");
+}
+
+void UavStateMachine::SignalEvent(Event_t event) {
+  switch (event) {
+  case Event_t::StartLanding:
+    Thread::Info("Altitude: entering 'StartLanding' state\n");
+    break;
+  case Event_t::Stopped:
+    Thread::Info("Altitude: entering 'Stopped' state\n");
+    break;
+  case Event_t::TakingOff:
+    Thread::Info("Altitude: taking off\n");
+    break;
+  case Event_t::Stabilized:
+    Thread::Info("Altitude: entering 'Stabilized' state\n");
+    break;
+  case Event_t::FinishLanding:
+    Thread::Info("Altitude: entering 'FinishLanding' state\n");
+    break;
+  case Event_t::EmergencyStop:
+    Thread::Info("Emergency stop!\n");
+    break;
+  }
+}
+
+void UavStateMachine::EmergencyStop(void) {
+    if(altitudeState!=AltitudeState_t::Stopped) {
+        StopMotors();
+        EnterFailSafeMode();
+        joy->Rumble(0x70);
+        SignalEvent(Event_t::EmergencyStop);
+    }
+    //safeToFly=false;
+    //Warn("Emergency stop, UAV will not take off again until program is rerunned\n");
+}
+
+void UavStateMachine::StopMotors(void) {
+  joy->FlashLed(1, 10, 10); // DualShock3::led1
+  uav->GetBldc()->SetEnabled(false);
+  uav->GetUavMultiplex()->UnlockUserInterface();
+  altitudeState = AltitudeState_t::Stopped;
+  SignalEvent(Event_t::Stopped);
+  uav->GetAhrs()->UnlockUserInterface();
+
+  uZ->SetValues(0, 0);
+  uZ->Reset();
+}
+
+GridLayout *UavStateMachine::GetButtonsLayout(void) const {
+  return buttonslayout;
+}
+
+void UavStateMachine::SecurityCheck(void) {
+  MandatorySecurityCheck();
+  ExtraSecurityCheck();
+}
+
+void UavStateMachine::MandatorySecurityCheck(void) {
+  if (getFrameworkManager()->ConnectionLost() && !flagConnectionLost) {
+    flagConnectionLost = true;
+    
+    EnterFailSafeMode();
+    if (altitudeState == AltitudeState_t::Stopped) {
+      Thread::Warn("Connection lost\n");
+      Thread::Warn("UAV won't take off\n");
+    } else {
+      Thread::Err("Connection lost\n");
+      Land();
+    }
+  }
+    if((altitudeState==AltitudeState_t::TakingOff || altitudeState==AltitudeState_t::Stabilized) && uav->GetBatteryMonitor()->IsBatteryLow() && !flagBatteryLow) {
+        flagBatteryLow=true;
+        Thread::Err("Low Battery\n");
+        EnterFailSafeMode();
+        Land();
+    }/*
+    Time now=GetTime();
+    if ((altitudeState==AltitudeState_t::Stopped) && (now-uav->GetAhrs()->lastUpdate>(Time)100*1000*1000)) { //100ms
+        flagCriticalSensorLost=true;
+        Thread::Err("Critical sensor lost\n");
+        EnterFailSafeMode();
+        EmergencyLand();
+    }*/
+}
+
+void UavStateMachine::CheckJoystick(void) {
+  GenericCheckJoystick();
+  ExtraCheckJoystick();
+}
+
+void UavStateMachine::GenericCheckJoystick(void) {
+  static bool isEmergencyStopButtonPressed = false;
+  static bool isTakeOffButtonPressed = false;
+  static bool isSafeModeButtonPressed = false;
+
+  if (controller->IsButtonPressed(1)) { // select
+    if (!isEmergencyStopButtonPressed) {
+      isEmergencyStopButtonPressed = true;
+      Thread::Info("Emergency stop from joystick\n");
+      EmergencyStop();
+    }
+  } else
+    isEmergencyStopButtonPressed = false;
+
+  if (controller->IsButtonPressed(0)) { // start
+    if (!isTakeOffButtonPressed) {
+      isTakeOffButtonPressed = true;
+      switch (altitudeState) {
+      case AltitudeState_t::Stopped:
+        TakeOff();
+        break;
+      case AltitudeState_t::Stabilized:
+        Land();
+        break;
+      default:
+        joy->ErrorNotify();
+        break;
+      }
+    }
+  } else
+    isTakeOffButtonPressed = false;
+
+  // cross
+  // gsanahuj:conflict with Majd programs.
+  // check if l1,l2,r1 and r2 are not pressed
+  // to allow a combination in user program
+  if (controller->IsButtonPressed(5) && !controller->IsButtonPressed(6) &&
+      !controller->IsButtonPressed(7) && !controller->IsButtonPressed(9) &&
+      !controller->IsButtonPressed(10)) {
+    if (!isSafeModeButtonPressed) {
+      isSafeModeButtonPressed = true;
+      Thread::Info("Entering fail safe mode\n");
+      EnterFailSafeMode();
+    }
+  } else
+    isSafeModeButtonPressed = false;
+}
+
+void UavStateMachine::CheckPushButton(void) {
+  GenericCheckPushButton();
+  ExtraCheckPushButton();
+}
+
+void UavStateMachine::GenericCheckPushButton(void) {
+  if (button_kill->Clicked() == true)
+    SafeStop();
+  if (button_take_off->Clicked() == true)
+    TakeOff();
+  if (button_land->Clicked() == true)
+    Land();
+  if (button_start_log->Clicked() == true)
+    getFrameworkManager()->StartLog();
+  if (button_stop_log->Clicked() == true)
+    getFrameworkManager()->StopLog();
+}
+
+void UavStateMachine::EnterFailSafeMode(void) {
+  if(altitudeState!=AltitudeState_t::StartLanding) SetAltitudeMode(AltitudeMode_t::Manual);//
+  SetOrientationMode(OrientationMode_t::Manual);
+  SetThrustMode(ThrustMode_t::Default);
+  SetTorqueMode(TorqueMode_t::Default);
+
+  GetDefaultOrientation()->GetQuaternionAndAngularRates(currentQuaternion,
+                                                        currentAngularSpeed);
+  joy->SetYawRef(currentQuaternion);
+  uYaw->Reset();
+  uPitch->Reset();
+  uRoll->Reset();
+
+  failSafeMode = true;
+  SignalEvent(Event_t::EnteringFailSafeMode);
+}
+
+bool UavStateMachine::ExitFailSafeMode(void) {
+  // only exit fail safe mode if in Stabilized altitude state
+  // gsanahuj: pour la demo inaugurale on ne peut pas etre en failsafe
+  // le ruban perturbe l'us
+  /*
+    if (altitudeState!=AltitudeState_t::Stabilized) {
+        return false;
+    } else*/ {
+    failSafeMode = false;
+    return true;
+  }
+}
+
+bool UavStateMachine::SetTorqueMode(TorqueMode_t const &newTorqueMode) {
+  if ((newTorqueMode == TorqueMode_t::Custom) && (failSafeMode)) {
+    if (!ExitFailSafeMode())
+      return false;
+  }
+  // When transitionning from Custom to Default torque mode, we should reset the
+  // default control laws
+  if ((torqueMode == TorqueMode_t::Custom) &&
+      (newTorqueMode == TorqueMode_t::Default)) {
+    uYaw->Reset();
+    uPitch->Reset();
+    uRoll->Reset();
+  }
+  torqueMode = newTorqueMode;
+  return true;
+}
+
+bool UavStateMachine::SetAltitudeMode(AltitudeMode_t const &newAltitudeMode) {
+  if ((newAltitudeMode == AltitudeMode_t::Custom) && (failSafeMode)) {
+    if (!ExitFailSafeMode())
+      return false;
+  }
+  altitudeMode = newAltitudeMode;
+  //avoid starting trajectory at take off (it will be started when altitudeState==AltitudeState_t::Stabilized)
+  if(altitudeState!=AltitudeState_t::Stopped) GotoAltitude(desiredTakeoffAltitude->Value());
+
+  return true;
+}
+
+bool UavStateMachine::GotoAltitude(float desiredAltitude) {
+  if (altitudeMode != AltitudeMode_t::Manual) {
+    return false;
+  }
+  altitudeTrajectory->StartTraj(uav->GetMetaUsRangeFinder()->z(),
+                                desiredAltitude);
+  return true;
+}
+
+bool UavStateMachine::SetOrientationMode(
+    OrientationMode_t const &newOrientationMode) {
+  if ((newOrientationMode == OrientationMode_t::Custom) && (failSafeMode)) {
+    if (!ExitFailSafeMode())
+      return false;
+  }
+  // When transitionning from Custom to Manual mode we must reset to yaw
+  // reference to the current absolute yaw angle,
+  // overwise the Uav will abruptly change orientation
+  if ((orientationMode == OrientationMode_t::Custom) &&
+      (newOrientationMode == OrientationMode_t::Manual)) {
+    joy->SetYawRef(currentQuaternion);
+  }
+  orientationMode = newOrientationMode;
+  return true;
+}
+
+bool UavStateMachine::SetThrustMode(ThrustMode_t const &newThrustMode) {
+  if ((newThrustMode == ThrustMode_t::Custom) && (failSafeMode)) {
+    if (!ExitFailSafeMode())
+      return false;
+  }
+  thrustMode = newThrustMode;
+  return true;
+}
+
+NestedSat* UavStateMachine::GetURoll(void) { return uRoll;};
+NestedSat* UavStateMachine::GetUPitch(void) { return uPitch;};
+Pid* UavStateMachine::GetUYaw(void) { return uYaw;};
+PidThrust* UavStateMachine::GetUZ(void) { return uZ;};
+TrajectoryGenerator1D * UavStateMachine::GetAltitudeTrajectory(void) { return altitudeTrajectory;};
Index: tags/latest/lib/FlairMeta/src/UavStateMachine.h
===================================================================
--- tags/latest/lib/FlairMeta/src/UavStateMachine.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/UavStateMachine.h	(revision 209)
@@ -0,0 +1,310 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/29
+//  filename:   UavStateMachine.h
+//
+//  author:     Gildas Bayard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    state machine for UAV
+//
+//
+/*********************************************************************/
+
+#ifndef UAVSTATEMACHINE_H
+#define UAVSTATEMACHINE_H
+
+#include <Thread.h>
+#include <Vector2D.h>
+#include <Vector3D.h>
+#include <Euler.h>
+#include <Quaternion.h>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class AhrsData;
+class io_data;
+}
+namespace gui {
+class PushButton;
+class GridLayout;
+class Tab;
+class DoubleSpinBox;
+}
+namespace filter {
+class ControlLaw;
+class NestedSat;
+class Pid;
+class PidThrust;
+class TrajectoryGenerator1D;
+}
+namespace sensor {
+class TargetController;
+}
+namespace meta {
+class MetaDualShock3;
+class Uav;
+}
+}
+
+namespace flair {
+namespace meta {
+
+/*! \class UavStateMachine
+*
+* \brief State machine for UAV
+*  The Thread is created with 
+*  the FrameworkManager as parent. FrameworkManager must be created before.
+* The Thread is synchronized with Ahrs, unless a period is set with SetPeriodUS or
+* SetPeriodMS
+*/
+
+class UavStateMachine : public core::Thread {
+protected:
+  enum class AltitudeMode_t { Manual, Custom };
+  const AltitudeMode_t &GetAltitudeMode(void) const { return altitudeMode; }
+  bool SetAltitudeMode(const AltitudeMode_t &altitudeMode);
+
+  // uses TrajectoryGenerator1D *altitudeTrajectory to go to desiredAltitude
+  // available in mode AltitudeMode_t::Manual
+  // return true if goto is possible
+  bool GotoAltitude(float desiredAltitude);
+
+  enum class OrientationMode_t { Manual, Custom };
+  const OrientationMode_t &GetOrientationMode(void) const {
+    return orientationMode;
+  }
+  bool SetOrientationMode(const OrientationMode_t &orientationMode);
+
+  enum class ThrustMode_t { Default, Custom };
+  const ThrustMode_t &GetThrustMode() const { return thrustMode; }
+  bool SetThrustMode(const ThrustMode_t &thrustMode);
+
+  enum class TorqueMode_t { Default, Custom };
+  const TorqueMode_t &GetTorqueMode(void) const { return torqueMode; }
+  bool SetTorqueMode(const TorqueMode_t &torqueMode);
+
+  enum class Event_t {
+    EnteringFailSafeMode,
+    EnteringControlLoop,
+    StartLanding,
+    FinishLanding,
+    Stopped,
+    TakingOff,
+    EmergencyStop,
+    Stabilized, // as soon as uav is 3cm far from the ground
+    ZTrajectoryFinished,
+  };
+
+        UavStateMachine(sensor::TargetController* controller);
+        ~UavStateMachine();
+
+  const core::Quaternion &GetCurrentQuaternion(void) const;
+
+  const core::Vector3Df &GetCurrentAngularSpeed(void) const;
+
+        void Land(void);
+        void EmergencyLand(void);
+        void TakeOff(void);
+        void EmergencyStop(void);
+        //! Used to signal an event
+        /*!
+            \param event the event which occured
+        */
+        virtual void SignalEvent(Event_t event);
+
+  virtual const core::AhrsData *GetOrientation(void) const;
+  const core::AhrsData *GetDefaultOrientation(void) const;
+
+  virtual void AltitudeValues(float &z, float &dz) const; // in uav coordinate!
+  void EnterFailSafeMode(void);
+  bool ExitFailSafeMode(void);
+  void FailSafeAltitudeValues(float &z, float &dz) const; // in uav coordinate!
+
+  gui::GridLayout *GetButtonsLayout(void) const;
+  virtual void ExtraSecurityCheck(void){};
+  virtual void ExtraCheckJoystick(void){};
+  virtual void ExtraCheckPushButton(void){};
+
+  void GetDefaultReferenceAltitude(float &refAltitude,
+                                   float &refVerticalVelocity);
+  virtual void GetReferenceAltitude(float &refAltitude,
+                                    float &refVerticalVelocity);
+  // float GetDefaultThrustOffset(void);
+  const core::AhrsData *GetDefaultReferenceOrientation(void) const;
+  virtual const core::AhrsData *GetReferenceOrientation(void);
+
+  /*!
+  * \brief Compute Custom Torques
+  *
+  * Reimplement this method to use TorqueMode_t::Custom. \n
+  * This method is called internally by UavStateMachine, do not call it by
+  *yourself. \n
+  * See GetTorques if you need torques values.
+  *
+  * \param torques custom torques
+  */
+  virtual void ComputeCustomTorques(core::Euler &torques);
+
+  /*!
+  * \brief Compute Default Torques
+  *
+  * This method is called internally by UavStateMachine when using
+  *TorqueMode_t::Default. \n
+  * Torques are only computed once by loop, other calls to this method will use
+  *previously computed torques.
+  *
+  * \param torques default torques
+  */
+  void ComputeDefaultTorques(core::Euler &torques);
+
+  /*!
+  * \brief Get Torques
+  *
+  * \return torques current torques
+  */
+  // const core::Euler &GetTorques() const;
+
+  /*!
+  * \brief Compute Custom Thrust
+  *
+  * Reimplement this method to use ThrustMode_t::Custom. \n
+  * This method is called internally by UavStateMachine, do not call it by
+  *yourself. \n
+  * See GetThrust if you need thrust value.
+  *
+  * \return custom Thrust
+  */
+  virtual float ComputeCustomThrust(void);
+
+  /*!
+  * \brief Compute Default Thrust
+  *
+  * This method is called internally by UavStateMachine when using
+  *ThrustMode_t::Default. \n
+  * Thrust is only computed once by loop, other calls to this method will use
+  *previously computed thrust.
+  *
+  * \return default thrust
+  */
+  float ComputeDefaultThrust(void);
+
+  /*!
+  * \brief Get Thrust
+  *
+  * \return current thrust
+  */
+  // float GetThrust() const;
+
+  /*!
+  * \brief Add an IODevice to the control law logs
+  *
+  * The IODevice will be automatically logged among the Uz logs,
+  * if logging is enabled (see IODevice::SetDataToLog,
+  *FrameworkManager::StartLog
+  * and FrameworkManager::AddDeviceToLog). \n
+  *
+  * \param device IODevice to log
+  */
+  void AddDeviceToControlLawLog(const core::IODevice *device);
+
+  /*!
+  * \brief Add an io_data to the control law logs
+  *
+  * The io_data will be automatically logged among the Uz logs,
+  * if logging is enabled (see IODevice::SetDataToLog,
+  *FrameworkManager::StartLog
+  * and FrameworkManager::AddDeviceToLog). \n
+  *
+  * \param data io_data to log
+  */
+  void AddDataToControlLawLog(const core::io_data *data);
+
+  const sensor::TargetController *GetJoystick(void) const;
+  MetaDualShock3 *joy;
+  
+  filter::NestedSat *GetURoll(void);
+  filter::NestedSat *GetUPitch(void);
+  filter::Pid *GetUYaw(void);
+  filter::PidThrust *GetUZ(void);
+  filter::TrajectoryGenerator1D *GetAltitudeTrajectory(void);
+
+  gui::Tab *setupLawTab, *graphLawTab;
+
+private:
+  /*!
+  \enum AltitudeState_t
+  \brief States of the altitude state machine
+  */
+  enum class AltitudeState_t {
+    Stopped,      /*!< the uav motors are stopped */
+    TakingOff,    /*!< take off initiated. Motors accelerate progressively until
+                     the UAV lift up */
+    Stabilized,   /*!< the uav is actively maintaining its altitude */
+    StartLanding, /*!< landing initiated. Altitude is required to reach the
+                     landing altitude (0 by default) */
+    FinishLanding /*!< motors are gradually stopped */
+  };
+  AltitudeState_t altitudeState;
+  void ProcessAltitudeFiniteStateMachine();
+  void ComputeReferenceAltitude(float &refAltitude, float &refVerticalVelocity);
+
+  float groundAltitude; // effective altitude when the uav leaves the ground
+  float currentAltitude, currentVerticalSpeed;
+
+  bool failSafeMode;
+  void SecurityCheck(void);
+  void MandatorySecurityCheck(void);
+  void CheckJoystick();
+  void GenericCheckJoystick();
+  void CheckPushButton(void);
+  void GenericCheckPushButton(void);
+  void Run(void);
+  void StopMotors(void);
+  bool IsValuePossible(float value,std::string desc);
+
+  meta::Uav *uav;
+  sensor::TargetController *controller;
+
+  core::Quaternion currentQuaternion;
+  core::Vector3Df currentAngularSpeed;
+
+  const core::AhrsData *ComputeReferenceOrientation(void);
+
+  void ComputeOrientation(void);
+  void ComputeAltitude(void);
+
+  void ComputeTorques(void);
+  core::Euler currentTorques, savedDefaultTorques;
+  bool needToComputeDefaultTorques;
+
+  void ComputeThrust(void);
+  float currentThrust, savedDefaultThrust;
+  bool needToComputeDefaultThrust;
+
+  gui::PushButton *button_kill, *button_take_off, *button_land,
+      *button_start_log, *button_stop_log;
+  gui::GridLayout *buttonslayout;
+  gui::DoubleSpinBox *desiredTakeoffAltitude, *desiredLandingAltitude;
+  AltitudeMode_t altitudeMode;
+  OrientationMode_t orientationMode;
+  ThrustMode_t thrustMode;
+  TorqueMode_t torqueMode;
+  bool flagBatteryLow;
+  bool flagConnectionLost;
+  bool flagCriticalSensorLost;
+  bool flagZTrajectoryFinished;
+  bool safeToFly;
+  filter::NestedSat *uRoll, *uPitch;
+  filter::Pid *uYaw;
+  filter::PidThrust *uZ;
+  filter::TrajectoryGenerator1D *altitudeTrajectory;
+};
+};
+};
+#endif // UAVSTATEMACHINE_H
Index: tags/latest/lib/FlairMeta/src/XAir.cpp
===================================================================
--- tags/latest/lib/FlairMeta/src/XAir.cpp	(revision 209)
+++ tags/latest/lib/FlairMeta/src/XAir.cpp	(revision 209)
@@ -0,0 +1,73 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/02/08
+//  filename:   XAir.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a Xair uav
+//
+//
+/*********************************************************************/
+
+#include "XAir.h"
+#include <FrameworkManager.h>
+#include <RTDM_I2cPort.h>
+#include <RTDM_SerialPort.h>
+#include <Srf08.h>
+#include <Gx3_25_ahrs.h>
+#include <AfroBldc.h>
+#include <X4X8Multiplex.h>
+#include <Ps3Eye.h>
+#include <BatteryMonitor.h>
+#include <Tab.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::filter;
+using namespace flair::actuator;
+
+namespace flair {
+namespace meta {
+
+XAir::XAir(string name, string options,
+           filter::UavMultiplex *multiplex)
+    : Uav(name, multiplex) {
+  RTDM_I2cPort *i2cport = new RTDM_I2cPort(getFrameworkManager(), "rtdm_i2c", "rti2c3");
+  RTDM_SerialPort *imu_port = new RTDM_SerialPort(getFrameworkManager(), "imu_port", "rtser1");
+
+  if (multiplex == NULL)
+    SetMultiplex(new X4X8Multiplex("motors", X4X8Multiplex::X8));
+
+  SetBldc(new AfroBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
+                       "motors", GetUavMultiplex()->MotorsCount(), i2cport));
+  SetUsRangeFinder(new Srf08("SRF08", i2cport, 0x70, 60));
+  SetAhrs(new Gx3_25_ahrs("imu", imu_port,
+                          Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
+  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
+  GetBatteryMonitor()->SetBatteryValue(12);
+  SetVerticalCamera(new Ps3Eye("camv", 0, 50));
+}
+
+XAir::~XAir() {}
+
+void XAir::StartSensors(void) {
+  ((Gx3_25_imu *)(GetAhrs()->GetImu()))->Start();
+  ((Srf08 *)GetUsRangeFinder())->Start();
+  ((Ps3Eye *)GetVerticalCamera())->Start();
+}
+
+bool XAir::isReadyToFly(void) const {
+  return GetAhrs()->GetImu()->IsReady();
+}
+
+} // end namespace meta
+} // end namespace flair
Index: tags/latest/lib/FlairMeta/src/XAir.h
===================================================================
--- tags/latest/lib/FlairMeta/src/XAir.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/XAir.h	(revision 209)
@@ -0,0 +1,38 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file XAir.h
+ * \brief Class defining a xair uav
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/08
+ * \version 4.0
+ */
+
+#ifndef XAIR_H
+#define XAIR_H
+
+#include "Uav.h"
+
+namespace flair {
+namespace meta {
+/*! \class XAir
+*
+* \brief Class defining a xair uav
+*/
+class XAir : public Uav {
+public:
+  XAir(std::string name,std::string options="",
+       filter::UavMultiplex *multiplex = NULL);
+  ~XAir();
+  void StartSensors(void);
+	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
+  bool isReadyToFly(void) const;
+  virtual std::string GetType(void) const{return "xair";}
+
+private:
+};
+} // end namespace meta
+} // end namespace flair
+#endif // XAIR_H
Index: tags/latest/lib/FlairMeta/src/unexported/MetaDualShock3_impl.h
===================================================================
--- tags/latest/lib/FlairMeta/src/unexported/MetaDualShock3_impl.h	(revision 209)
+++ tags/latest/lib/FlairMeta/src/unexported/MetaDualShock3_impl.h	(revision 209)
@@ -0,0 +1,45 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file MetaDualShock3_impl.h
+ * \brief Classe intégrant la manette DualShock3 et les consignes joystick
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/14
+ * \version 3.4
+ */
+
+#ifndef METADUALSHOCK3_IMPL_H
+#define METADUALSHOCK3_IMPL_H
+
+#include <MetaDualShock3.h>
+
+namespace flair {
+namespace meta {
+class MetaDualShock3;
+}
+namespace filter {
+class JoyReference;
+}
+}
+
+/*! \class MetaDualShock3_impl
+*
+* \brief Classe intégrant la manette DualShock3 et les consignes joystick
+*/
+class MetaDualShock3_impl {
+public:
+  MetaDualShock3_impl(flair::meta::MetaDualShock3 *self, std::string name);
+  ~MetaDualShock3_impl();
+  flair::filter::JoyReference *joy_ref;
+  void UpdateFrom(const flair::core::io_data *data);
+
+private:
+  flair::meta::MetaDualShock3 *self;
+  bool joy_init;
+  bool wasRollTrimUpButtonPressed, wasRollTrimDownButtonPressed,
+      wasPitchTrimUpButtonPressed, wasPitchTrimDownButtonPressed;
+};
+
+#endif // METADUALSHOCK3_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairSensorActuator/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,51 @@
+PROJECT(FlairSensorActuator)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairVisionFilter/src
+	${CMAKE_SYSROOT}/usr/include/opencv
+	${CMAKE_SYSROOT}/usr/include/vrpn
+)
+
+FILE(GLOB SENSOR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SENSOR_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
+INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
Index: tags/latest/lib/FlairSensorActuator/src/AfroBldc.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 209)
@@ -0,0 +1,48 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/06/15
+//  filename:   AfroBldc.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+
+#include "AfroBldc.h"
+#include "AfroBldc_impl.h"
+#include <GroupBox.h>
+#include <Layout.h>
+#include <DoubleSpinBox.h>
+#include <SpinBox.h>
+#include <ComboBox.h>
+#include <PushButton.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+AfroBldc::AfroBldc(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, I2cPort *i2cport)
+    : Bldc(parent, layout, name, motors_count) {
+  pimpl_ = new AfroBldc_impl(this, layout, i2cport);
+  
+  SetIsReady(true);
+}
+
+AfroBldc::~AfroBldc() { delete pimpl_; }
+
+void AfroBldc::SetMotors(float *values) { pimpl_->SetMotors(values); }
+
+} // end namespace actuator
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/AfroBldc.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/AfroBldc.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/AfroBldc.h	(revision 209)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AfroBldc.h
+ * \brief Class for Mikrokopter's blctrlv2
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/06/15
+ * \version 4.0
+ */
+
+#ifndef AFROBLDC_H
+#define AFROBLDC_H
+
+#include "Bldc.h"
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace sensor {
+class BatteryMonitor;
+}
+}
+
+class AfroBldc_impl;
+
+namespace flair {
+namespace actuator {
+/*! \class AfroBldc
+*
+* \brief Class for Mikrokopter's blctrlv2
+*
+* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
+*/
+class AfroBldc : public Bldc {
+  friend class ::AfroBldc_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a AfroBldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param i2cport I2cPort
+  */
+  AfroBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, core::I2cPort *i2cport);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~AfroBldc();
+
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
+
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
+
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *values);
+
+  class AfroBldc_impl *pimpl_;
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // AFROBLDC_H
Index: tags/latest/lib/FlairSensorActuator/src/AfroBldc_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/AfroBldc_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/AfroBldc_impl.cpp	(revision 209)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/06/15
+//  filename:   AfroBldc_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+#include "AfroBldc_impl.h"
+#include "AfroBldc.h"
+#include "Bldc_impl.h"
+#include "I2cPort.h"
+#include <Layout.h>
+#include <SpinBox.h>
+#include <Label.h>
+#include <cvmatrix.h>
+#include <string.h>
+
+#define BASE_ADDRESS 0x29
+#define MAX_VALUE 2047
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::actuator;
+
+AfroBldc_impl::AfroBldc_impl(AfroBldc *self, Layout *layout, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
+  nb_mot = self->MotorsCount();
+}
+
+AfroBldc_impl::~AfroBldc_impl() {}
+
+void AfroBldc_impl::SetMotors(float *value) {
+  uint16_t tosend_value[nb_mot];
+
+  for (int i = 0; i < nb_mot; i++)
+    tosend_value[i] = (uint16_t)(MAX_VALUE * value[i]);
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    WriteValue(tosend_value[i]);
+  }
+  i2cport->ReleaseMutex();
+}
+
+// I2cPort mutex must be taken before calling this function
+void AfroBldc_impl::WriteValue(uint16_t value) {
+  uint8_t tx[2];
+  ssize_t written;
+
+  tx[0] = (uint8_t)(value >> 3); // msb
+  tx[1] = (value & 0x07);        // lsb
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
+}
Index: tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.cpp	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/24
+//  filename:   BatteryMonitor.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for battery monitor
+//
+//
+/*********************************************************************/
+
+#include "BatteryMonitor.h"
+#include <Layout.h>
+#include <Label.h>
+#include <DoubleSpinBox.h>
+#include <SpinBox.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+BatteryMonitor::BatteryMonitor(const gui::LayoutPosition *position, string name)
+    : GroupBox(position, name) {
+  battery = new Label(this->NewRow(), "battery");
+  battery_thresh = new DoubleSpinBox(this->LastRowLastCol(), "threshold", " V",0, 24, .1, 1);
+  thresholdTime = new SpinBox(this->LastRowLastCol(), "threshold time", " s",1, 3600, 1, 10);
+  isUnderThershold=false;
+}
+
+BatteryMonitor::~BatteryMonitor() {}
+
+float BatteryMonitor::GetVoltage(void) const { return batteryvalue; }
+
+bool BatteryMonitor::IsBatteryLow(void) {
+  if (batteryvalue <= battery_thresh->Value() && !isUnderThershold) {
+    isUnderThershold=true;
+    underThersholdStartTime=GetTime();
+  }
+  if (batteryvalue > battery_thresh->Value()) {
+    isUnderThershold=false;
+  }
+  if(isUnderThershold && GetTime() > underThersholdStartTime + (Time)(thresholdTime->Value())*(Time)1000000000) {
+    return true;
+  }
+   
+  return false;
+}
+
+void BatteryMonitor::SetBatteryValue(float value) {
+  batteryvalue = value;
+  if (value > 0) {
+    battery->SetText("battery: %.1fV", value);
+  } else {
+    battery->SetText("battery: unreadable");
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BatteryMonitor.h	(revision 209)
@@ -0,0 +1,88 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file BatteryMonitor.h
+ * \brief Base class for battery monitor
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/24
+ * \version 4.0
+ */
+
+#ifndef BATTERYMONITOR_H
+#define BATTERYMONITOR_H
+
+#include <GroupBox.h>
+
+namespace flair {
+namespace gui {
+class LayoutPosition;
+class Label;
+class DoubleSpinBox;
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+
+/*! \class BatteryMonitor
+*
+* \brief Base class for battery monitor
+*/
+
+class BatteryMonitor : public gui::GroupBox {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a BatteryMonitor at given position.
+  *
+  * \param position position
+  * \param name name
+  */
+  BatteryMonitor(const gui::LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~BatteryMonitor();
+
+  /*!
+  * \brief Is batteru low?
+  *
+  * \return true if battery is below threshold
+  *
+  */
+  bool IsBatteryLow(void);
+
+  /*!
+  * \brief Set battery value
+  *
+  * \param battery value
+  *
+  */
+  void SetBatteryValue(float value);
+
+  /*!
+  * \brief Get battery voltage
+  *
+  * \return battery voltage
+  *
+  */
+  float GetVoltage(void) const;
+
+private:
+  float batteryvalue;
+  gui::DoubleSpinBox *battery_thresh;
+  gui::SpinBox *thresholdTime;
+  gui::Label *battery;
+  core::Time underThersholdStartTime;
+  bool isUnderThershold;
+};
+} // end namespace sensor
+} // end namespace flair
+
+#endif // BATTERYMONITOR_H
Index: tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/09/13
+//  filename:   BlCtrlV2.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+
+#include "BlCtrlV2.h"
+#include "BlCtrlV2_impl.h"
+#include "BatteryMonitor.h"
+#include <GroupBox.h>
+#include <Layout.h>
+#include <DoubleSpinBox.h>
+#include <SpinBox.h>
+#include <ComboBox.h>
+#include <PushButton.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::sensor;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+BlCtrlV2::BlCtrlV2(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, I2cPort *i2cport)
+    : Bldc(parent, layout, name, motors_count) {
+  pimpl_ = new BlCtrlV2_impl(this, layout, i2cport);
+  
+  SetIsReady(true);
+}
+
+BlCtrlV2::~BlCtrlV2() { delete pimpl_; }
+
+BatteryMonitor *BlCtrlV2::GetBatteryMonitor(void) const {
+  return pimpl_->battery;
+}
+
+void BlCtrlV2::SetMotors(float *values) { pimpl_->SetMotors(values); }
+
+} // end namespace actuator
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BlCtrlV2.h	(revision 209)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file BlCtrlV2.h
+ * \brief Class for Mikrokopter's blctrlv2
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/09/13
+ * \version 4.0
+ */
+
+#ifndef BLCTRLV2_H
+#define BLCTRLV2_H
+
+#include "Bldc.h"
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace sensor {
+class BatteryMonitor;
+}
+}
+
+class BlCtrlV2_impl;
+
+namespace flair {
+namespace actuator {
+/*! \class BlCtrlV2
+*
+* \brief Class for Mikrokopter's blctrlv2
+*
+* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
+*/
+class BlCtrlV2 : public Bldc {
+  friend class ::BlCtrlV2_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a BlCtrlV2.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param i2cport I2cPort
+  */
+  BlCtrlV2(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, core::I2cPort *i2cport);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~BlCtrlV2();
+
+  /*!
+  * \brief Get battery monitor
+  *
+  * \return BatteryMonitor
+  */
+  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
+
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return true; };
+
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return true; };
+
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *values);
+
+  class BlCtrlV2_impl *pimpl_;
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // BLCTRLV2_H
Index: tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp	(revision 209)
@@ -0,0 +1,210 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/09/13
+//  filename:   BlCtrlV2_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+#include "BlCtrlV2_impl.h"
+#include "BlCtrlV2.h"
+#include "Bldc_impl.h"
+#include "BatteryMonitor.h"
+#include "I2cPort.h"
+#include <Layout.h>
+#include <SpinBox.h>
+#include <Label.h>
+#include <cvmatrix.h>
+#include <string.h>
+
+#define BASE_ADDRESS 0x29
+#define MAX_VALUE 2047
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+using namespace flair::actuator;
+
+BlCtrlV2_impl::BlCtrlV2_impl(BlCtrlV2 *self, Layout *layout, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
+  last_voltage_time = 0;
+
+  DetectMotors();
+  // if(nb_mot!=self->MotorsCount()) self->Err("motors count different from
+  // multiplex count\n");
+
+  // BatteryMonitor
+  battery = new BatteryMonitor(layout->NewRow(), "battery");
+
+  // user interface
+  GroupBox *setupgroupbox = new GroupBox(layout->NewRow(), "Motors");
+  poles = new SpinBox(setupgroupbox->NewRow(), "nb poles:", 0, 255, 1, 14);
+}
+
+BlCtrlV2_impl::~BlCtrlV2_impl() {}
+
+void BlCtrlV2_impl::SetMotors(float *value) {
+  uint16_t tosend_value[nb_mot];
+  // stocke dans une variable pour garder le moins longtemps l'i2c (pour ne pas
+  // bloquer sur le mutex de l'output)
+  float speeds[nb_mot];
+  float currents[nb_mot];
+
+  for (int i = 0; i < nb_mot; i++)
+    tosend_value[i] = (uint16_t)(MAX_VALUE * value[i]);
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    WriteValue(tosend_value[i]);
+  }
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+
+    if (i == 0 && GetTime() > (last_voltage_time + 5 * (Time)1000000000)) {
+      // toute les 5 secondes sur moteur 0
+      float voltage;
+      GetCurrentSpeedAndVoltage(currents[i], speeds[i], voltage);
+      battery->SetBatteryValue(voltage);
+      last_voltage_time = GetTime();
+    } else {
+      GetCurrentAndSpeed(currents[i], speeds[i]);
+    }
+  }
+  // printf("%f %f %f %f\n",speeds[0],speeds[1],speeds[2],speeds[3]);
+  /*
+      if(GetTime()>(last_voltage_time+5*(Time)1000000000))//toute les 5 secondes
+      {
+          i2cport->SetSlave(BASE_ADDRESS);
+          battery->SetBatteryValue(ReadVoltage());
+          last_voltage_time=GetTime();
+      }
+  */
+  i2cport->ReleaseMutex();
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  cvmatrix *output = self->output;
+  output->GetMutex();
+  for (int i = 0; i < nb_mot; i++)
+    output->SetValueNoMutex(i, 0, speeds[i]);
+  for (int i = 0; i < nb_mot; i++)
+    output->SetValueNoMutex(i, 1, currents[i]);
+  output->ReleaseMutex();
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::WriteValue(uint16_t value) {
+  uint8_t tx[2];
+  ssize_t written;
+
+  tx[0] = (uint8_t)(value >> 3); // msb
+  tx[1] = (value & 0x07);
+  ; //+16+8; //pour recuperer la vitesse en premier
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::GetCurrentAndSpeed(float &current, float &speed) {
+  ssize_t read;
+  uint8_t value[4];
+  read = i2cport->Read(value, sizeof(value));
+
+  if (read < 0) {
+    self->Err("rt_dev_read error (%s)\n", strerror(-read));
+    speed = -1;
+    current = -1;
+  } else if (read != sizeof(value)) {
+    self->Err("rt_dev_read error %i/%i\n", read, sizeof(value));
+    speed = -1;
+    current = -1;
+  } else {
+    current = value[0] / 10.;
+    speed = value[3] * 780. / poles->Value();
+  }
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::GetCurrentSpeedAndVoltage(float &current, float &speed,
+                                              float &voltage) {
+  ssize_t read;
+  uint8_t value[6];
+  read = i2cport->Read(value, sizeof(value));
+
+  if (read < 0) {
+    self->Err("rt_dev_read error (%s)\n", strerror(-read));
+    speed = -1;
+    voltage = -1;
+    current = -1;
+  } else if (read != sizeof(value)) {
+    self->Err("rt_dev_read error %i/%i\n", read, sizeof(value));
+    speed = -1;
+    voltage = -1;
+    current = -1;
+  } else {
+    current = value[0] / 10.;
+    voltage = value[5] / 10.;
+    speed = value[3] * 780. / poles->Value();
+  }
+}
+
+void BlCtrlV2_impl::DetectMotors(void) {
+  int nb = 0;
+  ssize_t read, nb_write;
+  uint8_t value[3];
+  uint8_t tx[2];
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < MAX_MOTORS; i++) {
+    // printf("test %i\n",i);
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    tx[0] = 0;
+    tx[1] = 16 + 8; // 16+8 pour recuperer la vitesse
+
+    nb_write = i2cport->Write(tx, 2);
+
+    if (nb_write != sizeof(tx)) {
+      continue;
+    }
+    nb++;
+  }
+
+  for (int i = 0; i < MAX_MOTORS; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    read = i2cport->Read(value, 3);
+
+    if (read != sizeof(value)) {
+      continue;
+    }
+  }
+
+  i2cport->ReleaseMutex();
+
+  Printf("BlCtrlV2: Dectected motors: %i\n", nb);
+  if (nb == 4) {
+    Printf("BlCtrlV2: Configuration X4\n");
+  } else if (nb == 8) {
+    Printf("BlCtrlV2: Configuration X8\n");
+  } else {
+    // self->Err("Error, configuration not supported (%i/%i)\n",nb,MAX_MOTORS);
+  }
+
+  nb_mot = nb;
+}
Index: tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 209)
@@ -0,0 +1,494 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/29
+//  filename:   BlCtrlV2_x4_speed.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c, controle en vitesse
+//
+//
+/*********************************************************************/
+
+#include "BlCtrlV2_x4_speed.h"
+#include "I2cPort.h"
+#include <TabWidget.h>
+#include <Tab.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+#include <ComboBox.h>
+#include <PushButton.h>
+#include <cvmatrix.h>
+#include <Mutex.h>
+#include <FrameworkManager.h>
+#include <DataPlot1D.h>
+#include <math.h>
+#include <string.h>
+
+#define TAU_US 1000
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+BlCtrlV2_x4_speed::BlCtrlV2_x4_speed(string name,I2cPort *i2cport, uint8_t base_address,
+                                     uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), IODevice(getFrameworkManager(), name) {
+  this->i2cport = i2cport;
+  slave_address = base_address;
+  tested_motor = -1;
+  enabled = false;
+  int_av_g = 0;
+  int_av_d = 0;
+  int_ar_g = 0;
+  int_ar_d = 0;
+
+  // flight time
+  FILE *file;
+  file = fopen("/etc/flight_time", "r");
+  if (file == NULL) {
+    Printf("fichier d'info de vol vide\n");
+    time_sec = 0;
+  } else {
+    char ligne[32];
+    fgets(ligne, 32, file);
+    time_sec = atoi(ligne);
+    Printf("temps de vol total: %is = %imin = %ih\n", time_sec, time_sec / 60,
+           time_sec / 3600);
+    fclose(file);
+  }
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  Tab *sensor_tab = new Tab(tab, "Reglages");
+  reglages_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+  poles = new SpinBox(reglages_groupbox->NewRow(), "nb poles", 0, 255, 1);
+  kp = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "kp", 0., 255,
+                         0.001, 4);
+  ki = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "ki", 0., 255,
+                         0.001, 4);
+  min = new SpinBox(reglages_groupbox->NewRow(), "min pwm", 0., 2048, 1);
+  max =
+      new SpinBox(reglages_groupbox->LastRowLastCol(), "max pwm", 0., 2048, 1);
+  test = new SpinBox(reglages_groupbox->LastRowLastCol(), "test value", 0.,
+                     2048, 1);
+  start_value = new SpinBox(reglages_groupbox->NewRow(), "valeur demarrage", 0,
+                            10000, 10);
+  trim = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "pas decollage",
+                           0, 1000, .1);
+
+  av_g = new ComboBox(reglages_groupbox->NewRow(), "avant gauche");
+  av_g->AddItem("1");
+  av_g->AddItem("2");
+  av_g->AddItem("3");
+  av_g->AddItem("4");
+  button_avg = new PushButton(reglages_groupbox->LastRowLastCol(), "test avg");
+
+  av_d = new ComboBox(reglages_groupbox->LastRowLastCol(), "avant droite:");
+  av_d->AddItem("1");
+  av_d->AddItem("2");
+  av_d->AddItem("3");
+  av_d->AddItem("4");
+  button_avd = new PushButton(reglages_groupbox->LastRowLastCol(), "test avd");
+
+  ar_g = new ComboBox(reglages_groupbox->NewRow(), "arriere gauche:");
+  ar_g->AddItem("1");
+  ar_g->AddItem("2");
+  ar_g->AddItem("3");
+  ar_g->AddItem("4");
+  button_arg = new PushButton(reglages_groupbox->LastRowLastCol(), "test arg");
+
+  ar_d = new ComboBox(reglages_groupbox->LastRowLastCol(), "arriere droite:");
+  ar_d->AddItem("1");
+  ar_d->AddItem("2");
+  ar_d->AddItem("3");
+  ar_d->AddItem("4");
+  button_ard = new PushButton(reglages_groupbox->LastRowLastCol(), "test ard");
+
+  pas = new ComboBox(reglages_groupbox->NewRow(), "pas helice avant gauche:");
+  pas->AddItem("normal");
+  pas->AddItem("inverse");
+
+  input = new cvmatrix((IODevice *)this, 8, 1, floatType);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(4, 2);
+  desc->SetElementName(0, 0, "avant gauche");
+  desc->SetElementName(1, 0, "arriere droite");
+  desc->SetElementName(2, 0, "avant droite");
+  desc->SetElementName(3, 0, "arriere gauche");
+
+  desc->SetElementName(0, 1, "cons avant gauche");
+  desc->SetElementName(1, 1, "cons arriere droite");
+  desc->SetElementName(2, 1, "cons avant droite");
+  desc->SetElementName(3, 1, "cons arriere gauche");
+  output = new cvmatrix((IODevice *)this, desc, floatType);
+  delete desc;
+  
+  SetIsReady(true);
+  
+  /*
+
+  //le 3ieme lu est la tension batteire
+          if(i2c_mutex!=NULL) i2c_mutex->GetMutex();
+      uint16_t pwm_moteur;
+      pwm_moteur=0;
+      ssize_t read;
+      uint8_t rx[8];
+      SetSlave(slave_address);
+
+      for(int j=0;j<10;j++)
+      {
+
+
+          WriteValue(pwm_moteur);
+
+
+          read = rt_dev_read(i2c_fd, rx, sizeof(rx));
+
+          if(read<0)
+          {
+              rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur
+  rt_dev_read (%s)\n",IODevice::ObjectName().c_str(),strerror(-read));
+          }
+          else if (read != sizeof(rx))
+          {
+              rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur
+  rt_dev_read %i/2\n",IODevice::ObjectName().c_str(),read);
+
+          }
+          for(int i=0;i<sizeof(rx);i++) printf("%i ",rx[i]);
+
+          printf("\n");
+
+      }
+
+      if(i2c_mutex!=NULL) i2c_mutex->ReleaseMutex();*/
+}
+
+BlCtrlV2_x4_speed::~BlCtrlV2_x4_speed(void) {
+  SafeStop();
+  Join();
+  delete main_tab;
+}
+
+void BlCtrlV2_x4_speed::UseDefaultPlot(void) {
+  Tab *plot_tab = new Tab(tab, "Mesures");
+  DataPlot1D *av_g_plot = new DataPlot1D(plot_tab->NewRow(), "avg", 0, 10000);
+  av_g_plot->AddCurve(output->Element(0, 0));
+  av_g_plot->AddCurve(output->Element(0, 1), DataPlot::Blue);
+  DataPlot1D *av_d_plot =
+      new DataPlot1D(plot_tab->LastRowLastCol(), "avd", 0, 10000);
+  av_d_plot->AddCurve(output->Element(2, 0));
+  av_d_plot->AddCurve(output->Element(2, 1), DataPlot::Blue);
+  DataPlot1D *ar_g_plot = new DataPlot1D(plot_tab->NewRow(), "arg", 0, 10000);
+  ar_g_plot->AddCurve(output->Element(3, 0));
+  ar_g_plot->AddCurve(output->Element(3, 1), DataPlot::Blue);
+  DataPlot1D *ar_d_plot =
+      new DataPlot1D(plot_tab->LastRowLastCol(), "ard", 0, 10000);
+  ar_d_plot->AddCurve(output->Element(1, 0));
+  ar_d_plot->AddCurve(output->Element(1, 1), DataPlot::Blue);
+}
+
+float BlCtrlV2_x4_speed::TrimValue(void) { return (float)trim->Value(); }
+
+int BlCtrlV2_x4_speed::StartValue(void) { return start_value->Value(); }
+
+void BlCtrlV2_x4_speed::Run(void) {
+  WarnUponSwitches(true);
+
+  SetPeriodUS(TAU_US);
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    Update();
+  }
+
+  WarnUponSwitches(false);
+}
+
+void BlCtrlV2_x4_speed::Update(void) {
+  float u_roll, u_pitch, u_yaw, u_gaz;
+  float trim_roll, trim_pitch, trim_yaw;
+  float pwm[4];
+  uint16_t pwm_moteur[4];
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  input->GetMutex();
+
+  u_roll = input->ValueNoMutex(0, 0);
+  u_pitch = input->ValueNoMutex(1, 0);
+  u_yaw = input->ValueNoMutex(2, 0);
+  u_gaz =
+      input->ValueNoMutex(3, 0) +
+      input->ValueNoMutex(7, 0) * input->ValueNoMutex(7, 0); // ugaz+trim*trim
+  trim_roll = input->ValueNoMutex(4, 0);
+  trim_pitch = input->ValueNoMutex(5, 0);
+  trim_yaw = input->ValueNoMutex(6, 0);
+
+  input->ReleaseMutex();
+
+  if (pas->CurrentIndex() == 1) {
+    trim_yaw = -trim_yaw;
+    u_yaw = -u_yaw;
+  }
+
+  // rt_printf("%f %f %f %f\n",u_roll,u_pitch,u_yaw,u_gaz);
+  // if(u_gaz!=0) rt_printf("gaz: %f\n",u_gaz);
+
+  // avant gauche
+  if (u_gaz + u_pitch + u_roll + u_yaw > 0) {
+    pwm[0] = trim_pitch + trim_roll + trim_yaw +
+             sqrtf(u_gaz + u_pitch + u_roll + u_yaw);
+  } else {
+    pwm[0] = trim_pitch + trim_roll + trim_yaw;
+  }
+
+  // arriere gauche
+  if (u_gaz - u_pitch + u_roll - u_yaw > 0) {
+    pwm[3] = -trim_pitch + trim_roll - trim_yaw +
+             sqrtf(u_gaz - u_pitch + u_roll - u_yaw);
+  } else {
+    pwm[3] = -trim_pitch + trim_roll - trim_yaw;
+  }
+
+  // arriere droit
+  if (u_gaz - u_pitch - u_roll + u_yaw > 0) {
+    pwm[1] = -trim_pitch - trim_roll + trim_yaw +
+             sqrtf(u_gaz - u_pitch - u_roll + u_yaw);
+  } else {
+    pwm[1] = -trim_pitch - trim_roll + trim_yaw;
+  }
+
+  // avant droit
+  if (u_gaz + u_pitch - u_roll - u_yaw > 0) {
+    pwm[2] = trim_pitch - trim_roll - trim_yaw +
+             sqrtf(u_gaz + u_pitch - u_roll - u_yaw);
+  } else {
+    pwm[2] = trim_pitch - trim_roll - trim_yaw;
+  }
+
+  int_av_g += ki->Value() * (pwm[0] - speed_av_g);
+  pwm[0] = kp->Value() * (pwm[0] - speed_av_g) + int_av_g;
+
+  int_ar_g += ki->Value() * (pwm[3] - speed_ar_g);
+  pwm[3] = kp->Value() * (pwm[3] - speed_ar_g) + int_ar_g;
+
+  int_ar_d += ki->Value() * (pwm[1] - speed_ar_d);
+  pwm[1] = kp->Value() * (pwm[1] - speed_ar_d) + int_ar_d;
+
+  int_av_d += ki->Value() * (pwm[2] - speed_av_d);
+  pwm[2] = kp->Value() * (pwm[2] - speed_av_d) + int_av_d;
+
+  // rt_printf("%f\n",pwm[0]);
+  for (int i = 0; i < 4; i++)
+    pwm_moteur[i] = SatPWM(pwm[i], min->Value(), max->Value());
+
+  if (button_avg->Clicked() == true) {
+    tested_motor = 0;
+    StartTest();
+  }
+  if (button_avd->Clicked() == true) {
+    tested_motor = 2;
+    StartTest();
+  }
+  if (button_arg->Clicked() == true) {
+    tested_motor = 3;
+    StartTest();
+  }
+  if (button_ard->Clicked() == true) {
+    tested_motor = 1;
+    StartTest();
+  }
+
+  if (tested_motor != -1) {
+    for (int i = 0; i < 4; i++) {
+      pwm_moteur[i] = 0;
+    }
+    pwm_moteur[tested_motor] = (uint16_t)test->Value();
+
+    if (GetTime() > (start_time + 2 * 1000000000))
+      StopTest();
+  }
+
+  i2cport->GetMutex();
+
+  if (enabled == true) {
+    i2cport->SetSlave(slave_address + av_g->CurrentIndex());
+    WriteValue(pwm_moteur[0]);
+
+    i2cport->SetSlave(slave_address + av_d->CurrentIndex());
+    WriteValue(pwm_moteur[2]);
+
+    i2cport->SetSlave(slave_address + ar_g->CurrentIndex());
+    WriteValue(pwm_moteur[3]);
+
+    i2cport->SetSlave(slave_address + ar_d->CurrentIndex());
+    WriteValue(pwm_moteur[1]);
+
+  } else {
+    for (int i = 0; i < 4; i++) {
+      i2cport->SetSlave(slave_address + i);
+      WriteValue(0);
+    }
+    int_av_g = 0;
+    int_av_d = 0;
+    int_ar_g = 0;
+    int_ar_d = 0;
+  }
+
+  i2cport->SetSlave(slave_address + av_g->CurrentIndex());
+  speed_av_g = GetSpeed();
+
+  i2cport->SetSlave(slave_address + av_d->CurrentIndex());
+  speed_av_d = GetSpeed();
+
+  i2cport->SetSlave(slave_address + ar_g->CurrentIndex());
+  speed_ar_g = GetSpeed();
+
+  i2cport->SetSlave(slave_address + ar_d->CurrentIndex());
+  speed_ar_d = GetSpeed();
+
+  i2cport->ReleaseMutex();
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  output->GetMutex();
+  output->SetValueNoMutex(0, 0, speed_av_g);
+  output->SetValueNoMutex(1, 0, speed_ar_d);
+  output->SetValueNoMutex(2, 0, speed_av_d);
+  output->SetValueNoMutex(3, 0, speed_ar_g);
+  // rt_printf("%i %i %i
+  // %i\n",pwm_moteur[0],pwm_moteur[1],pwm_moteur[2],pwm_moteur[3]);
+  output->ReleaseMutex();
+
+  output->SetDataTime(GetTime());
+  ProcessUpdate(output);
+}
+
+void BlCtrlV2_x4_speed::StartTest(void) {
+  start_time = GetTime();
+  SetEnabled(true);
+}
+
+void BlCtrlV2_x4_speed::StopTest(void) {
+  SetEnabled(false);
+  tested_motor = -1;
+}
+
+uint16_t BlCtrlV2_x4_speed::SatPWM(float vel_cons, uint16_t min, uint16_t max) {
+  uint16_t sat_value = (uint16_t)vel_cons;
+
+  if (vel_cons > ((float)sat_value + 0.5))
+    sat_value++;
+
+  if (vel_cons < (float)min)
+    sat_value = min;
+  if (vel_cons > (float)max)
+    sat_value = max;
+
+  return sat_value;
+}
+
+void BlCtrlV2_x4_speed::LockUserInterface(void) {
+  reglages_groupbox->setEnabled(false);
+}
+
+void BlCtrlV2_x4_speed::UnlockUserInterface(void) {
+  reglages_groupbox->setEnabled(true);
+}
+
+void BlCtrlV2_x4_speed::SetEnabled(bool status) {
+  enabled = status;
+  if (enabled == true) {
+    LockUserInterface();
+
+    flight_start_time = GetTime();
+  } else {
+    UnlockUserInterface();
+
+    Time now = GetTime();
+    int t_sec;
+    FILE *file;
+    char ligne[32];
+
+    t_sec = (now - flight_start_time) / 1000000000;
+    time_sec += t_sec;
+
+    Printf("temps de vol: %is = %imin\n", t_sec, t_sec / 60);
+    Printf("temps de vol total: %is = %imin = %ih\n", time_sec, time_sec / 60,
+           time_sec / 3600);
+
+    file = fopen("/etc/flight_time", "w");
+    if (file == NULL) {
+      Thread::Err("Erreur a l'ouverture du fichier d'info vol\n");
+    } else {
+      sprintf(ligne, "%i", time_sec);
+      fputs(ligne, file);
+      fclose(file);
+    }
+  }
+}
+
+void BlCtrlV2_x4_speed::SetUroll(float value) { input->SetValue(0, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUpitch(float value) { input->SetValue(1, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUyaw(float value) { input->SetValue(2, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUgaz(float value) { input->SetValue(3, 0, value); }
+
+void BlCtrlV2_x4_speed::SetRollTrim(float value) {
+  input->SetValue(4, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetPitchTrim(float value) {
+  input->SetValue(5, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetYawTrim(float value) {
+  input->SetValue(6, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetGazTrim(float value) {
+  input->SetValue(7, 0, value);
+}
+
+void BlCtrlV2_x4_speed::WriteValue(uint16_t value) {
+  unsigned char tx[2];
+  ssize_t written;
+
+  tx[0] = (unsigned char)(value >> 3); // msb
+  tx[1] = 16 + 8 + (value & 0x07);     // 16+8 pour recuperer la vitesse
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    Thread::Err("erreur rt_dev_write (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("erreur rt_dev_write %i/2\n", written);
+  }
+}
+
+float BlCtrlV2_x4_speed::GetSpeed(void) {
+  ssize_t read;
+  uint8_t value;
+  read = i2cport->Read(&value, 1);
+
+  if (read < 0) {
+    Thread::Err("erreur rt_dev_read (%s)\n", strerror(-read));
+  } else if (read != 1) {
+    Thread::Err("erreur rt_dev_read %i/2\n", read);
+  }
+
+  return value * 780. / poles->Value();
+}
+
+} // end namespace actuator
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h	(revision 209)
@@ -0,0 +1,112 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/29
+//  filename:   BlCtrlV2_x4_speed.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c, controle en vitesse
+//
+//
+/*********************************************************************/
+
+#ifndef BLCTRLV2_X4_SPEED_H
+#define BLCTRLV2_X4_SPEED_H
+
+#include <IODevice.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class I2cPort;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class SpinBox;
+class DoubleSpinBox;
+class ComboBox;
+class PushButton;
+class GroupBox;
+}
+}
+
+namespace flair {
+namespace actuator {
+class BlCtrlV2_x4_speed : public core::Thread, public core::IODevice {
+
+public:
+  BlCtrlV2_x4_speed(std::string name,
+                    core::I2cPort *i2cport, uint8_t base_address,
+                    uint8_t priority);
+  ~BlCtrlV2_x4_speed();
+  void UseDefaultPlot(void);
+  void LockUserInterface(void);
+  void UnlockUserInterface(void);
+  void SetEnabled(bool status);
+  void SetUroll(float value);
+  void SetUpitch(float value);
+  void SetUyaw(float value);
+  void SetUgaz(float value);
+  void SetRollTrim(float value);
+  void SetPitchTrim(float value);
+  void SetYawTrim(float value);
+  void SetGazTrim(float value);
+  float TrimValue(void);
+  int StartValue(void);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(core::io_data *data){};
+  void WriteValue(uint16_t value);
+  float GetSpeed(void);
+  void StartTest(void);
+  void StopTest(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  void Update(void);
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *reglages_groupbox;
+  gui::SpinBox *min, *max, *test;
+  gui::PushButton *button_avg, *button_avd, *button_arg, *button_ard;
+  gui::ComboBox *av_g, *av_d, *ar_g, *ar_d, *pas;
+  gui::DoubleSpinBox *trim, *kp, *ki;
+  gui::SpinBox *start_value, *poles;
+  core::Time start_time, flight_start_time;
+  int time_sec;
+  float speed_av_g, speed_av_d, speed_ar_g, speed_ar_d;
+  float int_av_g, int_av_d, int_ar_g, int_ar_d;
+
+  // matrix
+  core::cvmatrix *input;
+  core::cvmatrix *output;
+
+  int tested_motor;
+  core::I2cPort *i2cport;
+  uint8_t slave_address;
+
+  bool enabled;
+
+  uint16_t SatPWM(float vel_cons, uint16_t min, uint16_t max);
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // BLCTRLV2_X4_SPEED_H
Index: tags/latest/lib/FlairSensorActuator/src/Bldc.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Bldc.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Bldc.cpp	(revision 209)
@@ -0,0 +1,106 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/14
+//  filename:   Bldc.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for brushless drivers
+//
+//
+/*********************************************************************/
+
+#include "Bldc.h"
+#include "Bldc_impl.h"
+#include <cvmatrix.h>
+#include <DoubleSpinBox.h>
+#include <sstream>
+#include "compile_info.h"
+
+//todo: put it on seprate file, but not possible with static lib?
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairSensorActuator");
+}
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+Bldc::Bldc(const IODevice *parent, Layout *layout, string name,
+           uint8_t motors_count)
+    : IODevice(parent, name) {
+  pimpl_ = new Bldc_impl(this, layout, name, motors_count);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(motors_count, 2);
+  for (int i = 0; i < motors_count; i++) {
+    ostringstream speed, current;
+    speed << "speed_" << i;
+    desc->SetElementName(i, 0, speed.str());
+
+    current << "current_" << i;
+    desc->SetElementName(i, 1, current.str());
+  }
+
+  output = new cvmatrix(this, desc, floatType);
+  delete desc;
+  AddDataToLog(output);
+}
+
+Bldc::Bldc(const Object *parent, string name, uint8_t motors_count)
+    : IODevice(parent, name) {
+  pimpl_ = new Bldc_impl(this, motors_count);
+  
+  SetIsReady(true);
+}
+
+Bldc::~Bldc() { delete pimpl_; }
+
+void Bldc::UpdateFrom(const io_data *data) { pimpl_->UpdateFrom(data); }
+
+void Bldc::LockUserInterface(void) const { pimpl_->LockUserInterface(); }
+
+void Bldc::UnlockUserInterface(void) const { pimpl_->UnlockUserInterface(); }
+
+Layout *Bldc::GetLayout(void) const { return (Layout *)pimpl_->layout; }
+
+void Bldc::UseDefaultPlot(TabWidget *tabwidget) {
+  pimpl_->UseDefaultPlot(tabwidget);
+}
+
+uint8_t Bldc::MotorsCount(void) const { return pimpl_->motors_count; }
+
+cvmatrix *Bldc::Output(void) const { return output; }
+
+bool Bldc::AreEnabled(void) const { return pimpl_->are_enabled; }
+
+void Bldc::SetEnabled(bool status) {
+  if (pimpl_->are_enabled != status) {
+    pimpl_->are_enabled = status;
+    if (pimpl_->are_enabled) {
+      LockUserInterface();
+    } else {
+      UnlockUserInterface();
+    }
+  }
+}
+
+void Bldc::SetPower(int motor_id, float value) {
+  // use output mutex to avoid making a new mutex
+  output->GetMutex();
+  pimpl_->power[motor_id] = value;
+  output->ReleaseMutex();
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Bldc.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Bldc.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Bldc.h	(revision 209)
@@ -0,0 +1,188 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Bldc.h
+ * \brief Base class for brushless motors drivers
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/14
+ * \version 4.0
+ */
+
+#ifndef BLDC_H
+#define BLDC_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class Layout;
+class TabWidget;
+}
+}
+
+class Bldc_impl;
+
+namespace flair {
+namespace actuator {
+/*! \class Bldc
+*
+* \brief Base class for brushless motors drivers
+*/
+class Bldc : public core::IODevice {
+  friend class ::Bldc_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Bldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  */
+  Bldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+       uint8_t motors_count);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Bldc. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  * \param motors_count number of motors
+  */
+  Bldc(const core::Object *parent, std::string name, uint8_t motors_count);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Bldc();
+
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
+
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  * \param tabwidget TabWidget to draw plots
+  */
+  void UseDefaultPlot(gui::TabWidget *tabwidget);
+
+  /*!
+  * \brief Output from motors
+  *
+  * First column is real speed if available, secund column is current if
+  *available
+  *
+  */
+  core::cvmatrix *Output(void) const;
+
+  /*!
+  * \brief Motors count
+  *
+  * \return number of motors
+  */
+  uint8_t MotorsCount(void) const;
+
+  /*!
+  * \brief Enable motors
+  *
+  * \param true to enable all motors
+  */
+  void SetEnabled(bool status);
+
+  /*!
+  * \brief Are motors enabled?
+  *
+  * \return true if motors are enabled
+  */
+  bool AreEnabled(void) const;
+
+  /*!
+  * \brief Set motor power
+  *
+  * Changes the power (from 0 to 1) of a specific motor. \n
+  * By default power is set to 1 for each motor which has no effect. \n
+  * A value <1 will decrease the power of a motor sent to the reimplemented Bldc
+  *class through SetMotors. \n
+  * The power value is applied after applying saturation between min value and
+  *max value.
+  * So the resulting value cannot be higher than max value
+  * but it can be lower than min value.
+  *
+  * \param motor_id id of the motor
+  * \param value power value (from 0 to 1)
+  *
+  */
+  void SetPower(int motor_id, float value);
+
+  /*!
+  * \brief Layout
+  *
+  * This the same Layout as passed to the constructor
+  *
+  * \return a Layout
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Has speed measurement
+  *
+  * \return true if it has speed measurement
+  */
+  virtual bool HasSpeedMeasurement(void) const = 0;
+
+  /*!
+  * \brief Has current measurement
+  *
+  * \return true if it has current measurement
+  */
+  virtual bool HasCurrentMeasurement(void) const = 0;
+
+protected:
+  core::cvmatrix *output;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  /*!
+  * \brief Set motors values
+  *
+  * values size must be the same as MotorsCount()
+  *
+  * \param values set motors values
+  */
+  virtual void SetMotors(float *values) = 0;
+
+  class Bldc_impl *pimpl_;
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // BLDC_H
Index: tags/latest/lib/FlairSensorActuator/src/Bldc_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Bldc_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Bldc_impl.cpp	(revision 209)
@@ -0,0 +1,210 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/14
+//  filename:   Bldc_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for brushless drivers
+//
+//
+/*********************************************************************/
+#include "Bldc_impl.h"
+#include "Bldc.h"
+#include <GridLayout.h>
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <cvmatrix.h>
+#include <Label.h>
+#include <PushButton.h>
+#include <DataPlot1D.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::actuator;
+
+Bldc_impl::Bldc_impl(Bldc *self, Layout *layout, string name,
+                     uint8_t motors_count) {
+  this->self = self;
+  this->motors_count = motors_count;
+  this->layout = layout;
+  are_enabled = false;
+  is_running = false;
+  tested_motor = -1;
+
+  values = (float *)malloc(motors_count * sizeof(float));
+  power = (float *)malloc(motors_count * sizeof(float));
+  for (int i = 0; i < motors_count; i++)
+    power[i] = 1;
+
+  // station sol
+  GroupBox *groupbox = new GroupBox(layout->NewRow(), "bldc");
+  flight_time = new Label(groupbox->NewRow(), "flight time");
+  min_value = new DoubleSpinBox(groupbox->NewRow(), "min value:", 0, 1, .1, 2);
+  max_value =
+      new DoubleSpinBox(groupbox->LastRowLastCol(), "max value:", 0, 1, .1, 2);
+  test_value =
+      new DoubleSpinBox(groupbox->LastRowLastCol(), "test value:", 0, 1, 0.1);
+
+  int index = 0;
+  button_test = (PushButton **)malloc(motors_count * sizeof(PushButton *));
+  for (int i = 0; i < motors_count / 2; i++) {
+    for (int j = 0; j < 2; j++) {
+      ostringstream test_name;
+      test_name << "test motor " << index;
+      button_test[index] =
+          new PushButton(groupbox->At(2 + i, j), test_name.str());
+      index++;
+    }
+  }
+
+  // flight time
+  FILE *file;
+  file = fopen("/etc/flight_time", "r");
+  if (file == NULL) {
+    time_sec = 0;
+  } else {
+    char ligne[32];
+    fgets(ligne, 32, file);
+    time_sec = atoi(ligne);
+    fclose(file);
+  }
+  flight_time->SetText("total flight time: %is = %imin = %ih\n", time_sec,
+                       time_sec / 60, time_sec / 3600);
+}
+
+Bldc_impl::Bldc_impl(Bldc *self, uint8_t motors_count) {
+  this->self = self;
+  this->motors_count = motors_count;
+  values = NULL;
+  button_test = NULL;
+  power = NULL;
+}
+
+Bldc_impl::~Bldc_impl() {
+  if (values != NULL)
+    free(values);
+  if (button_test != NULL)
+    free(button_test);
+  if (power != NULL)
+    free(power);
+}
+
+void Bldc_impl::UseDefaultPlot(TabWidget *tab) {
+  Tab *plot_tab = new Tab(tab, "speeds");
+  plots = new DataPlot1D(plot_tab->NewRow(), "values", 0, 1);
+  for (int i = 0; i < motors_count; i++) {
+    plots->AddCurve(self->output->Element(i));
+  }
+}
+
+void Bldc_impl::UpdateFrom(const io_data *data) {
+  cvmatrix *input = (cvmatrix *)data;
+  bool is_motor_running = false;
+
+  if (values == NULL)
+    return; // nothing to do in simulator
+
+  if (input->Rows() != motors_count) {
+    self->Err("nb motors mismatch\n");
+    return;
+  }
+
+  input->GetMutex();
+  for (int i = 0; i < motors_count; i++) {
+    if (input->ValueNoMutex(i, 0) != 0)
+      is_motor_running = true;
+    if (are_enabled) {
+      // Printf("%i %f %f\n",i,input->ValueNoMutex(i,0),power[i]);
+      values[i] = power[i] * Sat(input->ValueNoMutex(i, 0));
+      // Printf("%i %f\n",i,values[i]);
+    } else {
+      values[i] = 0;
+    }
+  }
+  input->ReleaseMutex();
+
+  if (are_enabled && is_motor_running && !is_running) {
+    flight_start_time = GetTime();
+    is_running = true;
+  }
+  if ((!are_enabled || !is_motor_running) && is_running) {
+    Time now = GetTime();
+    int t_sec;
+    FILE *file;
+    char ligne[32];
+
+    t_sec = (now - flight_start_time) / 1000000000;
+    time_sec += t_sec;
+
+    Printf("temps de vol: %is = %imin\n", t_sec, t_sec / 60);
+    // Printf("temps de vol total: %is = %imin =
+    // %ih\n",time_sec,time_sec/60,time_sec/3600);
+    flight_time->SetText("total flight time: %is = %imin = %ih\n", time_sec,
+                         time_sec / 60, time_sec / 3600);
+
+    file = fopen("/etc/flight_time", "w");
+    if (file == NULL) {
+      Printf("Erreur a l'ouverture du fichier d'info vol\n");
+    } else {
+      sprintf(ligne, "%i", time_sec);
+      fputs(ligne, file);
+      fclose(file);
+    }
+    is_running = false;
+  }
+
+  for (int i = 0; i < motors_count; i++) {
+    if (button_test[i]->Clicked() == true) {
+      if (!are_enabled) {
+        tested_motor = i;
+        test_start_time = GetTime();
+        LockUserInterface();
+      } else {
+        self->Warn("testing motor is not possible when enabled\n");
+      }
+    }
+  }
+  if (tested_motor != -1) {
+    for (int i = 0; i < motors_count; i++) {
+      values[i] = 0;
+    }
+    values[tested_motor] = test_value->Value();
+
+    if (GetTime() > (test_start_time + 2 * 1000000000)) {
+      tested_motor = -1;
+      UnlockUserInterface();
+    }
+  }
+
+  self->SetMotors(values);
+  self->output->SetDataTime(data->DataTime());
+  self->ProcessUpdate(self->output);
+}
+
+float Bldc_impl::Sat(float value) {
+  float result = value;
+
+  if (result < min_value->Value()) {
+    result = min_value->Value();
+  }
+  if (result > max_value->Value()) {
+    result = max_value->Value();
+  }
+
+  return result;
+}
+
+void Bldc_impl::LockUserInterface(void) const { layout->setEnabled(false); }
+
+void Bldc_impl::UnlockUserInterface(void) const { layout->setEnabled(true); }
Index: tags/latest/lib/FlairSensorActuator/src/Camera.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Camera.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Camera.cpp	(revision 209)
@@ -0,0 +1,179 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/03/06
+//  filename:   Camera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for Camera
+//
+//
+/*********************************************************************/
+
+#include "Camera.h"
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GroupBox.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <Picture.h>
+#include <VisionFilter.h>
+#include <highgui.h>
+#include <fstream>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+Camera::Camera(string name, uint16_t width,
+               uint16_t height, cvimage::Type::Format format)
+    : IODevice(getFrameworkManager(), name) {
+  plot_tab = NULL;
+	logFormat=LogFormat::NONE;
+
+  // do not allocate imagedata, allocation is done by the camera
+  output = new cvimage((IODevice *)this, width, height, format, "out", false);
+	
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Setup");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+  setup_layout = new GridLayout(sensor_tab->NewRow(), "setup");
+  
+}
+
+//This contructor must only be called for a simulated device.
+Camera::Camera(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
+
+  output = NULL;
+	logFormat=LogFormat::NONE;
+}
+
+Camera::~Camera() {
+  if (main_tab != NULL)
+    delete main_tab;
+}
+
+void Camera::SetLogFormat(LogFormat logFormat) {
+	this->logFormat=logFormat;
+	switch(logFormat) {
+		case LogFormat::RAW:
+			AddDataToLog(output);
+			Warn("raw log of cvimage is not yet implemented\n");
+			break;
+		case LogFormat::JPG:
+				Warn("logging cvimage to jpeg\n");
+				Warn("jpeg are not included in classical dbt file, as dbt does not handle variable length\n");
+			break;
+		default:
+			Warn("LogFormat unknown\n");
+	}
+}
+
+DataType const &Camera::GetOutputDataType() const {
+  return output->GetDataType();
+}
+
+GroupBox *Camera::GetGroupBox(void) const { return setup_groupbox; }
+
+GridLayout *Camera::GetLayout(void) const { return setup_layout; }
+
+void Camera::UseDefaultPlot(const core::cvimage *image) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plot_tab = new Tab(tab, "Picture");
+  Picture *plot = new Picture(plot_tab->NewRow(), ObjectName(), image);
+}
+
+Tab *Camera::GetPlotTab(void) const { return plot_tab; }
+
+uint16_t Camera::Width(void) const { return output->GetDataType().GetWidth(); }
+
+uint16_t Camera::Height(void) const {
+  return output->GetDataType().GetHeight();
+}
+
+core::cvimage *Camera::Output(void) { return output; }
+
+void Camera::ProcessUpdate(core::io_data* data) {
+	if(getFrameworkManager()->IsLogging() && getFrameworkManager()->IsDeviceLogged(this)) {
+		if(logFormat==LogFormat::JPG) {
+			data->GetMutex();
+			IplImage *img=((cvimage*)data)->img;
+			string filename=getFrameworkManager()->GetLogPath()+"/"+ObjectName()+"_"+std::to_string(data->DataTime())+".jpg";
+			switch(((cvimage*)data)->GetDataType().GetFormat()) {
+				case cvimage::Type::Format::Gray:
+					saveToJpeg(img,filename,PictureFormat_t::Gray,PictureFormat_t::Gray);
+					break;
+				case cvimage::Type::Format::BGR:
+					saveToJpeg(img,filename,PictureFormat_t::RGB,PictureFormat_t::RGB);
+					break;
+				case cvimage::Type::Format::UYVY:
+					saveToJpeg(img,filename,PictureFormat_t::YUV_422ile,PictureFormat_t::YUV_422p);
+					break;
+				default:
+					Warn("cannot log to this format\n");
+					break;
+			}
+			data->ReleaseMutex();
+		}
+	}
+	IODevice::ProcessUpdate(data);
+}
+
+void Camera::SavePictureToFile(string filename) const {
+	if(filename=="") filename="./"+ObjectName()+"_"+std::to_string(GetTime())+".jpg";
+  string::size_type idx = filename.rfind('.');
+
+	if(idx != string::npos) {
+		Printf("saving %s\n", filename.c_str());
+		string extension = filename.substr(idx+1);
+		
+		output->GetMutex();
+		if(extension=="jpg") {
+			if(output->GetDataType().GetFormat()==cvimage::Type::Format::Gray) saveToJpeg(output->img,filename,PictureFormat_t::Gray,PictureFormat_t::Gray);
+			if(output->GetDataType().GetFormat()==cvimage::Type::Format::BGR) saveToJpeg(output->img,filename,PictureFormat_t::RGB,PictureFormat_t::RGB);
+			if(output->GetDataType().GetFormat()==cvimage::Type::Format::UYVY) saveToJpeg(output->img,filename,PictureFormat_t::YUV_422ile,PictureFormat_t::YUV_422p);
+		} else {
+			cvSaveImage(filename.c_str(),output->img);
+		}
+		output->ReleaseMutex();
+    Printf("saving %s ok\n", filename.c_str());
+			
+	} else {
+		Warn("saving %s no file extension!\n", filename.c_str());
+	}
+}
+
+void Camera::SaveRawPictureToFile(string filename) const {
+  Printf("saving %s, size %i\n", filename.c_str(), output->img->imageSize);
+  std::ofstream pFile;
+  pFile.open(filename);
+  output->GetMutex();
+  pFile.write(output->img->imageData, output->img->imageSize);
+  output->ReleaseMutex();
+
+  pFile.close();
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Camera.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Camera.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Camera.h	(revision 209)
@@ -0,0 +1,172 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Camera.h
+ * \brief Base class for Camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/03/06
+ * \version 4.0
+ */
+
+#ifndef CAMERA_H
+#define CAMERA_H
+
+#include <IODevice.h>
+#include <stdint.h>
+#include <cvimage.h>
+
+namespace flair {
+	namespace gui {
+		class GroupBox;
+		class Tab;
+		class TabWidget;
+		class Picture;
+		class GridLayout;
+	}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class Camera
+*
+* \brief Base class for Camera
+*
+* Use this class to define a custom Camera.
+*
+*/
+class Camera : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera.
+  * It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param format image format
+  */
+  Camera(std::string name, uint16_t width,
+         uint16_t height, core::cvimage::Type::Format format);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Camera(const core::IODevice *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Camera();
+
+  /*!
+  * \brief Use default plot
+  *
+  * \param image image to display
+  */
+  void UseDefaultPlot(const core::cvimage *image);
+
+  /*!
+  * \brief get Layout
+  *
+  * \return a Layout available
+  */
+  gui::GridLayout *GetLayout(void) const;
+
+  /*!
+  * \brief plot tab
+  *
+  * \return plot tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Save raw picture to file
+  *
+  * \param filename filename
+  */
+  void SaveRawPictureToFile(std::string filename) const;
+	
+	/*!
+  * \brief Save picture to file
+  *
+  * \param filename filename; if ommitted, current time is used and file is saved in current directory with jpg compression
+  */
+  void SavePictureToFile(std::string filename="") const;
+
+  /*!
+  * \brief Width
+  *
+  * \return width
+  */
+  uint16_t Width(void) const;
+
+  /*!
+  * \brief Height
+  *
+  * \return height
+  */
+  uint16_t Height(void) const;
+
+  /*!
+ * \brief Output matrix
+ *
+ * Output matrix is of the same size as declared in constructor. \n
+ *
+ * \return the output matrix
+ */
+  core::cvimage *Output(void);
+
+  core::DataType const &GetOutputDataType() const;
+	
+	/*!
+	\enum LogFormat
+	\brief log formats
+	*/
+	enum class LogFormat {
+		NONE, /*!< by default, no logging */
+		RAW, /*!< raw format */
+		JPG, /*!< jpg format */
+	};
+	
+	/*!
+	* \brief Set log format
+	*
+	* Set the log format. \n
+	* Logging of the camera will be disabled if this method is not called. \n
+	* Calling this method enables logging of camera.
+	*
+	* \param LogFormat log format
+	*/
+  void SetLogFormat(LogFormat logFormat);
+void ProcessUpdate(core::io_data* data);
+protected:
+  /*!
+  * \brief get GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
+
+  core::cvimage *output;
+
+private:
+  gui::Tab *main_tab, *sensor_tab, *plot_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::GridLayout *setup_layout;
+	LogFormat logFormat;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // CAMERA_H
Index: tags/latest/lib/FlairSensorActuator/src/Controller.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Controller.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Controller.cpp	(revision 209)
@@ -0,0 +1,150 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/05/27
+//  filename:   Controller.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Utility classes for controllers
+//
+//
+/*********************************************************************/
+#include "Controller.h"
+
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+RumbleMessage::RumbleMessage(unsigned int leftForce, unsigned int leftTimeout,
+                             unsigned int rightForce, unsigned int rightTimeout)
+    : Message(sizeof(ControllerAction) + sizeof(leftForce) +
+              sizeof(leftTimeout) + sizeof(rightForce) + sizeof(rightTimeout)) {
+  SetLeftForce(leftForce);
+  SetLeftTimeout(leftTimeout);
+  SetRightForce(rightForce);
+  SetRightTimeout(rightTimeout);
+  buffer[0] = (char)ControllerAction::Rumble;
+}
+
+unsigned int RumbleMessage::GetLeftForce() const {
+  unsigned int leftForce;
+  memcpy(&leftForce, buffer + leftForceOffset, sizeof(leftForce));
+  return leftForce;
+}
+
+unsigned int RumbleMessage::GetLeftTimeout() const {
+  unsigned int leftTimeout;
+  memcpy(&leftTimeout, buffer + leftTimeoutOffset, sizeof(leftTimeout));
+  return leftTimeout;
+}
+
+unsigned int RumbleMessage::GetRightForce() const {
+  unsigned int rightForce;
+  memcpy(&rightForce, buffer + rightForceOffset, sizeof(rightForce));
+  return rightForce;
+}
+
+unsigned int RumbleMessage::GetRightTimeout() const {
+  unsigned int rightTimeout;
+  memcpy(&rightTimeout, buffer + rightTimeoutOffset, sizeof(rightTimeout));
+  return rightTimeout;
+}
+
+void RumbleMessage::SetLeftForce(unsigned int leftForce) {
+  memcpy(buffer + leftForceOffset, &leftForce, sizeof(leftForce));
+}
+
+void RumbleMessage::SetLeftTimeout(unsigned int leftTimeout) {
+  memcpy(buffer + leftTimeoutOffset, &leftTimeout, sizeof(leftTimeout));
+}
+
+void RumbleMessage::SetRightForce(unsigned int rightForce) {
+  memcpy(buffer + rightForceOffset, &rightForce, sizeof(rightForce));
+}
+
+void RumbleMessage::SetRightTimeout(unsigned int rightTimeout) {
+  memcpy(buffer + rightTimeoutOffset, &rightTimeout, sizeof(rightTimeout));
+}
+
+SwitchLedMessage::SwitchLedMessage(bool isOn, unsigned int ledId)
+    : Message(sizeof(ControllerAction) + sizeof(isOn) + sizeof(ledId)) {
+  if (isOn)
+    SetOn();
+  else
+    SetOff();
+  SetLedId(ledId);
+}
+
+bool SwitchLedMessage::IsOn() const {
+  bool isOn;
+  memcpy(&isOn, buffer + isOnOffset, sizeof(isOn));
+  return isOn;
+}
+
+unsigned int SwitchLedMessage::GetLedId() const {
+  unsigned int ledId;
+  memcpy(&ledId, buffer + ledIdOffset, sizeof(ledId));
+  return ledId;
+}
+
+void SwitchLedMessage::SetOn() {
+  bool isOn = true;
+  memcpy(buffer + isOnOffset, &isOn, sizeof(isOn));
+}
+
+void SwitchLedMessage::SetOff() {
+  bool isOn = false;
+  memcpy(buffer + isOnOffset, &isOn, sizeof(isOn));
+}
+
+void SwitchLedMessage::SetLedId(unsigned int ledId) {
+  memcpy(buffer + ledIdOffset, &ledId, sizeof(ledId));
+}
+
+FlashLedMessage::FlashLedMessage(unsigned int ledId, unsigned int onTime,
+                                 unsigned int offTime)
+    : Message(sizeof(ControllerAction) + sizeof(ledId) + sizeof(onTime) +
+              sizeof(offTime)) {
+  SetLedId(ledId);
+  SetOnTime(onTime);
+  SetOffTime(offTime);
+}
+
+unsigned int FlashLedMessage::GetLedId() const {
+  unsigned int ledId;
+  memcpy(&ledId, buffer + ledIdOffset, sizeof(ledId));
+  return ledId;
+}
+
+unsigned int FlashLedMessage::GetOnTime() const {
+  unsigned int onTime;
+  memcpy(&onTime, buffer + onTimeOffset, sizeof(onTime));
+  return onTime;
+}
+
+unsigned int FlashLedMessage::GetOffTime() const {
+  unsigned int offTime;
+  memcpy(&offTime, buffer + offTimeOffset, sizeof(offTime));
+  return offTime;
+}
+
+void FlashLedMessage::SetLedId(unsigned int ledId) {
+  memcpy(buffer + ledIdOffset, &ledId, sizeof(ledId));
+}
+
+void FlashLedMessage::SetOnTime(unsigned int onTime) {
+  memcpy(buffer + onTimeOffset, &onTime, sizeof(onTime));
+}
+
+void FlashLedMessage::SetOffTime(unsigned int offTime) {
+  memcpy(buffer + offTimeOffset, &offTime, sizeof(offTime));
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Controller.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Controller.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Controller.h	(revision 209)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/05/27
+//  filename:   Controller.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Utility classes for controllers
+//
+//
+/*********************************************************************/
+
+#ifndef CONTROLLER_H
+#define CONTROLLER_H
+
+#include <Object.h>
+#include <string.h>
+
+namespace flair {
+namespace core {
+class Message;
+}
+}
+
+namespace flair {
+namespace sensor {
+
+enum class ControllerAction { SetLedOn, SetLedOff, Rumble, FlashLed, Exit };
+
+class RumbleMessage : public core::Message {
+public:
+  RumbleMessage(unsigned int leftForce, unsigned int leftTimeout,
+                unsigned int rightForce, unsigned int rightTimeout);
+  unsigned int GetLeftForce() const;
+  unsigned int GetLeftTimeout() const;
+  unsigned int GetRightForce() const;
+  unsigned int GetRightTimeout() const;
+  void SetLeftForce(unsigned int leftForce);
+  void SetLeftTimeout(unsigned int leftTimeout);
+  void SetRightForce(unsigned int rightForce);
+  void SetRightTimeout(unsigned int rightTimeout);
+
+private:
+  static const unsigned int leftForceOffset = sizeof(ControllerAction);
+  static const unsigned int leftTimeoutOffset =
+      sizeof(ControllerAction) + sizeof(unsigned int);
+  static const unsigned int rightForceOffset =
+      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
+  static const unsigned int rightTimeoutOffset =
+      sizeof(ControllerAction) + 3 * sizeof(unsigned int);
+};
+
+class SwitchLedMessage : public core::Message {
+public:
+  SwitchLedMessage(bool isOn, unsigned int ledId);
+  bool IsOn() const;
+  unsigned int GetLedId() const;
+  void SetOn();
+  void SetOff();
+  void SetLedId(unsigned int ledId);
+
+private:
+  static const unsigned int isOnOffset = sizeof(ControllerAction);
+  static const unsigned int ledIdOffset =
+      sizeof(ControllerAction) + sizeof(bool);
+};
+
+class FlashLedMessage : public core::Message {
+public:
+  FlashLedMessage(unsigned int ledId, unsigned int onTime,
+                  unsigned int offTime);
+  unsigned int GetLedId() const;
+  unsigned int GetOnTime() const;
+  unsigned int GetOffTime() const;
+  void SetLedId(unsigned int ledId);
+  void SetOnTime(unsigned int onTime);
+  void SetOffTime(unsigned int offTime);
+
+private:
+  static const unsigned int ledIdOffset = sizeof(ControllerAction);
+  static const unsigned int onTimeOffset =
+      sizeof(ControllerAction) + sizeof(unsigned int);
+  static const unsigned int offTimeOffset =
+      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
+};
+}
+}
+
+#endif // CONTROLLER_H
Index: tags/latest/lib/FlairSensorActuator/src/EmulatedController.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/EmulatedController.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/EmulatedController.cpp	(revision 209)
@@ -0,0 +1,151 @@
+//  created:    2015/03/30
+//  filename:   EmulatedController.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class that emulate a remote control.
+//              Typical use case: run a demo without any reliable communication channel
+//
+/*********************************************************************/
+#include "EmulatedController.h"
+#include <Controller.h>
+#include <TcpSocket.h>
+#include <UdpSocket.h>
+#include <cstring>
+#include <string>
+#include <cvmatrix.h>
+#include <stdexcept>
+
+using namespace flair::core;
+using namespace flair::gui;
+using std::string;
+
+namespace flair { namespace sensor {
+
+EmulatedController::EmulatedController(string name,uint8_t priority) :
+    TargetController(name,priority) {
+  SetIsReady(true);
+}
+
+EmulatedController::~EmulatedController() {
+    //TargetController calls TargetEthController methods in its run
+    //we must stop the thread now
+    SafeStop();
+    Join();
+}
+
+bool EmulatedController::IsConnected() const {
+    return true;
+}
+
+bool EmulatedController::IsDataFrameReady(){
+    return true;
+}
+
+template<typename T> void EmulatedController::fillVectorNoMutex(cvmatrix &vector,T data[],unsigned int size) {
+    for (unsigned int i=0; i<size; i++) {
+        vector.SetValueNoMutex(i,0,data[i]);
+    }
+}
+
+void EmulatedController::fillVectorNoMutex(cvmatrix &destination,cvmatrix &source,unsigned int size) {
+    for (unsigned int i=0; i<size; i++) {
+        destination.SetValueNoMutex(i,0,source.Value(i,0));
+    }
+}
+
+void EmulatedController::StepData::Print() {
+    Printf("<StepData %s, duration=%d, axisData={%f,%f,%f,%f}, buttonData={%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c,%c} />\n",description.c_str(),durationMs,
+      axisData->Value(0,0),axisData->Value(1,0),axisData->Value(2,0),axisData->Value(3,0),
+      buttonData->Value(0,0)?'X':'-',buttonData->Value(1,0)?'X':'-',buttonData->Value(2,0)?'X':'-',buttonData->Value(3,0)?'X':'-',
+      buttonData->Value(4,0)?'X':'-',buttonData->Value(5,0)?'X':'-',buttonData->Value(6,0)?'X':'-',buttonData->Value(7,0)?'X':'-',
+      buttonData->Value(8,0)?'X':'-',buttonData->Value(9,0)?'X':'-',buttonData->Value(10,0)?'X':'-',buttonData->Value(11,0)?'X':'-',
+      buttonData->Value(12,0)?'X':'-',buttonData->Value(13,0)?'X':'-',buttonData->Value(14,0)?'X':'-',buttonData->Value(15,0)?'X':'-'
+    );
+}
+
+void EmulatedController::AddStep(unsigned int durationMs,string description,uint16_t buttonPressed, float leftAxisX, float leftAxisY, float rightAxisX, float rightAxisY) {
+    cvmatrix *axisMatrix=new cvmatrix((IODevice *)this,4,1,floatType);
+    axisMatrix->SetValueNoMutex(0,0,leftAxisX);
+    axisMatrix->SetValueNoMutex(1,0,leftAxisY);
+    axisMatrix->SetValueNoMutex(2,0,rightAxisX);
+    axisMatrix->SetValueNoMutex(3,0,rightAxisY);
+
+    cvmatrix *buttonMatrix=new cvmatrix((IODevice *)this,16,1,SignedIntegerType(8));
+    if (buttonPressed&(uint16_t)ButtonType::start) buttonMatrix->SetValueNoMutex(0,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::select) buttonMatrix->SetValueNoMutex(1,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::square) buttonMatrix->SetValueNoMutex(2,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::triangle) buttonMatrix->SetValueNoMutex(3,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::circle) buttonMatrix->SetValueNoMutex(4,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::cross) buttonMatrix->SetValueNoMutex(5,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::left1) buttonMatrix->SetValueNoMutex(6,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::left2) buttonMatrix->SetValueNoMutex(7,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::left3) buttonMatrix->SetValueNoMutex(8,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::right1) buttonMatrix->SetValueNoMutex(9,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::right2) buttonMatrix->SetValueNoMutex(10,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::right3) buttonMatrix->SetValueNoMutex(11,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::up) buttonMatrix->SetValueNoMutex(12,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::down) buttonMatrix->SetValueNoMutex(13,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::left) buttonMatrix->SetValueNoMutex(14,0,1);
+    if (buttonPressed&(uint16_t)ButtonType::right) buttonMatrix->SetValueNoMutex(15,0,1);
+
+    StepData step={durationMs,axisMatrix,buttonMatrix,description};
+    //step.Print();
+    steps.push_back(step);
+}
+
+void EmulatedController::ComputeControllerData(DataType dataType, cvmatrix &data) {
+    static Time startStepTime=GetTime();
+
+    Time now=GetTime();
+
+    axis->GetMutex();
+    button->GetMutex();
+
+    if (steps.empty()) {
+        if (dataType==DataType::axis) {
+            float values[]={0.,0.,0.,0.};
+            fillVectorNoMutex(data,values,4);
+        }
+        if (dataType==DataType::button) {
+            int values[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+            fillVectorNoMutex(data,values,16);
+        }
+    } else {
+        StepData currentStep=steps.front();
+        if (dataType==DataType::axis) fillVectorNoMutex(data,*(currentStep.axisData),4);
+        if (dataType==DataType::button) fillVectorNoMutex(data,*(currentStep.buttonData),16);
+        if (now-startStepTime>(Time)currentStep.durationMs*1000*1000) {
+            Thread::Info("Step '%s' done\n",currentStep.description.c_str());
+            startStepTime=now;
+            steps.pop_front();
+        }
+    }
+
+    button->ReleaseMutex();
+    axis->ReleaseMutex();
+}
+
+void EmulatedController::AcquireAxisData(core::cvmatrix &axis) {
+    ComputeControllerData(DataType::axis,axis);
+}
+
+void EmulatedController::AcquireButtonData(core::cvmatrix &button) {
+    ComputeControllerData(DataType::button,button);
+}
+
+bool EmulatedController::ProcessMessage(Message *msg) {
+    return false;
+}
+
+bool EmulatedController::ControllerInitialization() {
+    axisNumber=4;
+    buttonNumber=16;
+    return true;
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/EmulatedController.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/EmulatedController.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/EmulatedController.h	(revision 209)
@@ -0,0 +1,75 @@
+//  created:    2015/04/14
+//  filename:   EmulatedController.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class that emulate a remote control.
+//              Typical use case: run a demo without any reliable communication channel
+//
+//
+/*********************************************************************/
+
+#ifndef EMULATEDCONTROLLER_H
+#define EMULATEDCONTROLLER_H
+
+#include <TargetController.h>
+#include <list>
+
+namespace flair {
+    namespace core {
+        class cvmatrix;
+    }
+    namespace gui {
+        class Tab;
+        class TabWidget;
+        class DataPlot1D;
+    }
+}
+
+namespace flair { namespace sensor {
+    /*! \class EmulatedController
+    *
+    * \brief Emulated remote control
+    *
+    */
+    class EmulatedController : public TargetController {
+    public:
+        EmulatedController(std::string name,uint8_t priority=0);
+        ~EmulatedController();
+        enum class ButtonType : uint16_t {
+            start=0x0001,select=0x0002,square=0x0004,triangle=0x0008,
+            circle=0x0010,cross=0x0020,left1=0x0040,left2=0x0080,
+            left3=0x0100,right1=0x0200,right2=0x0400,right3=0x0800,
+            up=0x1000,down=0x2000,left=0x4000,right=0x8000
+        };
+        void AddStep(unsigned int durationMs,std::string description,uint16_t buttonPressed, float leftAxisX, float leftAxisY, float rightAxisX, float rightAxisY);
+    protected :
+        bool IsConnected() const;
+        //controller state stuff
+        bool ProcessMessage(core::Message *msg);
+        bool IsDataFrameReady();
+        void AcquireAxisData(core::cvmatrix &axis); //responsible for getting the axis data from the hardware
+        void AcquireButtonData(core::cvmatrix &button); //responsible for getting the button data from the hardware
+        bool ControllerInitialization();
+
+    private:
+        enum class DataType { axis,button };
+        void ComputeControllerData(DataType dataType, core::cvmatrix &data);
+        template<typename T> void fillVectorNoMutex(core::cvmatrix &vector,T data[],unsigned int size);
+        void fillVectorNoMutex(core::cvmatrix &destination,core::cvmatrix &source,unsigned int size);
+        struct StepData {
+            unsigned int durationMs; //milliseconds
+            core::cvmatrix *axisData;
+            core::cvmatrix *buttonData;
+            std::string description;
+            void Print();
+        };
+        std::list<StepData> steps;
+    };
+
+}}
+
+#endif // EMULATEDCONTROLLER_H
Index: tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.cpp	(revision 209)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/19
+//  filename:   Gx3_25_imu.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant la centrale 3dmgx3-25
+//
+//
+/*********************************************************************/
+
+#include "Gx3_25_imu.h"
+#include <FrameworkManager.h>
+#include "Gx3_25_imu_impl.h"
+#include <GroupBox.h>
+#include <ImuData.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+Gx3_25_imu::Gx3_25_imu(string name,
+                       SerialPort *serialport, Command_t command,
+                       uint8_t priority)
+    : Imu(name), Thread(getFrameworkManager(), name, priority) {
+  pimpl_ = new Gx3_25_imu_impl(this, name, serialport, command, GetGroupBox());
+
+  if (command == EulerAnglesAndAngularRates) {
+    Printf("Gx3_25_imu enabling EulerAnglesAndAngularRates\n");
+  } else if (command == AccelerationAngularRateAndOrientationMatrix) {
+    Printf("Gx3_25_imu enabling AccelerationAngularRateAndOrientationMatrix\n");
+  } else if (command == Quaternion) {
+    Printf("Gx3_25_imu enabling Quaternion\n");
+  } else {
+    Thread::Err("command not supported (%i)\n", command);
+  }
+  // AddDataToLog(imudata);
+}
+
+Gx3_25_imu::~Gx3_25_imu() {
+  SafeStop();
+  Join();
+  delete pimpl_;
+}
+
+void Gx3_25_imu::Run(void) { pimpl_->Run(); }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu.h	(revision 209)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Gx3_25_imu.h
+ * \brief Class for 3dmgx3-25 Imu
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef GX3_25_IMU_H
+#define GX3_25_IMU_H
+
+#include <Imu.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
+}
+
+class Gx3_25_imu_impl;
+
+namespace flair {
+namespace sensor {
+/*! \class Gx3_25_imu
+*
+* \brief Class for 3dmgx3-25 Imu
+*/
+class Gx3_25_imu : public Imu, public core::Thread {
+  friend class ::Gx3_25_imu_impl;
+
+public:
+  /*!
+  \enum Command_t
+  \brief Command for the continuous mode
+  */
+  enum Command_t {
+    EulerAnglesAndAngularRates = 0xcf, /*!< Euler angles and angular rates */
+    AccelerationAngularRateAndOrientationMatrix =
+        0xc8, /*!< Acceleration, angular rate and orientation matrix */
+    Quaternion = 0xdf, /*!< Quaternion */
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Gx3_25_imu. It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param serialport SerialPort
+  * \param command command for continuous mode
+  * \param priority priority of the Thread
+  */
+  Gx3_25_imu(std::string name,
+             core::SerialPort *serialport, Command_t command, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Gx3_25_imu();
+
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  class Gx3_25_imu_impl *pimpl_;
+};
+} // end namespace sensor
+} // end namespace flair
+
+#endif // GX3_25_IMU_H
Index: tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 209)
@@ -0,0 +1,628 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/19
+//  filename:   Gx3_25_imu_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant la centrale 3dmgx3-25
+//
+//
+/*********************************************************************/
+
+#include "Gx3_25_imu_impl.h"
+#include <FrameworkManager.h>
+#include <SerialPort.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <CheckBox.h>
+#include <PushButton.h>
+#include <Label.h>
+#include <ImuData.h>
+#include <AhrsData.h>
+#include <Euler.h>
+#include <Vector3D.h>
+#include <RotationMatrix.h>
+#include <OneAxisRotation.h>
+
+#include <math.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+Gx3_25_imu_impl::Gx3_25_imu_impl(Gx3_25_imu *self, string name,
+                                 SerialPort *serialport,
+                                 Gx3_25_imu::Command_t command,
+                                 GroupBox *setupgroupbox) {
+  int err = 0;
+
+  this->self = self;
+  this->command = (uint8_t)command;
+  this->setupgroupbox = setupgroupbox;
+  this->serialport = serialport;
+
+  ahrsData = new AhrsData((Imu *)self);
+
+  // station sol
+  button_bias = new PushButton(setupgroupbox->NewRow(), "gyros bias");
+  data_rate =
+      new SpinBox(setupgroupbox->NewRow(), "data rate (Hz):", 1, 500, 1, 200);
+  data_rate_label = new Label(setupgroupbox->LastRowLastCol(), "data_rate");
+  gyro_acc_size = new SpinBox(setupgroupbox->NewRow(),
+                              "gyro and acc filter win size:", 1, 32, 1, 15);
+  mag_size = new SpinBox(setupgroupbox->LastRowLastCol(),
+                         "mag filter win size:", 1, 32, 1, 17);
+  up_comp = new SpinBox(setupgroupbox->NewRow(), "up compensation (s):", 1,
+                        1000, 1, 10);
+  north_comp = new SpinBox(setupgroupbox->LastRowLastCol(),
+                           "north compensation (s):", 1, 1000, 1, 10);
+  coning =
+      new CheckBox(setupgroupbox->NewRow(), "enable Coning&Sculling:", true);
+  disable_magn = new CheckBox(setupgroupbox->LastRowLastCol(),
+                              "disable magnetometer:", true);
+  disable_north_comp = new CheckBox(
+      setupgroupbox->NewRow(), "disable magnetic north compensation:", false);
+  disable_grav_comp = new CheckBox(setupgroupbox->NewRow(),
+                                   "disable gravity compensation:", false);
+}
+
+Gx3_25_imu_impl::~Gx3_25_imu_impl() {}
+
+void Gx3_25_imu_impl::Run(void) {
+  Time imuTime;
+  ImuData *imuData;
+  Quaternion prevQuat;prevQuat.q0=-2;//for init
+  self->GetDatas(&imuData);
+
+  self->WarnUponSwitches(true);
+
+  // reset IMU to be sure it is at 115200
+  Printf("Gx3_25_imu::Reset IMU at 921600\n");
+  serialport->SetBaudrate(921600);
+  DeviceReset();
+  self->Thread::SleepMS(100);
+  serialport->FlushInput();
+  serialport->SetBaudrate(115200);
+
+  SetBaudrate(921600);
+  Printf("Gx3_25_imu firmware number: %i\n", FirmwareNumber());
+  PrintModelInfo();
+  SamplingSettings();
+  GyrosBias();
+  self->SetIsReady(true);
+  // RealignUpNorth(true,true);
+
+  // on provoque les 9 ValueChanged
+  for (int i = 0; i < 9; i++) {
+    if (data_rate->ValueChanged() == true ||
+        disable_magn->ValueChanged() == true ||
+        disable_north_comp->ValueChanged() == true ||
+        disable_grav_comp->ValueChanged() == true ||
+        coning->ValueChanged() == true ||
+        gyro_acc_size->ValueChanged() == true ||
+        mag_size->ValueChanged() == true || up_comp->ValueChanged() == true ||
+        north_comp->ValueChanged() == true) {
+      if (setupgroupbox->isEnabled() == true)
+        SamplingSettings();
+    }
+  }
+
+  SetContinuousMode(command);
+
+  while (!self->ToBeStopped()) {
+    if (command == Gx3_25_imu::EulerAnglesAndAngularRates) {
+      uint8_t response[31] = {0};
+      uint8_t *buf = &response[1];
+      GetData(response, sizeof(response), &imuTime);
+
+      Euler eulerAngles;
+      eulerAngles.roll = Dequeue(&buf);
+      eulerAngles.pitch = Dequeue(&buf);
+      eulerAngles.yaw = Dequeue(&buf);
+
+      Vector3Df filteredAngRates;
+      filteredAngRates.x = Dequeue(&buf);
+      filteredAngRates.y = Dequeue(&buf);
+      filteredAngRates.z = Dequeue(&buf);
+
+      Quaternion quaternion=eulerAngles.ToQuaternion();
+      self->ApplyRotation(filteredAngRates);
+      self->ApplyRotation(quaternion);
+      ahrsData->SetQuaternionAndAngularRates(quaternion,
+                                             filteredAngRates);
+    } else if (command ==
+               Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix) {
+      uint8_t response[67] = {0};
+      uint8_t *buf = &response[1];
+      GetData(response, sizeof(response), &imuTime);
+
+      Vector3Df rawAcc;
+      rawAcc.x = 9.80665 * Dequeue(&buf);
+      rawAcc.y = 9.80665 * Dequeue(&buf);
+      rawAcc.z = 9.80665 * Dequeue(&buf);
+
+      Vector3Df filteredAngRates;
+      filteredAngRates.x = Dequeue(&buf);
+      filteredAngRates.y = Dequeue(&buf);
+      filteredAngRates.z = Dequeue(&buf);
+
+      RotationMatrix matrix;
+      matrix(0, 0) = Dequeue(&buf);
+      matrix(0, 1) = Dequeue(&buf);
+      matrix(0, 2) = Dequeue(&buf);
+      matrix(1, 0) = Dequeue(&buf);
+      matrix(1, 1) = Dequeue(&buf);
+      matrix(1, 2) = Dequeue(&buf);
+      matrix(2, 0) = Dequeue(&buf);
+      matrix(2, 1) = Dequeue(&buf);
+      matrix(2, 2) = Dequeue(&buf);
+
+      Quaternion quaternion=matrix.ToQuaternion();
+      
+      //try to keep quaternion continuous (select between quaternion or -quaternion)
+      if(prevQuat.q0!=-2) {//skip first iteration
+        //search the greatest absolute value to avoid problems near 0 (quaternion's norm=1)
+        if(fabs(prevQuat.q0)>=fabs(prevQuat.q1) && fabs(prevQuat.q0)>=fabs(prevQuat.q2) && fabs(prevQuat.q0)>=fabs(prevQuat.q3)) {
+          if(prevQuat.q0*quaternion.q0<0) {//if signs are different
+            quaternion=-quaternion;
+          }
+        } else if(fabs(prevQuat.q1)>=fabs(prevQuat.q0) && fabs(prevQuat.q1)>=fabs(prevQuat.q2) && fabs(prevQuat.q1)>=fabs(prevQuat.q3)) {
+          if(prevQuat.q1*quaternion.q1<0) {//if signs are different
+            quaternion=-quaternion;
+          }
+        } else if(fabs(prevQuat.q2)>=fabs(prevQuat.q0) && fabs(prevQuat.q2)>=fabs(prevQuat.q1) && fabs(prevQuat.q2)>=fabs(prevQuat.q3)) {
+          if(prevQuat.q2*quaternion.q2<0) {//if signs are different
+            quaternion=-quaternion;
+          }
+        } else if(fabs(prevQuat.q3)>=fabs(prevQuat.q0) && fabs(prevQuat.q3)>=fabs(prevQuat.q1) && fabs(prevQuat.q3)>=fabs(prevQuat.q2)) {
+          if(prevQuat.q3*quaternion.q3<0) {//if signs are different
+            quaternion=-quaternion;
+          }
+        }
+      }
+      prevQuat=quaternion;
+      
+      self->ApplyRotation(filteredAngRates);
+      self->ApplyRotation(quaternion);
+      ahrsData->SetQuaternionAndAngularRates(quaternion,
+                                             filteredAngRates);
+                                             
+      self->ApplyRotation(rawAcc);
+      imuData->SetRawAcc(rawAcc);
+    } else if (command == Gx3_25_imu::Quaternion) {
+      uint8_t response[23] = {0};
+      uint8_t *buf = &response[1];
+      GetData(response, sizeof(response), &imuTime);
+
+      Quaternion quaternion;
+      quaternion.q0 = Dequeue(&buf);
+      quaternion.q1 = Dequeue(&buf);
+      quaternion.q2 = Dequeue(&buf);
+      quaternion.q3 = Dequeue(&buf);
+
+      Vector3Df filteredAngRates;
+      filteredAngRates.x = 0;
+      filteredAngRates.y = 0;
+      filteredAngRates.z = 0;
+
+      self->ApplyRotation(filteredAngRates);
+      self->ApplyRotation(quaternion);
+      ahrsData->SetQuaternionAndAngularRates(quaternion,
+                                             filteredAngRates);
+    }
+
+    // change settings as soon as possible
+    // we assume that new imu datas will not come so fast
+    // so newt message from imu is an ack from the change settings
+    if (button_bias->Clicked() == true)
+      GyrosBias();
+
+    if (data_rate->ValueChanged() == true ||
+        disable_magn->ValueChanged() == true ||
+        disable_north_comp->ValueChanged() == true ||
+        disable_grav_comp->ValueChanged() == true ||
+        coning->ValueChanged() == true ||
+        gyro_acc_size->ValueChanged() == true ||
+        mag_size->ValueChanged() == true || up_comp->ValueChanged() == true ||
+        north_comp->ValueChanged() == true) {
+      if (setupgroupbox->isEnabled() == true)
+        SamplingSettings();
+    }
+
+    imuData->SetDataTime(imuTime);
+    ahrsData->SetDataTime(imuTime);
+    self->ProcessUpdate(ahrsData);
+  }
+  SetContinuousMode(0);
+  SetBaudrate(115200);
+
+  self->WarnUponSwitches(false);
+}
+
+void Gx3_25_imu_impl::GetData(uint8_t *buf, ssize_t buf_size, Time *time) {
+  ssize_t read = 0;
+  ssize_t written = 0;
+  /*
+      written = serialport->Write(&command, sizeof(command));
+      if(written<0)
+      {
+          self->Thread::Err("Write error (%s)\n",strerror(-written));
+      }
+      else if (written != sizeof(command))
+      {
+          self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
+      }
+  */
+  read = serialport->Read(buf, buf_size);
+  *time = GetTime();
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != buf_size) {
+    self->Thread::Err("Read error %i/%i\n", read, buf_size);
+  }
+
+  if (CalcChecksum(buf, buf_size) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return;
+  }
+}
+
+float Gx3_25_imu_impl::Dequeue(uint8_t **buf) {
+  union float_4uint8 {
+    float f;
+    uint8_t b[4];
+  } float_value;
+
+  float_value.b[0] = (*buf)[3];
+  float_value.b[1] = (*buf)[2];
+  float_value.b[2] = (*buf)[1];
+  float_value.b[3] = (*buf)[0];
+  (*buf) += sizeof(float);
+
+  return float_value.f;
+}
+
+void Gx3_25_imu_impl::GyrosBias(void) {
+  if (setupgroupbox->isEnabled() == true) { // devrait toujours etre bon
+    uint8_t response[19] = {0};
+    uint8_t command[5];
+    ssize_t read = 0;
+    ssize_t written = 0;
+
+    Printf("Gx3_25_imu::calibrating gyros, do not move imu\n");
+
+    command[0] = 0xcd; // entete
+    command[1] = 0xc1; // confirm
+    command[2] = 0x29; // confirm
+    command[3] = 0x27; // time MSB en us
+    command[4] = 0x10; // time LSB en us
+
+    written = serialport->Write(&command, sizeof(command));
+    if (written < 0) {
+      self->Thread::Err("Write error (%s)\n", strerror(-written));
+    } else if (written != sizeof(command)) {
+      self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+    }
+
+    self->SleepUS(1.1 * (command[3] * 256 +
+                         command[4])); // on fait un sleep un peu plus grand
+
+    read = serialport->Read(&response[0], sizeof(response));
+    if (read < 0) {
+      self->Thread::Err("Read error (%s)\n", strerror(-read));
+    } else if (read != sizeof(response)) {
+      self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+    }
+
+    if (CalcChecksum(response, sizeof(response)) == false) {
+      self->Thread::Err("wrong checksum\n");
+      // return -1;
+    }
+
+    Printf("Gx3_25_imu::calibration done\n");
+
+  } else {
+    self->Thread::Err("error locked\n");
+  }
+}
+
+void Gx3_25_imu_impl::SetContinuousMode(uint8_t continuous_command) {
+  uint8_t response[8] = {0};
+  uint8_t command[4];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  command[0] = 0xc4; // entete
+  command[1] = 0xc1; // confirm
+  command[2] = 0x29; // confirm
+  command[3] = continuous_command;
+
+  written = serialport->Write(command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(response, sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n", self->IODevice::ObjectName().c_str());
+  }
+}
+
+void Gx3_25_imu_impl::SamplingSettings(void) {
+  uint8_t response[19] = {0};
+  uint8_t command[20];
+  uint8_t result;
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  uint16_t rate = 1000 / data_rate->Value();
+
+  command[0] = 0xdb;               // entete
+  command[1] = 0xa8;               // confirm
+  command[2] = 0xb9;               // confirm
+  command[3] = 1;                  // change values
+  command[4] = (rate >> 8) & 0xff; // data rate MSB
+  command[5] = rate & 0xff;        // data rate LSB
+  result = 0;
+  if (disable_magn->IsChecked() == true) result |= 0x01;
+  if (disable_north_comp->IsChecked() == true) result |= 0x04;
+  if (disable_grav_comp->IsChecked() == true) result |= 0x08;
+  if (this->command == Gx3_25_imu::Quaternion) result |= 0x10;//enable quaternion
+  command[6] = result;
+
+  result = 0x01; // Calculate orientation
+  if (coning->IsChecked() == true)
+    result |= 0x02;
+
+  command[7] = result;
+  command[8] = gyro_acc_size->Value();             // gyro acc filter window
+  command[9] = mag_size->Value();                  // mag filter window
+  command[10] = (up_comp->Value() >> 8) & 0xff;    // up comp MSB
+  command[11] = up_comp->Value() & 0xff;           // up comp LSB
+  command[12] = (north_comp->Value() >> 8) & 0xff; // north comp MSB
+  command[13] = north_comp->Value() & 0xff;        // north comp LSB
+  command[14] = 0;                                 // reserved
+  command[15] = 0;                                 // reserved
+  command[16] = 0;                                 // reserved
+  command[17] = 0;                                 // reserved
+  command[18] = 0;                                 // reserved
+  command[19] = 0;                                 // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n", self->IODevice::ObjectName().c_str());
+  } else {
+    data_rate_label->SetText("real: %.2fHz", 1000. / rate);
+  }
+}
+
+void Gx3_25_imu_impl::SetBaudrate(int value) {
+  uint8_t response[10] = {0};
+  uint8_t command[11];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  union int32_4uint8 {
+    int32_t i;
+    uint8_t b[4];
+  } baudrate_value;
+
+  baudrate_value.i = value;
+  Printf("Gx3_25_imu::SetBaudrate: %s ->%i\n",
+         self->IODevice::ObjectName().c_str(), baudrate_value.i);
+
+  command[0] = 0xd9; // entete
+  command[1] = 0xc3; // confirm
+  command[2] = 0x55; // confirm
+  command[3] = 1;    // primary uart
+  command[4] = 1;    // chgt temporaire
+  command[5] = baudrate_value.b[3];
+  command[6] = baudrate_value.b[2];
+  command[7] = baudrate_value.b[1];
+  command[8] = baudrate_value.b[0];
+  command[9] = 2;  // uart enabled
+  command[10] = 0; // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return;
+  }
+
+  serialport->SetBaudrate(value);
+}
+
+int Gx3_25_imu_impl::FirmwareNumber(void) {
+  uint8_t response[7] = {0};
+  uint8_t command;
+  ssize_t read = 0;
+  ssize_t written = 0;
+  union int32_4uint8 {
+    int32_t i;
+    uint8_t b[4];
+  } value;
+
+  command = 0xe9; // entete
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return -1;
+  }
+
+  value.b[3] = response[1];
+  value.b[2] = response[2];
+  value.b[1] = response[3];
+  value.b[0] = response[4];
+
+  return value.i;
+}
+
+void Gx3_25_imu_impl::PrintModelInfo(void) {
+  uint8_t response[20] = {0};
+  uint8_t command[2];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  for (int i = 0; i < 3; i++) {
+    command[0] = 0xea; // entete
+    command[1] = i;    // entete
+
+    written = serialport->Write(&command, sizeof(command));
+    if (written < 0) {
+      self->Thread::Err("Write error (%s)\n", strerror(-written));
+    } else if (written != sizeof(command)) {
+      self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+    }
+
+    read = serialport->Read(&response[0], sizeof(response));
+    if (read < 0) {
+      self->Thread::Err("Read error (%s)\n", strerror(-read));
+    } else if (read != sizeof(response)) {
+      self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+    }
+
+    if (CalcChecksum(response, sizeof(response)) == false) {
+      self->Thread::Err("wrong checksum\n");
+      // return -1;
+    }
+
+    char *msg = (char *)(&response[2]);
+    msg[16] = 0;
+    switch (i) {
+    case 0:
+      Printf("Gx3_25_imu model number: %s\n", msg);
+      break;
+    case 1:
+      Printf("Gx3_25_imu serial number: %s\n", msg);
+      break;
+    case 2:
+      Printf("Gx3_25_imu model name: %s\n", msg);
+      break;
+    }
+  }
+}
+
+void Gx3_25_imu_impl::RealignUpNorth(bool realign_up, bool realign_north) {
+  uint8_t response[7] = {0};
+  uint8_t command[10];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  command[0] = 0xdd; // entete
+  command[1] = 0x54; // confirm
+  command[2] = 0x4c; // confirm
+  command[3] = 0;    // send reply
+  command[4] = 255;  // up realign
+  command[5] = 1;    // north realign
+  command[6] = 0;    // reserved
+  command[7] = 0;    // reserved
+  command[8] = 0;    // reserved
+  command[9] = 0;    // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error(%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+  }
+}
+
+void Gx3_25_imu_impl::DeviceReset(void) {
+  uint8_t command[3];
+  ssize_t written = 0;
+
+  command[0] = 0xfe; // entete
+  command[1] = 0x9e; // confirm
+  command[2] = 0x3a; // confirm
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+}
+
+bool Gx3_25_imu_impl::CalcChecksum(uint8_t *buf, int size) {
+  uint16_t tChksum, tResponseChksum;
+
+  tChksum = 0;
+  for (int i = 0; i < size - 2; i++)
+    tChksum += buf[i];
+  // Extract the big-endian checksum from reply
+  tResponseChksum = 0;
+  tResponseChksum = buf[size - 2] << 8;
+  tResponseChksum += buf[size - 1];
+
+  if (tChksum != tResponseChksum)
+    return false;
+  else
+    return true;
+}
Index: tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 209)
@@ -0,0 +1,256 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+//  created:    2013/08/23
+//  filename:   HokuyoUTM30Lx.cpp
+//
+//  author:     Cesar Richard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe intégrant le telemetre laser Hokuyo UTM 30lx
+//
+//
+/*********************************************************************/
+
+#include "HokuyoUTM30Lx.h"
+#include <SerialPort.h>
+#include <FrameworkManager.h>
+#include <RangeFinderPlot.h>
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <sstream>
+#include <iomanip>
+#include <string.h>
+#include <iostream>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+HokuyoUTM30Lx::HokuyoUTM30Lx(string name,
+                             SerialPort *serialport, uint8_t priority)
+    : LaserRangeFinder(name), Thread(getFrameworkManager(), name, priority) {
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1081, 1);
+  output = new cvmatrix((IODevice *)this, desc, SignedIntegerType(16));
+  delete desc;
+
+  bufRetMut =
+      new Mutex(reinterpret_cast<Object *>(this), (string)name + "BufRetMut");
+  sendingCmdMut = new Mutex(reinterpret_cast<Object *>(this),
+                            (string)name + "SendingCmdMut");
+
+  this->serialport = serialport;
+  serialport->SetRxTimeout(100000000);
+  
+  SetIsReady(true);
+}
+
+HokuyoUTM30Lx::~HokuyoUTM30Lx() {
+  delete main_tab;
+  SafeStop();
+  Join();
+}
+
+void HokuyoUTM30Lx::Run(void) {
+  /** Debut init **/
+  char c, lastC;
+  int startStep;
+  bool mustDecode = false;
+  stringstream ss;
+  vector<string> ret;
+  lastC = c = 0;
+
+  /** Fin init **/
+  resetConfig();
+  startLaser();
+  Printf("Laser started\r\n");
+
+  /** Debut running loop **/
+  WarnUponSwitches(true);
+
+  while (!ToBeStopped()) {
+    ss.clear();
+    ss.str("");
+    do {
+      lastC = c;
+      serialport->Read(&c, 1);
+      ss << c;
+    } while (!(c == '\n' && lastC == '\n'));
+    ret = explode(ss.str(), '\n');
+    if (!checkSum(ret.at(1)))
+      perror("Bad Checksum !");
+    if (ret.at(0).substr(0, 2) == "MD")
+      mustDecode = true;
+
+    startStep = atoi(ret.at(0).substr(2, 4).c_str());
+    ret.erase(ret.begin());
+    bufRetMut->GetMutex();
+    bufRet.push(ret.at(0).substr(0, 2));
+    bufRetMut->ReleaseMutex();
+    if (mustDecode) {
+      mustDecode = false;
+      ss.clear();
+      ss.str("");
+      do {
+        lastC = c;
+        serialport->Read(&c, 1);
+        ss << c;
+      } while (!(c == '\n' && lastC == '\n'));
+      ret = explode(ss.str(), '\n');
+      ret.erase(ret.begin());
+      ret.erase(ret.begin());
+      if (ret.at(0).size() == 5)
+        if (!checkSum(ret.at(0)))
+          perror("TimeStamp checksum error!");
+      ret.erase(ret.begin());
+      Printf("!post\r\n");
+      ret.pop_back();
+      decodeDatas(ret, startStep);
+    }
+  }
+  /** fin running loop **/
+  stopLaser();
+  WarnUponSwitches(false);
+}
+
+void HokuyoUTM30Lx::decodeDatas(vector<string> datas, int startStep) {
+  stringstream ss;
+  for (unsigned i = 0; i < datas.size(); i++) {
+    if (datas.at(i).size() != 0) {
+      if (!checkSum(datas.at(i)))
+        perror("Datas checksum error !");
+      datas.at(i).erase(datas.at(i).end() - 1);
+      ss << datas.at(i);
+    }
+  }
+  output->GetMutex();
+  for (unsigned i = 0; i < 1080; i++) {
+    // TODO: remettre -1 pour les points non lus
+    output->SetValueNoMutex(i, 0, 0);
+  }
+  for (unsigned i = 0; i < ss.str().size(); i += 3) {
+    output->SetValueNoMutex(startStep + (i / 3), 0,
+                            decode3car(ss.str().substr(i, 3).c_str()));
+  }
+  UpdateFrom(output);
+  ProcessUpdate(output);
+  output->ReleaseMutex();
+}
+
+bool HokuyoUTM30Lx::checkSum(string data) {
+  return (char)encodeSum(data.substr(0, data.size() - 1).c_str(),
+                         data.size() - 1) == data.at(data.size() - 1);
+}
+
+void HokuyoUTM30Lx::startLaser() {
+  string ret = sendCommand("BM");
+#ifdef VERBOSE
+  if (ret == "00") {
+    cout << "BM: Alright !" << endl;
+  } else if (ret == "01") {
+    cout << "BM: Laser malfunction !" << endl;
+  } else if (ret == "02") {
+    cout << "BM: Laser already started !" << endl;
+  }
+#endif
+}
+
+void HokuyoUTM30Lx::stopLaser() { sendCommand("QT"); }
+
+void HokuyoUTM30Lx::resetConfig() { sendCommand("RS"); }
+
+vector<string> HokuyoUTM30Lx::explode(const string str, char delimiter) {
+  istringstream split(str);
+  vector<string> tokens;
+  for (string each; getline(split, each, delimiter); tokens.push_back(each))
+    ;
+  return tokens;
+}
+
+int HokuyoUTM30Lx::encodeSum(const char *code, int byte) {
+  unsigned char value = 0;
+  int i;
+  for (i = 0; i < byte; ++i) {
+    value += code[i];
+  }
+  value &= 0x3f;
+  value += 0x30;
+  return value;
+}
+
+float HokuyoUTM30Lx::decode2car(const char *data) {
+  return ((data[0] - 0x30) << 6) | ((data[1] - 0x30));
+}
+float HokuyoUTM30Lx::decode3car(const char *data) {
+  return ((data[0] - 0x30) << 12) | ((data[1] - 0x30) << 6) |
+         ((data[2] - 0x30));
+}
+float HokuyoUTM30Lx::decode4car(const char *data) {
+  return ((data[0] - 0x30) << 18) | ((data[1] - 0x30) << 12) |
+         ((data[2] - 0x30) << 6) | ((data[3] - 0x30));
+}
+
+string HokuyoUTM30Lx::sendCommand(string command) {
+  char c;
+  string ret = "00";
+  c = '\n';
+  sendingCmdMut->GetMutex();
+  serialport->Write(command.c_str(), command.size());
+  serialport->Write(&c, 1);
+  sendingCmdMut->ReleaseMutex();
+  return ret;
+}
+
+void HokuyoUTM30Lx::getMesure(int startStep, int endStep, int clusterCount,
+                              int interval, int scanNumber) {
+  stringstream ss;
+  string ret;
+  ss << "MD" << std::setfill('0') << std::setw(4) << startStep << std::setw(4)
+     << endStep << std::setw(2) << clusterCount << std::setw(1) << interval
+     << std::setw(2) << scanNumber;
+  ret = sendCommand(ss.str());
+#ifdef VERBOSE
+  if (ret == "00") {
+    cout << "MD: Alright !" << endl;
+  } else if (ret == "01") {
+    cout << "MD: Laser malfunction !" << endl;
+  } else if (ret == "02") {
+    cout << "MD: End Step has non-numeric value !" << endl;
+  } else if (ret == "03") {
+    cout << "MD: Cluster Count has non-numeric value !" << endl;
+  } else if (ret == "04") {
+    cout << "MD: End Step is out of range !" << endl;
+  } else if (ret == "05") {
+    cout << "MD: End Step is smaller than Starting Step !" << endl;
+  } else if (ret == "06") {
+    cout << "MD: Scan Interval has non-numeric value !" << endl;
+  } else if (ret == "07") {
+    cout << "MD: Number of Scan has non-numeric value !" << endl;
+  } else if (ret == "98") {
+    cout << "MD: Resumption of process after confirming normal HokuyoUTM30Lx "
+            "operation." << endl;
+  } else {
+    /* Concerne :
+    21~49 --- Processing stopped to verify the error.
+    50~97 --- Hardware trouble (such as laser, motor malfunctions etc.)*/
+    cout << "MD: Malfunction !" << endl;
+  }
+#endif
+}
+cvmatrix *HokuyoUTM30Lx::getDatas() { return output; }
+
+void HokuyoUTM30Lx::UseDefaultPlot(void) {
+  plot = new RangeFinderPlot(main_tab->NewRow(), "plot", "x", -100, 100, "y",
+                             -0, 100, output, -45, 225, output->Rows());
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h	(revision 209)
@@ -0,0 +1,170 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file HokuyoUTM30Lx.h
+ * \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
+ * \author César Richard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/22
+ * \version 1.0
+ */
+
+#ifndef HOKUYOUTM30LX_H
+#define HOKUYOUTM30LX_H
+
+#include <Thread.h>
+#include <LaserRangeFinder.h>
+#include <Mutex.h>
+
+#include <queue>
+#include <vector>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class SerialPort;
+class Mutex;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class RangeFinderPlot;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class HokuyoUTM30Lx
+*
+* \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
+*/
+class HokuyoUTM30Lx : public core::Thread, public LaserRangeFinder {
+public:
+  /*!
+ * \brief Constructor
+ *
+ * Construct a Hokuyo UTM30-Lx.
+ * It will be child of the FrameworkManage
+ * 
+ * \param name name
+ * \param serialport serialport
+ * \param priority priority of the Thread
+ */
+  HokuyoUTM30Lx(std::string name,
+                core::SerialPort *serialport, uint8_t priority);
+  void getMesure(int startStep, int endStep, int clusterCount, int interval,
+                 int scanNumber = 0);
+  core::cvmatrix *getDatas(void);
+
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~HokuyoUTM30Lx();
+
+private:
+  core::SerialPort *serialport;
+  core::Mutex *bufRetMut;
+  core::Mutex *sendingCmdMut;
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::RangeFinderPlot *plot;
+
+  // matrix
+  core::cvmatrix *output;
+
+  std::queue<std::string> bufRet;
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  /*!
+  * \brief Send a command
+  * \param command Command to send (see Hokuyo UTM 30-LX doc for more
+  * informations)
+  * \return Return code
+  */
+  std::string sendCommand(std::string command);
+  /*!
+  * \brief Start the laser
+  *
+  */
+  void startLaser(void);
+  /*!
+  * \brief Stop the laser
+  *
+  */
+  void stopLaser(void);
+  /*!
+* \brief Stop and reset the laser's settings
+*
+*/
+  void resetConfig(void);
+  /*!
+* \brief Decode incomming datas
+* \param datas Datas to decode
+* \param startStep Set the first mesured point
+* Decode mesured points from incoming datas and fill the output matrix
+*/
+  void decodeDatas(std::vector<std::string> datas, int startStep);
+  /*!
+  * \brief Explode a string into a vector
+  * \param str The string to explode
+  * \param delimiter The character separating elements
+  * \return A vector containing the elements
+  */
+  static std::vector<std::string> explode(const std::string str,
+                                          char delimiter);
+  /*!
+* \brief Calculate the checksum
+* \param code Data from which calculate
+* \param byte Data's size
+* \return A character corresponding to the code's checksum
+*/
+  static int encodeSum(const char *code, int byte);
+  /*!
+* \brief Check if a data correspond to its checksum
+* \param data Datas to check
+*/
+  static bool checkSum(std::string data);
+  /*!
+* \brief Decode datas using the 2 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode2car(const char *data);
+  /*!
+* \brief Decode datas using the 3 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode3car(const char *data);
+  /*!
+* \brief Decode datas using the 4 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode4car(const char *data);
+
+  /*!
+* \brief Update using provided datas
+*
+* Reimplemented from IODevice.
+*
+* \param data data from the parent to process
+*/
+  void UpdateFrom(const core::io_data *data){};
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // HOKUYOUTM30LX_H
Index: tags/latest/lib/FlairSensorActuator/src/HostEthController.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/HostEthController.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/HostEthController.cpp	(revision 209)
@@ -0,0 +1,303 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/30
+//  filename:   HostEthController.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for host side remote controls that talks to target
+//  side through ethernet connection
+//
+//
+/*********************************************************************/
+#include "HostEthController.h"
+#include <Controller.h>
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <Label.h>
+#include <DataPlot1D.h>
+#include <FrameworkManager.h>
+#include <TargetController.h>
+#include <TcpSocket.h>
+#include <UdpSocket.h>
+#include <cstring>
+#include <string>
+#include <cmath> //for sqrt
+#include <sched.h>
+
+#include <iostream>
+
+using namespace flair::core;
+using namespace flair::gui;
+using std::string;
+
+namespace flair {
+namespace sensor {
+
+HostEthController::HostEthController(string name, string _address, int _port,
+                                     uint32_t period, uint32_t _bitsPerAxis,
+                                     uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), IODevice(getFrameworkManager(), name),
+      tab(new Tab(getFrameworkManager()->GetTabWidget(), name)), axisNumber(0),
+      buttonNumber(0), targetAddress(_address), targetPort(_port),
+      bitsPerAxis(_bitsPerAxis), dataFrameBuffer(NULL),
+      meaningfulDataAvailable(false) {
+  tabWidget = new TabWidget(tab->NewRow(), name);
+
+  const bool blocking = true;
+  controlSocket = new TcpSocket((Thread *)this, "eth controller control socket",
+                                blocking, !blocking);
+  dataSocket = new UdpSocket((Thread *)this, "eth controller data socket",
+                          _address + ":" + std::to_string(_port + 1));
+  dataSender =
+      new DataSender((Thread *)this, this, "eth controller data sender thread");
+  dataSender->SetPeriodMS(period);
+  dataSender->Start();
+
+  // test binary
+  /*
+  uint16_t testValue=0b0111011010; //0x1DA
+  char buffer[3]={(char)0b10101011, (char)0b01100101, (char)0b10110110}; //
+  0xAB65B6
+  writeBits(testValue,10,buffer,7); // 0b1010101 0 11101101 0 0110110 0xAAED36
+  Thread::Info("Debug: buffer after bits written=%X %X\n",buffer[0],buffer[1]);
+  */
+  connectionEstablishedMutex = new Mutex((Thread *)this);
+}
+
+HostEthController::~HostEthController() {
+  SafeStop();
+  Join();
+
+  if (!getFrameworkManager()->ConnectionLost())
+    delete tab;
+}
+
+void HostEthController::DrawUserInterface() {
+  Tab *plotTab = new Tab(tabWidget, "Measures");
+  axisPlot = new DataPlot1D *[axisNumber];
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // Start a new row or add up to the current row? We try to keep a 4/3 ratio
+    unsigned int columns = sqrt(4.0 * axisNumber / 3.0);
+    LayoutPosition *position;
+    if (i % columns == 0) {
+      position = plotTab->NewRow();
+    } else {
+      position = plotTab->LastRowLastCol();
+    }
+    axisPlot[i] = new DataPlot1D(position, axis->Name(i, 0),
+                                 -(1 << (nativeBitsPerAxis - 1)) * 1.2,
+                                 (1 << (nativeBitsPerAxis - 1)) * 1.5);
+    axisPlot[i]->AddCurve(axis->Element(i));
+  }
+  // we don't plot the button state for now
+}
+
+string HostEthController::GetAxisDescription(unsigned int axis) {
+  return string("axis") + std::to_string(axis);
+}
+
+string HostEthController::GetButtonDescription(unsigned int button) {
+  return string("button") + std::to_string(button);
+}
+
+bool HostEthController::ControllerInitialization() {
+
+  buttonOffset = (axisNumber * bitsPerAxis) / 8;
+  if ((axisNumber * bitsPerAxis) % 8 != 0)
+    buttonOffset++;
+  dataFrameSize = buttonOffset + (buttonNumber / 8) * sizeof(uint8_t);
+  if ((buttonNumber % 8) != 0)
+    dataFrameSize++;
+  dataFrameBuffer = new char[dataFrameSize];
+  return true;
+}
+
+void HostEthController::SendControllerInfo() {
+  // send axis info
+  controlSocket->WriteUInt32((uint32_t)axisNumber, 0);
+  controlSocket->WriteUInt32(bitsPerAxis, 0);
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // Thread::Info("Debug: sending axis name for axis %d = %s (takes up %d
+    // bytes)\n",i,GetAxisDescription(i).c_str(),GetAxisDescription(i).length());
+    int stringLength = GetAxisDescription(i).length();
+    controlSocket->WriteUInt32((uint32_t)stringLength, 0);
+    controlSocket->SendMessage(GetAxisDescription(i).c_str(), stringLength, 0);
+  }
+
+  // send button info
+  controlSocket->WriteUInt32((uint32_t)buttonNumber, 0);
+  for (unsigned int i = 0; i < buttonNumber; i++) {
+    int stringLength = GetButtonDescription(i).length();
+    controlSocket->WriteUInt32((uint32_t)stringLength, 0);
+    controlSocket->SendMessage(GetButtonDescription(i).c_str(), stringLength,
+                               0);
+  }
+}
+
+bool HostEthController::ConnectedWithTarget() {
+  char message[1024];
+  ssize_t sent, received;
+  static bool connectionEstablished = false;
+
+  connectionEstablishedMutex->GetMutex();
+  if (!connectionEstablished &&
+      controlSocket->Connect(targetPort, targetAddress, 10)) {
+    Thread::Info("Connected to %s:%d\n", targetAddress.c_str(), targetPort);
+    SendControllerInfo();
+    connectionEstablished = true;
+  }
+  connectionEstablishedMutex->ReleaseMutex();
+  return connectionEstablished;
+}
+
+void HostEthController::Run() {
+  static int divider = 0;
+  Message *msgControllerAction = new Message(1024);
+  if (getFrameworkManager()->ErrorOccured() || !ControllerInitialization()) {
+    SafeStop();
+    Thread::Err("Une erreur a eu lieu, on ne lance pas la boucle\n");
+  }
+
+  if (buttonNumber % 8 != 0) {
+    SafeStop();
+    Thread::Err("Button number is not multiple of 8\n");
+  }
+
+  while (!ToBeStopped()) {
+    // Thread::Info("Debug: entering acquisition loop\n");
+    if (getFrameworkManager()->ConnectionLost() == true)
+      SafeStop();
+
+    if (IsDataFrameReady()) { // wait for next data frame
+      meaningfulDataAvailable = true;
+      GetAxisData();
+      GetButtonData();
+
+      if (ConnectedWithTarget()) {
+        // read for commands from the target (remote control state change
+        // requests such as rumble or led on/off)
+        ssize_t bytesReceived =
+            controlSocket->RecvMessage((char *)msgControllerAction->buffer,
+                                       msgControllerAction->bufferSize);
+        if (bytesReceived > 0) {
+          // if the message is a cnx exit request we manage it here, if not it
+          // will be managed by the derived class
+          ControllerAction action;
+          memcpy(&action, msgControllerAction->buffer,
+                 sizeof(ControllerAction));
+          if (action == ControllerAction::Exit) {
+            // Thread::Info("Debug: exit request received from server\n");
+            SafeStop();
+          }
+          ProcessMessage(msgControllerAction);
+        }
+      }
+    } else { // try to connect even if host is not sending anything
+      ConnectedWithTarget();
+    }
+    // Thread::Info("Debug: exiting acquisition loop\n");
+  }
+}
+
+bool HostEthController::writeBits(uint16_t value, uint8_t valueSizeInBits,
+                                  char *buffer, uint8_t offsetInBits) {
+  if (valueSizeInBits > 16)
+    return false;
+  uint8_t remainingBitsToWrite = valueSizeInBits;
+  // skip first bytes
+  buffer += offsetInBits / 8;
+  offsetInBits -= (offsetInBits / 8) * 8;
+  while (remainingBitsToWrite > 0) {
+    uint8_t remainingBitsInByteBeforeWrite = 8 - offsetInBits;
+    uint8_t bitsToWrite = remainingBitsToWrite < remainingBitsInByteBeforeWrite
+                              ? remainingBitsToWrite
+                              : remainingBitsInByteBeforeWrite;
+    uint8_t remainingBitsInByteAfterWrite =
+        remainingBitsInByteBeforeWrite - bitsToWrite;
+    // write in the current byte
+    uint8_t byteMask = ((1 << bitsToWrite) - 1)
+                       << remainingBitsInByteAfterWrite;
+    (*buffer) &= ~byteMask;
+    uint16_t valueMask = (1 << remainingBitsToWrite) - 1;
+    (*buffer) |= ((value & valueMask) >> (remainingBitsToWrite - bitsToWrite))
+                 << remainingBitsInByteAfterWrite;
+    // update state
+    remainingBitsToWrite -= bitsToWrite;
+    offsetInBits = (offsetInBits + bitsToWrite) % 8;
+    buffer++;
+  }
+  return true;
+}
+
+void HostEthController::BuildDataFrame() {
+  // int16_t testValue[4]={-120,-43,27,98}; //0x 88 d5 1b 62
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // We shift value to always be positive (so that division/multiplication by
+    // power of 2 can easily be done with bit shifts)
+    uint16_t shiftedNativeAxisValue =
+        axis->Value(i, 0) + (1 << (nativeBitsPerAxis - 1));
+    // int16_t nativeAxisValue=testValue[i];
+    uint16_t scaledAxisValue;
+    if (bitsPerAxis > nativeBitsPerAxis) {
+      scaledAxisValue = shiftedNativeAxisValue
+                        << (bitsPerAxis - nativeBitsPerAxis);
+    } else {
+      scaledAxisValue =
+          shiftedNativeAxisValue >> (nativeBitsPerAxis - bitsPerAxis);
+    }
+    // Thread::Info("Debug: shiftedNativeAxisValue=%#x, scaled axis
+    // value=%#x\n",shiftedNativeAxisValue,scaledAxisValue);
+    unsigned int offsetInBits = i * bitsPerAxis;
+    writeBits(scaledAxisValue, bitsPerAxis, dataFrameBuffer, offsetInBits);
+  }
+  // Thread::Info("Buffer après: %x %x %x\n", dataFrameBuffer[0],
+  // dataFrameBuffer[1], dataFrameBuffer[2]);
+
+  int currentButton = 0;
+  uint8_t buttonArray[buttonNumber / 8];
+  for (unsigned int i = 0; i < buttonNumber / 8; i++) {
+    buttonArray[i] = 0;
+    for (unsigned int j = 0; j < 8; j++) {
+      bool buttonValue = button->Value(currentButton, 0);
+      if (buttonValue)
+        buttonArray[i] += 1 << j;
+      currentButton++;
+    }
+
+    dataSocket->HostToNetwork((char *)&buttonArray[i], sizeof(uint8_t));
+    memcpy(dataFrameBuffer + buttonOffset + i * sizeof(uint8_t),
+           &buttonArray[i], sizeof(uint8_t));
+  }
+}
+
+HostEthController::DataSender::DataSender(Object *parent,
+                                          HostEthController *_hostEthController,
+                                          string name, uint8_t priority)
+    : Thread(parent, name, priority), hostEthController(_hostEthController) {}
+
+void HostEthController::DataSender::Run() {
+  if (getFrameworkManager()->ErrorOccured() == true) {
+    SafeStop();
+  }
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+    if (hostEthController->meaningfulDataAvailable &&
+        hostEthController->ConnectedWithTarget()) {
+      // send the data
+      hostEthController->BuildDataFrame();
+      hostEthController->dataSocket->SendMessage(
+          hostEthController->dataFrameBuffer, hostEthController->dataFrameSize);
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/HostEthController.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/HostEthController.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/HostEthController.h	(revision 209)
@@ -0,0 +1,120 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/30
+//  filename:   HostEthController.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for host side remote controls that talks to target
+//  side through ethernet connection
+//
+//
+/*********************************************************************/
+
+#ifndef HOSTETHCONTROLLER_H
+#define HOSTETHCONTROLLER_H
+
+#include <IODevice.h>
+#include <Thread.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class TcpSocket;
+class UdpSocket;
+class Mutex;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
+}
+
+namespace flair {
+namespace sensor {
+enum class ControllerAction;
+
+/*! \class HostEthController
+*
+* \brief Base Class for host side remote controls that talks to target side
+*through ethernet connection
+*
+* There are 2 communication channels:
+*   - 1 connection with the ground station to display the values. Output for
+*analog sticks is normalized in the range [-1, 1] (float values)
+*   - 1 connection with the target to send the controller values (and receive
+*controller state modification requests)
+*/
+class HostEthController : public core::Thread, public core::IODevice {
+public:
+  HostEthController(std::string name,
+                    std::string address, int port, uint32_t period = 10,
+                    uint32_t _bitsPerAxis = 7, uint8_t priority = 0);
+  ~HostEthController();
+  void DrawUserInterface();
+
+protected:
+  std::string controllerName;
+  core::TcpSocket *controlSocket; // connection to the target
+  core::UdpSocket *dataSocket;
+  std::string targetAddress;
+  int targetPort;
+  gui::Tab *tab;
+  gui::TabWidget *tabWidget;
+  virtual bool IsDataFrameReady() { return true; };
+  virtual void CompleteDataFrameGrab(){};
+  //        int8_t *datas;
+  //        uint8_t dataSize;
+  char *dataFrameBuffer;
+  size_t dataFrameSize;
+  virtual void ProcessMessage(core::Message *controllerAction){};
+
+  virtual std::string GetAxisDescription(unsigned int axis);
+  virtual void
+  GetAxisData() = 0; // responsible for getting the axis data from the hardware
+  unsigned int axisNumber;
+  core::cvmatrix *axis;
+  gui::DataPlot1D **axisPlot;
+  uint32_t bitsPerAxis;
+  uint32_t nativeBitsPerAxis;
+
+  virtual std::string GetButtonDescription(unsigned int button);
+  virtual void GetButtonData() = 0; // responsible for getting the button data
+                                    // from the hardware
+  unsigned int buttonNumber;
+  core::cvmatrix *button;
+  uint8_t buttonOffset;
+  bool meaningfulDataAvailable;
+
+private:
+  class DataSender : public core::Thread {
+  public:
+    DataSender(Object *parent, HostEthController *hostEthController,
+               std::string name, uint8_t priority = 0);
+    void Run();
+
+  private:
+    HostEthController *hostEthController;
+  };
+  DataSender *dataSender;
+
+  bool ControllerInitialization();
+  bool ConnectedWithTarget();
+  void SendControllerInfo();
+  void Run();
+  void BuildDataFrame();
+  bool writeBits(uint16_t value, uint8_t valueSizeInBits, char *buffer,
+                 uint8_t offsetInBits);
+  core::Mutex *connectionEstablishedMutex;
+};
+}
+}
+
+#endif // HOSTETHCONTROLLER_H
Index: tags/latest/lib/FlairSensorActuator/src/Imu.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Imu.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Imu.cpp	(revision 209)
@@ -0,0 +1,150 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/16
+//  filename:   Imu.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for Imu
+//
+//
+/*********************************************************************/
+
+#include "Imu.h"
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GroupBox.h>
+#include <GridLayout.h>
+#include <DataPlot1D.h>
+#include <ImuData.h>
+#include <OneAxisRotation.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+Imu::Imu(string name,bool needRotation) : IODevice(getFrameworkManager(), name) {
+  imuData = new ImuData(this);
+
+  // station sol
+  mainTab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(mainTab->NewRow(), name);
+  sensorTab = new Tab(tab, "Reglages");
+  setupGroupbox = new GroupBox(sensorTab->NewRow(), name);
+  if(needRotation) {
+    rotation = new OneAxisRotation(sensorTab->NewRow(), "post rotation",OneAxisRotation::PostRotation);
+  } else {
+    rotation=NULL;
+  }
+  AddDataToLog(imuData);
+}
+
+Imu::Imu(const IODevice *parent,std::string name) : IODevice(parent, name) {
+  imuData = new ImuData(this);
+  mainTab = NULL;
+  tab = NULL;
+  sensorTab = NULL;
+  setupGroupbox = NULL;
+  rotation = NULL;
+}
+
+Imu::~Imu() {
+  if (mainTab != NULL)
+    delete mainTab;
+}
+
+const ImuData *Imu::GetDatas(void) const {
+  return imuData;
+}
+
+void Imu::GetDatas(ImuData **outImuData) const { *outImuData = imuData; }
+
+OneAxisRotation *Imu::GetOneAxisRotation(void) const {
+  if (rotation == NULL) {
+    Err("not applicable\n");
+  }
+  return rotation;
+}
+
+void Imu::ApplyRotation(Vector3Df& vector) {
+  if (rotation == NULL) {
+    Err("not applicable\n");
+    return;
+  }
+  rotation->ComputeRotation(vector);
+}
+
+void Imu::ApplyRotation(Quaternion& quaternion) {
+  if (rotation == NULL) {
+    Err("not applicable\n");
+    return;
+  }
+  rotation->ComputeRotation(quaternion);
+}
+
+GroupBox *Imu::GetGroupBox(void) const { return setupGroupbox; }
+
+Layout *Imu::GetLayout(void) const { return sensorTab; }
+
+void Imu::LockUserInterface(void) const {
+  if (sensorTab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+  sensorTab->setEnabled(false);
+}
+
+void Imu::UnlockUserInterface(void) const {
+  if (sensorTab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+  sensorTab->setEnabled(true);
+}
+
+void Imu::UseDefaultPlot(void) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plotTab = new Tab(tab, "IMU");
+  axPlot = new DataPlot1D(plotTab->NewRow(), "acc_x", -10, 10);
+  axPlot->AddCurve(imuData->Element(ImuData::RawAx));
+  ayPlot = new DataPlot1D(plotTab->LastRowLastCol(), "acc_y", -10, 10);
+  ayPlot->AddCurve(imuData->Element(ImuData::RawAy));
+  azPlot = new DataPlot1D(plotTab->LastRowLastCol(), "acc_z", -10, 10);
+  azPlot->AddCurve(imuData->Element(ImuData::RawAz));
+
+  if (plotTab == NULL)
+    plotTab = new Tab(tab, "IMU");
+  gxPlot = new DataPlot1D(plotTab->NewRow(), "gyr_x", -500, 500);
+  gxPlot->AddCurve(imuData->Element(ImuData::RawGxDeg));
+  gyPlot = new DataPlot1D(plotTab->LastRowLastCol(), "gyr_y", -500, 500);
+  gyPlot->AddCurve(imuData->Element(ImuData::RawGyDeg));
+  gzPlot = new DataPlot1D(plotTab->LastRowLastCol(), "gyr_z", -500, 500);
+  gzPlot->AddCurve(imuData->Element(ImuData::RawGzDeg));
+
+  if (plotTab == NULL)
+    plotTab = new Tab(tab, "IMU");
+  mxPlot = new DataPlot1D(plotTab->NewRow(), "mag_x", -500, 500);
+  mxPlot->AddCurve(imuData->Element(ImuData::RawMx));
+  myPlot = new DataPlot1D(plotTab->LastRowLastCol(), "mag_y", -500, 500);
+  myPlot->AddCurve(imuData->Element(ImuData::RawMy));
+  mzPlot = new DataPlot1D(plotTab->LastRowLastCol(), "mag_z", -500, 500);
+  mzPlot->AddCurve(imuData->Element(ImuData::RawMz));
+}
+
+Tab *Imu::GetPlotTab(void) const { return plotTab; }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Imu.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Imu.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Imu.h	(revision 209)
@@ -0,0 +1,175 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Imu.h
+ * \brief Base class for Imu
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/16
+ * \version 4.0
+ */
+
+#ifndef IMU_H
+#define IMU_H
+
+#include <IODevice.h>
+#include <Vector3D.h>
+
+namespace flair {
+  namespace core {
+    class ImuData;
+    class OneAxisRotation;
+  }
+  namespace gui {
+    class Tab;
+    class TabWidget;
+    class GroupBox;
+    class Layout;
+    class DataPlot1D;
+  }
+}
+
+class Ahrs_impl;
+
+namespace flair {
+namespace sensor {
+/*! \class Imu
+*
+* \brief Base class for Imu
+*
+* Use this class to define a custom Imu.
+*
+*/
+class Imu : public core::IODevice {
+  friend class ::Ahrs_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Imu.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param needRotation true will enable post rotation in GCS. Post rotation must be applied manually in reimplemented code
+  */
+  Imu(std::string name,bool needRotation=true);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Imu. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Imu(const core::IODevice *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Imu();
+  
+  /*!
+  * \brief Get IMU datas
+  *
+  * \return ImuData
+  */
+  const core::ImuData *GetDatas(void) const;
+
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return setup Layout
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
+
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Get OneAxisRotation
+  *
+  * \return fixed rotation of the imu
+  */
+  core::OneAxisRotation *GetOneAxisRotation(void) const;
+
+
+protected:
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return setup GroupBox
+  */
+  gui::GroupBox *GetGroupBox(void) const;
+
+  /*!
+  * \brief ApplyRotation
+  *
+  * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
+  * It handles the data rotation if it was defined.
+  *
+  * \param vector vector to apply rotation to
+  */
+  void ApplyRotation(core::Vector3Df& vector);
+  
+  /*!
+  * \brief ApplyRotation
+  *
+  * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
+  * It handles the data rotation if it was defined.
+  *
+  * \param quaternion quaternion to apply rotation to
+  */
+  void ApplyRotation(core::Quaternion& quaternion);
+
+  /*!
+  * \brief Get imu datas
+  *
+  * Can be used by dervied class to fill core::ImuData
+  * 
+  * \param imuData imu datas
+  */
+  void GetDatas(core::ImuData **imuData) const;
+
+private:
+  gui::Tab *mainTab, *sensorTab, *plotTab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setupGroupbox;
+  core::OneAxisRotation *rotation;
+  core::ImuData *imuData;
+
+  gui::DataPlot1D *axPlot, *ayPlot, *azPlot;
+  gui::DataPlot1D *gxPlot, *gyPlot, *gzPlot;
+  gui::DataPlot1D *mxPlot, *myPlot, *mzPlot;
+};
+} // end namespace sensor
+} // end namespace flair
+
+#endif // IMU_H
Index: tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.cpp	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/07/22
+//  filename:   LaserRangeFinder.cpp
+//
+//  author:     César RICHARD
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Classe generique des recepteurs LaserRangeFinder
+//
+//
+/*********************************************************************/
+
+#include "LaserRangeFinder.h"
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GridLayout.h>
+#include <GroupBox.h>
+#include <PushButton.h>
+#include <FrameworkManager.h>
+#include <Label.h>
+#include <RangeFinderPlot.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+LaserRangeFinder::LaserRangeFinder(string name)
+    : IODevice(getFrameworkManager(), name) {
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(360, 1);
+  output = new cvmatrix(this, desc, floatType);
+  delete desc;
+  AddDataToLog(output);
+Warn("output matrix is created in LaserRangeFinder and utm30lx\n");
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Reglages");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+}
+
+LaserRangeFinder::LaserRangeFinder(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
+
+  output = NULL;
+}
+
+LaserRangeFinder::~LaserRangeFinder() {}
+
+GroupBox *LaserRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
+
+Layout *LaserRangeFinder::GetLayout(void) const { return sensor_tab; }
+
+RangeFinderPlot *LaserRangeFinder::GetPlot(void) const { return plot; }
+
+void LaserRangeFinder::UseDefaultPlot(void) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plot_tab = new Tab(tab, "Mesures");
+  plot = new RangeFinderPlot(plot_tab->NewRow(), "plot", "x", -30, 30, "y", -30,
+                             30, output, 0, 359, output->Rows());
+}
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/LaserRangeFinder.h	(revision 209)
@@ -0,0 +1,132 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file LaserRangeFinder.h
+ * \brief Classe generique des telemetres laser
+ * \author César RICHARD, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/22
+ * \version 1.0
+ */
+
+#ifndef LASERRANGEFINDER_H
+#define LASERRANGEFINDER_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GroupBox;
+class Layout;
+class RangeFinderPlot;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class LaserRangeFinder
+*
+* \brief Classe generique intégrant les telemetres laser
+*/
+class LaserRangeFinder : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Laser Range Finder.
+	* It will be child of the FrameworkManager
+  *
+  * \param name name
+  */
+  LaserRangeFinder(std::string name);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  LaserRangeFinder(const core::IODevice *parent, std::string name);
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~LaserRangeFinder();
+
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief Plot
+  *
+  * \return DataPlot1D
+  */
+  gui::RangeFinderPlot *GetPlot(void) const;
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Value
+  *
+  * \return output value
+  */
+  float Value(void) const;
+
+protected:
+  /*!
+      * \brief Output matrix
+      *
+      * \return output matrix
+      */
+  core::cvmatrix *output;
+
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::Tab *sensor_tab;
+  gui::RangeFinderPlot *plot;
+  gui::Tab *plot_tab;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // LASERRANGEFINDER_H
Index: tags/latest/lib/FlairSensorActuator/src/Mb800.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Mb800.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Mb800.cpp	(revision 209)
@@ -0,0 +1,146 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/08/23
+//  filename:   Mb800.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant le recepteur gps mb800
+//
+//
+/*********************************************************************/
+
+#include "Mb800.h"
+#include <SerialPort.h>
+#include <FrameworkManager.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+Mb800::Mb800(string name,
+             SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags,
+             uint8_t priority)
+    : NmeaGps(name, NMEAFlags), Thread(getFrameworkManager(), name, priority) {
+  this->serialport = serialport;
+  serialport->SetRxTimeout(100000000);
+  
+  SetIsReady(true);
+}
+
+Mb800::~Mb800() {
+  SafeStop();
+  Join();
+}
+
+void Mb800::Run(void) {
+  int written;
+
+  /** Debut config **/
+  char to_send[] = "$PASHS,NME,ALL,A,OFF\r\n";
+  written=serialport->Write(to_send, sizeof(to_send));
+  if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+  }
+
+  {
+    char to_send[] = "$PASHS,CPD,AFP,95.0\r\n";
+    written=serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+  {
+    char to_send[] = "$PASHS,DIF,PRT,C,RT3\r\n";
+    written=serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+
+  if ((NMEAFlags & GGA) != 0) {
+    char to_send[] = "$PASHS,NME,GGA,A,ON,0.05\r\n";
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    char to_send[] = "$PASHS,NME,VTG,A,ON,0.05\r\n";
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+  if ((NMEAFlags & GST) != 0) {
+    char to_send[] = "$PASHS,NME,GST,A,ON,0.05\r\n";
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+  if ((NMEAFlags & GSA) != 0) {
+    char to_send[] = "$PASHS,NME,GSA,A,ON,0.1\r\n";
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
+  }
+
+  Sync();
+
+  /** Fin config **/
+
+  /** Debut running loop **/
+  WarnUponSwitches(true);
+  
+  while (!ToBeStopped()) {
+    char response[1024] = {0};
+    int size = 0;
+    while (!ToBeStopped()) {
+      ssize_t read = serialport->Read(&response[size], 1);
+      if (read < 0) {
+        Thread::Err("erreur Read (%s)\n", strerror(-read));
+      }
+
+      if (response[size] == 0x0a ) break;
+      size++;
+      if (size==sizeof(response)) break;
+    }
+    if (size!=sizeof(response)) {
+      size++;
+      parseFrame(response, size);
+    } else {
+      Thread::Warn("frame too long for buffer\n");
+    }
+  }
+  
+  /** fin running loop **/
+  WarnUponSwitches(false);
+}
+
+void Mb800::Sync(void) {
+  char data = 0;
+  ssize_t read = 0;
+
+  // attente fin trame
+  while (data != 0x0a && !ToBeStopped()) {
+    read = serialport->Read(&data, 1);
+    SleepMS(10);
+
+    if (read < 0) {
+      Thread::Err("erreur Read (%s)\n", strerror(-read));
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Mb800.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Mb800.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Mb800.h	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Mb800.h
+ * \brief Class for mb800 gps receiver
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/08/23
+ * \version 4.0
+ */
+
+#ifndef MB800_H
+#define MB800_H
+
+#include <Thread.h>
+#include <NmeaGps.h>
+
+namespace flair {
+namespace core {
+class SerialPort;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class Mb800
+*
+* \brief Class for mb800 gps receiver
+*/
+class Mb800 : public core::Thread, public NmeaGps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Mb800.
+  * It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param serialport serialport
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  Mb800(std::string name,
+        core::SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags,
+        uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Mb800();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  void Sync(void);
+  core::SerialPort *serialport;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // MB800_H
Index: tags/latest/lib/FlairSensorActuator/src/NeoM8N.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/NeoM8N.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/NeoM8N.cpp	(revision 209)
@@ -0,0 +1,144 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2017/08/30
+//  filename:   NeoM8N.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant le recepteur gps ublox NeoM8N
+//
+//
+/*********************************************************************/
+
+#include "NeoM8N.h"
+#include <SerialPort.h>
+#include <FrameworkManager.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+NeoM8N::NeoM8N(string name,
+             SerialPort *serialport,NmeaGps::NMEAFlags_t NMEAFlags,uint8_t priority)
+    : NmeaGps(name, NMEAFlags), Thread(getFrameworkManager(), name, priority) {
+  this->serialport = serialport;
+  serialport->SetRxTimeout(100000000);
+  
+  SetIsReady(true);
+}
+
+NeoM8N::~NeoM8N() {
+  SafeStop();
+  Join();
+}
+
+void NeoM8N::Run(void) {
+  
+  //turn off all messages
+  {
+    char tx[]={0x06, 0x01, 0x03, 0, 0xf0, 0,0};
+    for(int i=0;i<0x100;i++) {
+      tx[5]=i;//msg id
+      SendUbx(tx,sizeof(tx));
+    }
+  }
+  //10Hz output
+  {
+    char tx[]={0x06, 0x08, 0x06, 0, 0x64, 0, 0x01, 0, 0, 0};
+    SendUbx(tx,sizeof(tx));
+  }
+  
+  if ((NMEAFlags & GGA) != 0) {
+    char tx[]={0x06, 0x01, 0x03, 0, 0xf0, 0,0x01};
+    SendUbx(tx,sizeof(tx));
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    char tx[]={0x06, 0x01, 0x03, 0, 0xf0, 0x05,0x01};
+    SendUbx(tx,sizeof(tx));
+  }
+  if ((NMEAFlags & GST) != 0) {
+    char tx[]={0x06, 0x01, 0x03, 0, 0xf0, 0x07,0x01};
+    SendUbx(tx,sizeof(tx));
+  }
+  if ((NMEAFlags & GSA) != 0) {
+    char tx[]={0x06, 0x01, 0x03, 0, 0xf0, 0x02,0x01};
+    SendUbx(tx,sizeof(tx));
+  }
+  
+  /** Debut running loop **/
+  WarnUponSwitches(true);
+
+  Sync();
+  
+  while (!ToBeStopped()) {
+    char response[1024] = {0};
+    int size = 0;
+    while (!ToBeStopped()) {
+      ssize_t read = serialport->Read(&response[size], 1);
+      if (read < 0) {
+        Thread::Err("erreur Read (%s)\n", strerror(-read));
+      }
+
+      if (response[size] == 0x0a ) break;
+      size++;
+      if (size==sizeof(response)) break;
+    }
+    if (size!=sizeof(response)) {
+      size++;
+      parseFrame(response, size);
+    } else {
+      Thread::Warn("frame too long for buffer\n");
+    }
+  }
+  /** fin running loop **/
+  WarnUponSwitches(false);
+}
+
+void NeoM8N::SendUbx(char* buf,size_t length) {
+  char header[2]={0xb5,0x62};
+  int written=serialport->Write(header, sizeof(header));
+  if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+  }
+  
+  written=serialport->Write(buf, length);
+  if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+  }
+  
+  unsigned char checksum[2]={0,0};
+  for(int i=0;i<length;i++) {
+     checksum[0] = checksum[0] + buf[i];
+     checksum[1] = checksum[1] + checksum[0];
+  }
+  written=serialport->Write(checksum, sizeof(checksum));
+  if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+  }
+}
+
+void NeoM8N::Sync(void) {
+  char data = 0;
+  ssize_t read = 0;
+
+  // attente fin trame
+  while (data != 0x0a && !ToBeStopped()) {
+    read = serialport->Read(&data, 1);
+    SleepMS(10);
+
+    if (read < 0) {
+      Thread::Err("erreur Read (%s)\n", strerror(-read));
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/NeoM8N.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/NeoM8N.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/NeoM8N.h	(revision 209)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file NeoM8N.h
+ * \brief Class for NeoM8N gps receiver
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2017/08/30
+ * \version 4.0
+ */
+
+#ifndef NEOM8N_H
+#define NEOM8N_H
+
+#include <Thread.h>
+#include <NmeaGps.h>
+
+namespace flair {
+namespace core {
+class SerialPort;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class NeoM8N
+*
+* \brief Class for mb800 gps receiver
+*/
+class NeoM8N : public core::Thread, public NmeaGps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a NeoM8N.
+  * It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param serialport serialport
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  NeoM8N(std::string name,
+        core::SerialPort *serialport,NmeaGps::NMEAFlags_t NMEAFlags,uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~NeoM8N();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  void Sync(void);
+  void SendUbx(char* buf,size_t length);//message without header/footer
+  core::SerialPort *serialport;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // NEOM8N_H
Index: tags/latest/lib/FlairSensorActuator/src/NmeaGps.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/NmeaGps.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/NmeaGps.cpp	(revision 209)
@@ -0,0 +1,255 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/08/23
+//  filename:   NmeaGps.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for GPS using NMEA sentances
+//
+//
+/*********************************************************************/
+
+#include "NmeaGps.h"
+#include "geodesie.h"
+#include <Euler.h>
+#include <DataPlot1D.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GridLayout.h>
+#include <GroupBox.h>
+#include <PushButton.h>
+#include <FrameworkManager.h>
+#include <Map.h>
+#include <GeoCoordinate.h>
+#include <Vector3D.h>
+#include <Label.h>
+#include <GpsData.h>
+#include <string.h>
+
+using std::string;
+using namespace Geodesie;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+NmeaGps::NmeaGps(string name, NMEAFlags_t NMEAFlags)
+    : IODevice(getFrameworkManager(), name) {
+  this->NMEAFlags = NMEAFlags;
+
+  nmea_zero_INFO(&info);
+  nmea_parser_init(&parser);
+  altRef = 0;
+
+  if ((NMEAFlags & GGA) == 0) {
+    Err("Enable at least the GGA sentence\n");
+  }
+
+  // station sol
+  mainTab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(mainTab->NewRow(), name);
+  sensorTab = new Tab(tab, "Setup");
+  setupGroupbox = new GroupBox(sensorTab->NewRow(), name);
+  buttonRef = new PushButton(setupGroupbox->NewRow(), "set ref");
+  nbSatLabel = new Label(setupGroupbox->NewRow(), "nb_sat");
+  fixLabel = new Label(setupGroupbox->LastRowLastCol(), "fix");
+
+  position = new GeoCoordinate((IODevice *)this, "position", 0, 0, 0);
+
+  takeRef = false;
+
+  gpsData = new GpsData(this);
+  AddDataToLog(gpsData);
+
+  nbSatLabel->SetText("number of satellies: %i", gpsData->GetNumberOfSatellites());
+  fixLabel->SetText("fix quality: %i", gpsData->GetFixQuality());
+}
+
+NmeaGps::NmeaGps(const IODevice *parent, std::string name) : IODevice(parent, name) {
+  gpsData = new GpsData(this);
+  mainTab = NULL;
+  tab = NULL;
+  sensorTab = NULL;
+}
+
+NmeaGps::~NmeaGps() {
+  if (mainTab != NULL) {
+    nmea_parser_destroy(&parser);
+    delete mainTab;
+  }
+}
+
+GroupBox *NmeaGps::GetGroupBox(void) const { return setupGroupbox; }
+
+const GpsData *NmeaGps::GetDatas(void) const {
+   return gpsData;
+}
+
+void NmeaGps::GetDatas(core::GpsData **outGpsData) const {
+  *outGpsData = gpsData;
+}
+
+void NmeaGps::UseDefaultPlot(void) {
+  plotTab = new Tab(tab, "Mesures");
+
+  if ((NMEAFlags & GGA) != 0) {
+    ePlot = new DataPlot1D(plotTab->NewRow(), "e", -10, 10);
+    ePlot->AddCurve(gpsData->Element(GpsData::East));
+    nPlot = new DataPlot1D(plotTab->LastRowLastCol(), "n", -10, 10);
+    nPlot->AddCurve(gpsData->Element(GpsData::North));
+    uPlot = new DataPlot1D(plotTab->LastRowLastCol(), "u", -10, 10);
+    uPlot->AddCurve(gpsData->Element(GpsData::Up));
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    vePlot = new DataPlot1D(plotTab->NewRow(), "ve", -10, 10);
+    vePlot->AddCurve(gpsData->Element(GpsData::EastVelocity));
+    vnPlot = new DataPlot1D(plotTab->LastRowLastCol(), "vn", -10, 10);
+    vnPlot->AddCurve(gpsData->Element(GpsData::NorthVelocity));
+  }
+
+  Tab *map_tab = new Tab(tab, "carte");
+  map = new Map(map_tab->NewRow(), "map");
+  map->AddPoint(position, "drone");
+}
+
+DataPlot1D *NmeaGps::EPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return ePlot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *NmeaGps::NPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return nPlot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *NmeaGps::UPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return uPlot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *NmeaGps::VEPlot(void) const {
+  if ((NMEAFlags & VTG) != 0) {
+    return vePlot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *NmeaGps::VNPlot(void) const {
+  if ((NMEAFlags & VTG) != 0) {
+    return vnPlot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+Layout *NmeaGps::GetLayout(void) const { return sensorTab; }
+
+Tab *NmeaGps::GetPlotTab(void) const { return plotTab; }
+
+TabWidget *NmeaGps::GetTab(void) const { return tab; }
+
+void NmeaGps::SetRef(void) { takeRef = true; }
+
+void NmeaGps::parseFrame(const char *frame, int frame_size) {
+
+  int result;
+Printf("%s\n",frame);
+Printf("%x %x\n",&parser,parser.buffer);
+  result = nmea_parse(&parser, frame, frame_size, &info);
+  Printf("%x %x\n",&parser,parser.buffer);
+  if (result != 1) {
+    Warn("unrecognized nmea sentence: %s\n",frame);
+    return;
+  }
+Printf("3\n");
+Printf("%x %x\n",&parser,parser.buffer);
+  result = nmea_parse_GPGGA(frame, frame_size, &pack);
+Printf("%x %x\n",&parser,parser.buffer);
+  if (result == 1) {
+    Printf("%x %x\n",&parser,parser.buffer);
+    nmea_info2pos(&info, &pos);
+     Printf("%x %x\n",&parser,parser.buffer);
+   //  Printf("nb:%i fix:%i lat:%f long:%f alt:%f vel:%f angle:%f\n",pack.satinuse,pack.sig,info.lat,info.lon,info.elv,info.speed*1000./3600.,info.direction);
+//Printf("lat:%f long:%f\n",pos.lat,pos.lon);
+
+    gpsData->GetMutex(); // on utilise le mutex de gpsData pour fix et nb_sat
+    if (gpsData->GetFixQuality() != (GpsData::FixQuality_t)pack.sig) {
+      gpsData->SetFixQuality((GpsData::FixQuality_t)pack.sig);
+      fixLabel->SetText("fix: %i", pack.sig);
+    }
+    if (gpsData->GetNumberOfSatellites() != pack.satinuse) {
+      gpsData->SetNumberOfSatellites(pack.satinuse) ;
+      nbSatLabel->SetText("nb_sat: %i", pack.satinuse);
+    }
+    gpsData->ReleaseMutex();
+
+    gpsData->SetLla(Euler::ToDegree(pos.lat), Euler::ToDegree(pos.lon),info.elv);
+    position->SetCoordinates(Euler::ToDegree(pos.lat), Euler::ToDegree(pos.lon),
+                             info.elv);
+
+    if ((info.sig == 2 && altRef == 0) || buttonRef->Clicked() == true ||
+        takeRef == true) {
+      Printf("prise pos ref\n");
+      latRef = pos.lat;
+      longRef = pos.lon;
+      altRef = info.elv;
+      takeRef = false;
+    }
+    // if(alt_ref!=0)
+    {
+      double x, y, z;
+      double e, n, u;
+      Geographique_2_ECEF(pos.lon, pos.lat, info.elv, x, y, z);
+      ECEF_2_ENU(x, y, z, e, n, u, longRef, latRef, altRef);
+      // Printf("lon:%f lat:%f elv:%f\n",pos.lon,pos.lat,info.elv);
+
+      gpsData->SetEnu(e,n,u);
+
+      if ((NMEAFlags & VTG) != 0) {
+        gpsData->SetVelocity(info.speed * 1000. / 3600. * sin(Euler::ToRadian(info.direction)),
+                                  info.speed * 1000. / 3600. * cos(Euler::ToRadian(info.direction)));
+      }
+      if ((NMEAFlags & GSA) != 0) {
+        gpsData->SetDop(info.PDOP,info.HDOP,info.VDOP);
+      }
+      /*
+      if ((NMEAFlags & GST) != 0) {
+        // Thread::Printf("dev_lon:%f dev_lat:%f
+        // dev_elv:%f\n",info.dev_lat,info.dev_lon,info.dev_elv);
+        output->SetValueNoMutex(index, 0, info.dev_lat);
+        output->SetValueNoMutex(index + 1, 0, info.dev_lon);
+        output->SetValueNoMutex(index + 2, 0, info.dev_elv);
+        index += 3;
+      }*/
+
+
+      gpsData->SetDataTime(GetTime());
+      ProcessUpdate(gpsData);
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/NmeaGps.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/NmeaGps.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/NmeaGps.h	(revision 209)
@@ -0,0 +1,219 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file NmeaGps.h
+ * \brief Base class for GPS using NMEA sentances
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/08/23
+ * \version 4.0
+ */
+
+#ifndef NMEAGPS_H
+#define NMEAGPS_H
+
+#include <IODevice.h>
+#include <Vector3D.h>
+#include <nmea/nmea.h>
+
+namespace flair {
+  namespace core {
+    class FrameworkManager;
+    class GeoCoordinate;
+    class GpsData;
+  }
+  namespace gui {
+    class Layout;
+    class DataPlot1D;
+    class Tab;
+    class TabWidget;
+    class PushButton;
+    class Map;
+    class Label;
+    class GroupBox;
+  }
+}
+
+namespace flair {
+namespace sensor {
+
+/*! \class NmeaGps
+*
+* \brief Base class for GPS using NMEA sentances
+*/
+class NmeaGps : public core::IODevice {
+public:
+  /*!
+  \enum NMEAFlags_t
+  \brief NMEA flags
+  */
+  enum NMEAFlags_t {
+    GGA = 0x01, /*!< GGA */
+    VTG = 0x02, /*!< VTG */
+    GST = 0x04, /*!< GST */
+    GSA = 0x08, /*!< GSA */
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a NmeaGps.
+  *	It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param NMEAFlags NMEA sentances to enable
+  */
+  NmeaGps(std::string name,
+      NMEAFlags_t NMEAFlags);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a NmeaGps. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  NmeaGps(const core::IODevice *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~NmeaGps();
+
+  /*!
+  * \brief Get GPS datas
+  *
+  * \return GpsData
+  */
+  const core::GpsData *GetDatas(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief East plot
+  *
+  * \return east plot
+  */
+  gui::DataPlot1D *EPlot(void) const;
+
+  /*!
+  * \brief North plot
+  *
+  * \return north plot
+  */
+  gui::DataPlot1D *NPlot(void) const;
+
+  /*!
+  * \brief Up plot
+  *
+  * \return up plot
+  */
+  gui::DataPlot1D *UPlot(void) const;
+
+  /*!
+  * \brief East velocity plot
+  *
+  * \return east velocity plot
+  */
+  gui::DataPlot1D *VEPlot(void) const;
+
+  /*!
+  * \brief North velocity plot
+  *
+  * \return north velocity plot
+  */
+  gui::DataPlot1D *VNPlot(void) const;
+
+  /*!
+  * \brief Main tab
+  *
+  * \return main tab
+  */
+  gui::TabWidget *GetTab(void) const;
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return setup Layout
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Set reference for ENU coordinates
+  *
+  * The actual position is used as reference to calculate
+  * ENU coordinates.
+  *
+  * \return fix quality
+  */
+  void SetRef(void);
+
+protected:
+  /*!
+  * \brief Parse a NMEA frame
+  *
+  * This function must be called by the reimplemented class. \n
+  * When a frame is parsed, GPS datas are filled.
+  *
+  * \param frame NMEA frame
+  * \param frame_size frame size
+  *
+  */
+  void parseFrame(const char *frame, int frame_size);
+
+  NMEAFlags_t NMEAFlags;
+
+  /*!
+  * \brief Get GPS datas
+  *
+  * \param gpsData GPS datas
+  */
+  void GetDatas(core::GpsData **gpsData) const;
+
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return setup GroupBox
+  */
+  gui::GroupBox *GetGroupBox(void) const;
+
+private:
+  gui::Tab *mainTab, *sensorTab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setupGroupbox;
+  gui::PushButton *buttonRef;
+  gui::DataPlot1D *ePlot;
+  gui::DataPlot1D *nPlot;
+  gui::DataPlot1D *uPlot;
+  gui::DataPlot1D *vePlot;
+  gui::DataPlot1D *vnPlot;
+  gui::Tab *plotTab;
+  gui::Map *map;
+  gui::Label *nbSatLabel, *fixLabel;
+  core::GeoCoordinate *position;
+  bool takeRef;
+  nmeaINFO info;
+  nmeaPARSER parser;
+  nmeaGPGGA pack;
+  nmeaPOS pos;
+  double latRef, longRef, altRef;
+  core::GpsData* gpsData;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // NMEAGPS_H
Index: tags/latest/lib/FlairSensorActuator/src/Novatel.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Novatel.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Novatel.cpp	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/08/23
+//  filename:   Novatel.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant le recepteur gps Novatel
+//
+//
+/*********************************************************************/
+
+#include "Novatel.h"
+#include <SerialPort.h>
+#include <FrameworkManager.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+Novatel::Novatel(string name,
+                 SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags,
+                 uint8_t priority)
+    : NmeaGps(name, NMEAFlags), Thread(getFrameworkManager(), name, priority) {
+  this->serialport = serialport;
+  
+  SetIsReady(true);
+}
+
+Novatel::~Novatel() {
+  SafeStop();
+  Join();
+}
+
+void Novatel::Run(void) {
+  ssize_t written;
+
+  WarnUponSwitches(true);
+
+  char to_send[] = "log gpggalong ontime 0.05\n";
+  written = serialport->Write(to_send, sizeof(to_send));
+  if (written < 0) {
+    Thread::Err("erreur write (%s)\n", strerror(-written));
+  }
+  char to_send2[] = "log gpvtg ontime 0.05\n";
+  written = serialport->Write(to_send2, sizeof(to_send2));
+  if (written < 0) {
+    Thread::Err("erreur write (%s)\n", strerror(-written));
+  }
+
+  Sync();
+
+  while (!ToBeStopped()) {
+    char response[1024] = {0};
+    int size = 0;
+    while (!ToBeStopped()) {
+      ssize_t read = serialport->Read(&response[size], 1);
+      if (read < 0) {
+        Thread::Err("erreur Read (%s)\n", strerror(-read));
+      }
+
+      if (response[size] == 0x0a ) break;
+      size++;
+      if (size==sizeof(response)) break;
+    }
+    if (size!=sizeof(response)) {
+      size++;
+      parseFrame(response, size);
+    } else {
+      Thread::Warn("frame too long for buffer\n");
+    }
+  }
+
+  WarnUponSwitches(false);
+}
+
+void Novatel::Sync(void) {
+  char data = 0;
+  ssize_t Read = 0;
+
+  // attente fin trame
+  while (data != 0x0a) {
+    Read = serialport->Read(&data, 1);
+    if (Read < 0) {
+      Thread::Err("erreur Read (%s)\n", strerror(-Read));
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Novatel.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Novatel.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Novatel.h	(revision 209)
@@ -0,0 +1,78 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Novatel.h
+ * \brief Class for Novatel gps receiver
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/08/23
+ * \version 4.0
+ */
+
+#ifndef Novatel_H
+#define Novatel_H
+
+#include <Thread.h>
+#include <NmeaGps.h>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class Novatel
+*
+* \brief Class for Novatel gps receiver
+*/
+class Novatel : public core::Thread, public NmeaGps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Novatel.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param serialport serialport
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  Novatel(std::string name,
+          core::SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags,
+          uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Novatel();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  core::SerialPort *serialport;
+  void Sync(void);
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // Novatel_H
Index: tags/latest/lib/FlairSensorActuator/src/Ps3Eye.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 209)
@@ -0,0 +1,36 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/01/19
+//  filename:   Ps3Eye.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant la camera Ps3Eye
+//
+//
+/*********************************************************************/
+
+#include "Ps3Eye.h"
+
+using std::string;
+using namespace flair::core;
+
+namespace flair {
+namespace sensor {
+
+Ps3Eye::Ps3Eye(string name, int camera_index,
+               uint8_t priority)
+    : V4LCamera( name, camera_index, 320, 240,
+                cvimage::Type::Format::YUYV, priority) {
+  SetIsReady(true);                  
+}
+
+Ps3Eye::~Ps3Eye() {}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Ps3Eye.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Ps3Eye.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Ps3Eye.h	(revision 209)
@@ -0,0 +1,51 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Ps3Eye.h
+ * \brief Class for Ps3Eye camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/01/19
+ * \version 4.0
+ */
+
+#ifndef PS3EYE_H
+#define PS3EYE_H
+
+#include "V4LCamera.h"
+
+namespace flair {
+namespace sensor {
+/*! \class Ps3Eye
+*
+* \brief Class for Ps3Eye camera
+*/
+class Ps3Eye : public V4LCamera {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Ps3Eye.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param camera_index index of the camera, ie /dev/videox
+  * \param priority priority of the Thread
+  */
+  Ps3Eye(std::string name,
+         int camera_index, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Ps3Eye();
+
+private:
+};
+} // end namespace sensor
+} // end namespace flair
+
+#endif // PS3EYE_H
Index: tags/latest/lib/FlairSensorActuator/src/RadioReceiver.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 209)
@@ -0,0 +1,75 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/07/08
+//  filename:   RadioReceiver.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for radio receiver
+//
+//
+/*********************************************************************/
+
+#include "RadioReceiver.h"
+#include <Tab.h>
+#include <TabWidget.h>
+#include <FrameworkManager.h>
+#include <cvmatrix.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+RadioReceiver::RadioReceiver(string name,
+                             unsigned int nb_channels)
+    : IODevice(getFrameworkManager(), name) {
+  is_connected = false;
+  this->nb_channels = nb_channels;
+
+  // init matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(nb_channels, 1);
+  for (int i = 0; i < nb_channels; i++) {
+    ostringstream channel_name;
+    channel_name << "channel " << i;
+    desc->SetElementName(i, 0, channel_name.str());
+  }
+  output = new cvmatrix(this, desc, floatType, name);
+  delete desc;
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Setup");
+
+  AddDataToLog(output);
+  
+  SetIsReady(true);
+}
+
+RadioReceiver::~RadioReceiver() { delete main_tab; }
+
+Layout *RadioReceiver::GetLayout(void) const { return setup_tab; }
+
+float RadioReceiver::ChannelValue(unsigned int id) const {
+  if (id < nb_channels) {
+    return output->Value(id, 0);
+  } else {
+    Err("channel %i/%i is out of bound\n", id, nb_channels);
+    return -1;
+  }
+}
+
+bool RadioReceiver::IsConnected(void) const { return is_connected; }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/RadioReceiver.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/RadioReceiver.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/RadioReceiver.h	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RadioReceiver.h
+ * \brief Base class for radio receiver
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/08
+ * \version 4.0
+ */
+
+#ifndef RADIORECEIVER_H
+#define RADIORECEIVER_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class Layout;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class RadioReceiver
+*
+* \brief Base class for radio receiver
+*/
+class RadioReceiver : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a RadioReceiver.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param nb_channels number of supported channels
+  */
+  RadioReceiver(std::string name,
+                unsigned int nb_channels);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RadioReceiver();
+
+  /*!
+  * \brief get channel value
+  *
+  * \param id channel id
+  * \return value of the channel, between 0 and 1.
+  *  Returns -1 if channel is out of bound
+  */
+  float ChannelValue(unsigned int id) const;
+
+  /*!
+  * \brief Is transmitter connected?
+  *
+  * \return true if transmitter is connected
+  */
+  bool IsConnected(void) const;
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  core::cvmatrix *output;
+  bool is_connected;
+  unsigned int nb_channels;
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::Tab *setup_tab;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // RADIORECEIVER_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuBldc.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 209)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuBldc.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation bldc
+//
+//
+/*********************************************************************/
+#include "SimuBldc.h"
+#include <FrameworkManager.h>
+#include <GridLayout.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <SharedMem.h>
+#include <cvmatrix.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+SimuBldc::SimuBldc(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, uint32_t modelId,uint32_t deviceId)
+    : Bldc(parent, layout, name, motors_count) {
+  shmem =
+      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
+
+  GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
+  k = new DoubleSpinBox(groupbox->NewRow(), "k driver:", 0, 10000, 1);
+  
+  SetIsReady(true);
+}
+
+SimuBldc::SimuBldc(const Object *parent, string name, uint8_t motors_count,
+                   uint32_t modelId,uint32_t deviceId)
+    : Bldc(parent, name, motors_count) {
+  shmem =
+      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
+
+  // reset values
+  float values[motors_count];
+  for (int i = 0; i < motors_count; i++)
+    values[i] = 0;
+
+  shmem->Write((char *)&values, motors_count * sizeof(float));
+  
+  SetIsReady(true);
+}
+
+SimuBldc::~SimuBldc() {}
+
+string SimuBldc::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_bldc_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuBldc::SetMotors(float *value) {
+  float values[MotorsCount()];
+
+  for (int i = 0; i < MotorsCount(); i++)
+    values[i] = k->Value() * value[i];
+
+  shmem->Write((char *)&values, MotorsCount() * sizeof(float));
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  output->GetMutex();
+  for (int i = 0; i < MotorsCount(); i++)
+    output->SetValueNoMutex(i, 0, values[i]);
+  output->ReleaseMutex();
+}
+
+void SimuBldc::GetSpeeds(float *value) const {
+  float values[MotorsCount()];
+  shmem->Read((char *)&values, MotorsCount() * sizeof(float));
+
+  for (int i = 0; i < MotorsCount(); i++)
+    value[i] = values[i];
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuBldc.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuBldc.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuBldc.h	(revision 209)
@@ -0,0 +1,118 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuBldc.h
+ * \brief Class for a simulation bldc
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMUBLDC_H
+#define SIMUBLDC_H
+
+#include <Bldc.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+class IODevice;
+class cvmatrix;
+}
+namespace gui {
+class DoubleSpinBox;
+class Layout;
+}
+}
+
+namespace flair {
+namespace actuator {
+/*! \class SimuBldc
+*
+* \brief Class for a simulation bldc
+*
+*/
+class SimuBldc : public Bldc {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuBldc. Control part.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param modelId Model id
+  * \param deviceId Bldc id of the Model
+  */
+  SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuBldc. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param motors_count number of motors
+  * \param modelId Model id
+  * \param deviceId Bldc id of the Model
+  */
+  SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
+           uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuBldc();
+
+  /*!
+  * \brief Get motors speeds.
+  *
+  * This function should only be used for the simulation part.
+  *
+  * \param value array to store motors speeds
+  */
+  void GetSpeeds(float *value) const;
+
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
+
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
+
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *value);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  core::SharedMem *shmem;
+  gui::DoubleSpinBox *k;
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // SIMUBLDC_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 209)
@@ -0,0 +1,109 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/03/06
+//  filename:   SimuCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation camera
+//
+//
+/*********************************************************************/
+
+#include "SimuCamera.h"
+#include <FrameworkManager.h>
+#include <GroupBox.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+//control part
+SimuCamera::SimuCamera(string name,
+                       uint16_t width, uint16_t height, uint8_t channels,
+                       uint32_t modelId,uint32_t deviceId, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority),
+      Camera(name, width, height, cvimage::Type::Format::BGR) {
+
+  buf_size = width * height * channels+sizeof(Time);
+
+  shmemReadBuf=(char*)malloc(buf_size);
+  output->img->imageData = shmemReadBuf;
+
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId), buf_size, SharedMem::Type::producerConsumer);
+  
+  SetIsReady(true);
+}
+
+//simulation part
+SimuCamera::SimuCamera(const IODevice *parent, string name, uint16_t width,
+                       uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId)
+    : Thread(parent, name, 0), Camera(parent,name) {
+
+  buf_size = width * height * channels+sizeof(Time);
+  
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
+                        buf_size, SharedMem::Type::producerConsumer);
+  shmemReadBuf=NULL;
+  
+  SetIsReady(true);
+}
+
+SimuCamera::~SimuCamera() {
+  SafeStop();
+  Join();
+  if(shmemReadBuf!=NULL) delete shmemReadBuf;
+}
+
+string SimuCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuCamera::Run(void) {
+  Time time;
+//  if (data_rate == NULL) {
+//    Thread::Err("not applicable for simulation part.\n");
+//    return;
+//  }
+
+//  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+  shmem->ReaderReady();
+
+  while (!ToBeStopped()) {
+//    WaitPeriod();
+
+//    if (data_rate->ValueChanged() == true) {
+//      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+//    }
+
+    output->GetMutex();
+    //blocking read
+    shmem->Read(shmemReadBuf, buf_size); // remplacer copie par
+                                                   // échange de pointeur sur
+                                                   // double buffering
+                                            
+    output->ReleaseMutex();
+    memcpy(&time,shmemReadBuf+buf_size-sizeof(Time),sizeof(Time));
+    output->SetDataTime(time);
+
+    ProcessUpdate(output);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuCamera.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuCamera.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuCamera.h	(revision 209)
@@ -0,0 +1,107 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuCamera.h
+ * \brief Class for a simulation camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/03/06
+ * \version 4.0
+ */
+
+#ifndef SIMUCAMERA_H
+#define SIMUCAMERA_H
+
+#include <Camera.h>
+#include <Thread.h>
+#include <cxcore.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuCamera
+*
+* \brief Class for a simulation camera
+*/
+class SimuCamera : public core::Thread, public Camera {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuCamera. Control part.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param channels number of channels
+  * \param modelId Model id
+  * \param deviceId Camera id of the Model
+  * \param priority priority of the Thread
+  */
+  SimuCamera(std::string name,
+             uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId,
+             uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuCamera. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param channels number of channels
+  * \param modelId Model id
+  * \param deviceId Camera id of the Model
+  */
+  SimuCamera(const core::IODevice *parent, std::string name, uint16_t width,
+             uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuCamera();
+
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
+
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  size_t buf_size;
+  char* shmemReadBuf;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMUCAMERA_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuGps.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 209)
@@ -0,0 +1,169 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/05/26
+//  filename:   SimuGps.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation GPS
+//
+//
+/*********************************************************************/
+
+#include "SimuGps.h"
+#include <FrameworkManager.h>
+#include <GeoCoordinate.h>
+#include <GpsData.h>
+#include <SharedMem.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <Euler.h>
+#include <cvmatrix.h>
+#include <sstream>
+#include "geodesie.h"
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace Geodesie;
+
+namespace flair {
+namespace sensor {
+
+SimuGps::SimuGps(string name,
+                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority)
+    : NmeaGps(name, NMEAFlags),Thread(getFrameworkManager(), name, priority) {
+
+  dataRate = new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
+  latitudeRef = new DoubleSpinBox(GetGroupBox()->NewRow(), "latitude ref", " deg", -90, 90, 1, 6,49.402313);
+  longitudeRef = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "longitude ref", " deg", -180, 180, 1, 6,2.795463);
+  altitudeRef= new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "altitude ref", " m", 0, 6000, 100, 1,0);
+  fixQuality = new SpinBox(GetGroupBox()->NewRow(), "fix quality", 1, 8, 1, 1);
+  numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
+  magneticDeclination= new DoubleSpinBox(GetGroupBox()->NewRow(), "magnetic declination", " deg", -180, 180, .1, 2,0);
+  
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        sizeof(gps_states_t));
+                        
+  SetIsReady(true);
+}
+
+
+SimuGps::SimuGps(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
+    : NmeaGps(parent, name), Thread(parent, name, 0) {
+  dataRate = NULL;
+
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
+                        sizeof(gps_states_t));
+  
+  SetIsReady(true);
+}
+
+SimuGps::~SimuGps() {
+  SafeStop();
+  Join();
+}
+
+string SimuGps::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuGps::UpdateFrom(const io_data *data) {
+  if (data != NULL) {
+    cvmatrix *input = (cvmatrix *)data;
+    gps_states_t state;
+
+    input->GetMutex();
+    //simulator is ned, convert it to enu
+    //TODO: put simulator in enu?
+    state.e = input->ValueNoMutex(5, 0);//y simulator
+    state.n = input->ValueNoMutex(4, 0);//x simulator
+    state.u = -input->ValueNoMutex(6, 0);//z simulator
+    state.ve = input->ValueNoMutex(11, 0);//vy simulator
+    state.vn = input->ValueNoMutex(10, 0);//vx simulator
+    input->ReleaseMutex();
+
+    shmem->Write((char *)&state, sizeof(gps_states_t));
+  }
+}
+
+void SimuGps::Run(void) {
+  gps_states_t state;
+  char buf[512];
+  nmeaGPGGA gga;
+  nmeaGPVTG vtg;
+  nmeaPOS pos;
+  nmeaINFO info;
+
+  vtg.dir_t='T';
+  vtg.dec_m='M';
+  vtg.spk_k='K';
+  vtg.spn_n='N';
+
+  if (dataRate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+
+  WarnUponSwitches(true);
+
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (dataRate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+    }
+
+    shmem->Read((char *)&state, sizeof(gps_states_t));
+
+    double x, y, z;
+    ENU_2_ECEF(state.e, state.n, state.u, x,y,z, Euler::ToRadian(longitudeRef->Value()), Euler::ToRadian(latitudeRef->Value()), altitudeRef->Value());
+    ECEF_2_Geographique( x, y, z,pos.lon, pos.lat, gga.elv);
+    nmea_pos2info(&pos,&info);
+
+    if(pos.lat>0) {
+      gga.ns='N';
+      gga.lat=info.lat;
+    } else {
+      gga.ns='S';
+      gga.lat=-info.lat;
+    }
+    if(pos.lon>0) {
+      gga.ew='E';
+      gga.lon=info.lon;
+    } else {
+      gga.ew='W';
+      gga.lon=-info.lon;
+    }
+
+    gga.sig=fixQuality->Value();
+    gga.satinuse=numberOfSatellites->Value();
+
+    nmea_gen_GPGGA(buf,sizeof(buf),&gga);
+    Printf("1\n");
+    parseFrame(buf,sizeof(buf));
+
+    vtg.dir=90-Euler::ToDegree(atan2f(state.vn,state.ve));
+    vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.;
+    nmea_gen_GPVTG(buf,sizeof(buf),&vtg);
+    Printf("2\n");
+    parseFrame(buf,sizeof(buf));
+  }
+
+  WarnUponSwitches(false);
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuGps.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuGps.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuGps.h	(revision 209)
@@ -0,0 +1,105 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuGps.h
+ * \brief Class for a simulation GPS
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/08/23
+ * \version 4.0
+ */
+
+#ifndef SIMUGPS_H
+#define SIMUGPS_H
+
+#include <Thread.h>
+#include <NmeaGps.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+  }
+  namespace gui {
+    class SpinBox;
+    class DoubleSpinBox;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuGps
+*
+* \brief Class for a simulation GPS
+*/
+class SimuGps : public core::Thread, public NmeaGps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a simulation GPS. Control part.
+  * It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param NMEAFlags NMEA sentances to enable
+  * \param modelId Model id
+  * \param deviceId Gps id of the Model
+  * \param priority priority of the Thread
+  */
+  SimuGps(std::string name,
+          NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a simulation GPS. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId Gps id of the Model
+  */
+  SimuGps(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuGps();
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  typedef struct {
+    float e;
+    float n;
+    float u;
+    float ve;
+    float vn;
+  } gps_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  core::SharedMem *shmem;
+  gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites;
+  gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef,*magneticDeclination;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMUGPS_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 209)
@@ -0,0 +1,135 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuImu.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation imu
+//
+//
+/*********************************************************************/
+
+#include "SimuImu.h"
+#include <FrameworkManager.h>
+#include <ImuData.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <cvmatrix.h>
+#include <SharedMem.h>
+#include <AhrsData.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+//Construct a SimuImu. Control part.
+SimuImu::SimuImu(string name, uint32_t modelId,uint32_t deviceId,
+                 uint8_t priority)
+    : Imu(name,false), Thread(getFrameworkManager(), name, priority) {
+  dataRate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
+  ahrsData = new AhrsData((Imu *)this);
+  
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        sizeof(imu_states_t));
+  SetIsReady(true);
+}
+
+//Construct a SimuImu. Simulation part.
+SimuImu::SimuImu(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
+    : Imu(parent,name), Thread(parent, name, 0) {
+  dataRate = NULL;
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        sizeof(imu_states_t));
+  SetIsReady(true);
+}
+
+SimuImu::~SimuImu() {
+  SafeStop();
+  Join();
+}
+
+string SimuImu::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_imu_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuImu::UpdateFrom(const io_data *data) {
+  if (data != NULL) {
+    cvmatrix *input = (cvmatrix *)data;
+    imu_states_t state;
+
+    input->GetMutex();
+    state.q0 = input->ValueNoMutex(0, 0);
+    state.q1 = input->ValueNoMutex(1, 0);
+    state.q2 = input->ValueNoMutex(2, 0);
+    state.q3 = input->ValueNoMutex(3, 0);
+    state.wx = input->ValueNoMutex(7, 0);
+    state.wy = input->ValueNoMutex(8, 0);
+    state.wz = input->ValueNoMutex(9, 0);
+    state.ax = input->ValueNoMutex(13, 0);
+    state.ay = input->ValueNoMutex(14, 0);
+    state.az = input->ValueNoMutex(15, 0);
+    state.mx = input->ValueNoMutex(16, 0);
+    state.my = input->ValueNoMutex(17, 0);
+    state.mz = input->ValueNoMutex(18, 0);
+    input->ReleaseMutex();
+
+    shmem->Write((char *)&state, sizeof(imu_states_t));
+  }
+}
+
+void SimuImu::Run(void) {
+  imu_states_t state;
+  ImuData *imuData;
+  GetDatas(&imuData);
+
+  if (dataRate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (dataRate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+    }
+    shmem->Read((char *)&state, sizeof(imu_states_t));
+    Quaternion quaternion(state.q0, state.q1, state.q2, state.q3);
+    Vector3Df angRate(state.wx, state.wy, state.wz);
+    Vector3Df rawAcc(state.ax, state.ay, state.az);
+    Vector3Df rawMag(state.mx, state.my, state.mz);
+    Vector3Df rawGyr(state.wx, state.wy, state.wz);
+    //we do not need rotation in simulation
+    /*
+    ApplyRotation(angRate);
+    ApplyRotation(quaternion);
+    ApplyRotation(rawAcc);
+    ApplyRotation(rawMag);
+    ApplyRotation(rawGyr);*/
+    ahrsData->SetQuaternionAndAngularRates(quaternion,angRate);
+    imuData->SetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
+    imuData->SetDataTime(GetTime());
+    ahrsData->SetDataTime(GetTime());
+    ProcessUpdate(ahrsData);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuImu.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuImu.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuImu.h	(revision 209)
@@ -0,0 +1,112 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuImu.h
+ * \brief Class for a simulation Imu
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMUIMU_H
+#define SIMUIMU_H
+
+#include <Imu.h>
+#include <Thread.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+    class AhrsData;
+  }
+  namespace gui {
+    class SpinBox;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuImu
+*
+* \brief Class for a simulation Imu
+*/
+class SimuImu : public Imu, public core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuImu. Control part.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId Imu id of the Model
+  * \param priority priority of the Thread
+  */
+  SimuImu(std::string name,
+          uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuImu. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId Imu id of the Model
+  */
+  SimuImu(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuImu();
+
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
+
+  typedef struct {
+    float q0;
+    float q1;
+    float q2;
+    float q3;
+    float wx;
+    float wy;
+    float wz;
+    float ax;
+    float ay;
+    float az;
+    float mx;
+    float my;
+    float mz;
+  } imu_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  gui::SpinBox *dataRate;
+  core::SharedMem *shmem;
+  core::AhrsData *ahrsData;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMUIMU_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuLaser.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 209)
@@ -0,0 +1,92 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuUs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#include "SimuLaser.h"
+#include <FrameworkManager.h>
+#include <ImuData.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <cvmatrix.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimuLaser::SimuLaser(string name,
+                     uint32_t modelId,uint32_t deviceId, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), LaserRangeFinder(name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        360 * sizeof(float));
+  SetIsReady(true);
+}
+
+SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
+    : Thread(parent, name, 0), LaserRangeFinder(parent, name) {
+  data_rate = NULL;
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        360 * sizeof(float));
+  SetIsReady(true);
+}
+
+SimuLaser::~SimuLaser() {
+  SafeStop();
+  Join();
+}
+
+string SimuLaser::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_laser_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuLaser::Run(void) {
+  float z[360];
+
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    shmem->Read((char *)z, 360 * sizeof(float));
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+    }
+    for (int i = 0; i < 360; i++) {
+      output->SetValue(i, 0, z[i]); //*******
+    }
+    output->SetDataTime(GetTime());
+    ProcessUpdate(output);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuLaser.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuLaser.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuLaser.h	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuUs.h
+ * \brief Class for a simulation UsRangeFinder
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMULASER_H
+#define SIMULASER_H
+
+#include <LaserRangeFinder.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimuLaser : public core::Thread, public LaserRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Control part.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId LaserRangeFinder id of the Model
+  * \param priority priority of the Thread
+  */
+  SimuLaser(std::string name,
+            uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId LaserRangeFinder id of the Model
+  */
+  SimuLaser(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuLaser();
+
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  gui::SpinBox *data_rate;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULASER_H
Index: tags/latest/lib/FlairSensorActuator/src/SimuUs.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 209)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuUs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#include "SimuUs.h"
+#include <FrameworkManager.h>
+#include <ImuData.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <cvmatrix.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimuUs::SimuUs(string name, uint32_t modelId,uint32_t deviceId,
+               uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), UsRangeFinder( name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
+
+  SetIsReady(true);
+}
+
+SimuUs::SimuUs(const IODevice *parent, string name,uint32_t modelId,uint32_t deviceId)
+    : Thread(parent, name, 0), UsRangeFinder(parent,name) {
+  data_rate = NULL;
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
+  
+  SetIsReady(true);
+}
+
+SimuUs::~SimuUs() {
+  SafeStop();
+  Join();
+}
+
+string SimuUs::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_us_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimuUs::Run(void) {
+  float z;
+
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    shmem->Read((char *)&z, sizeof(float));
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+    }
+
+    output->SetValue(0, 0, z);
+    output->SetDataTime(GetTime());
+    ProcessUpdate(output);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/SimuUs.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/SimuUs.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/SimuUs.h	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuUs.h
+ * \brief Class for a simulation UsRangeFinder
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMUUS_H
+#define SIMUUS_H
+
+#include <UsRangeFinder.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimuUs : public core::Thread, public UsRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Control part.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId UsRangeFinder id of the Model
+  * \param priority priority of the Thread
+  */
+  SimuUs(std::string name,
+         uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId UsRangeFinder id of the Model
+  */
+  SimuUs(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuUs();
+
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  gui::SpinBox *data_rate;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMUUS_H
Index: tags/latest/lib/FlairSensorActuator/src/Srf08.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Srf08.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Srf08.cpp	(revision 209)
@@ -0,0 +1,222 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   Srf08.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for ultra sonic SRF08
+//
+//
+/*********************************************************************/
+
+#include "Srf08.h"
+#include <I2cPort.h>
+#include <FrameworkManager.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <cvmatrix.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+Srf08::Srf08(string name, I2cPort *i2cport,
+             uint16_t address, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), UsRangeFinder(name) {
+  is_init = false;
+
+  // default values
+  // range 46*43+43=2021mm max (2m)
+  // 7:gain=118
+  // range=46;
+  // gain=7;
+
+  this->i2cport = i2cport;
+  this->address = address;
+
+  // station sol
+  gain = new SpinBox(GetGroupBox()->NewRow(), "gain:", 0, 255, 1, 8);
+  range = new SpinBox(GetGroupBox()->LastRowLastCol(), "range:", 0, 255, 1, 46);
+
+  SetRange();
+  SetMaxGain();
+  
+  SetIsReady(true);
+}
+
+Srf08::~Srf08() {
+  SafeStop();
+  Join();
+}
+
+void Srf08::Run(void) {
+  WarnUponSwitches(true);
+
+  // init srf
+  SendEcho();
+
+  SetPeriodMS(20);
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (range->ValueChanged() == true)
+      SetRange();
+    if (gain->ValueChanged() == true)
+      SetMaxGain();
+
+    GetEcho();
+    SendEcho();
+  }
+
+  WarnUponSwitches(false);
+}
+
+void Srf08::SendEcho(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  tx[0] = 0;  // command register
+  tx[1] = 82; // ranging mode in usec
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+  echo_time = GetTime();
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("error write i2c (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("error write i2c %i/2\n", written);
+  }
+}
+
+void Srf08::GetEcho(void) {
+  float z = 0;
+  ssize_t written, read;
+  uint8_t tx, rx[2];
+  tx = 2;
+  uint8_t nb_err = 0;
+
+  // si l'us est bloqué, on attend 1ms de plus
+  while (1) {
+    i2cport->GetMutex();
+    i2cport->SetSlave(address);
+    written = i2cport->Write(&tx, 1);
+
+    if (written < 0) {
+      i2cport->ReleaseMutex();
+      Thread::Err("error write i2c (%s)\n", strerror(-written));
+      nb_err++;
+      if (nb_err == 20) {
+        Thread::Err("error write i2c (%s), too many errors\n",
+                    strerror(-written));
+        return;
+      }
+      SleepMS(1);
+    } else {
+      read = i2cport->Read(rx, 2);
+      i2cport->ReleaseMutex();
+      // rt_printf("%i %i\n",rx[0],rx[1]);
+      if (read < 0) {
+        if (read != -ETIMEDOUT)
+          Thread::Err("error read i2c (%s) %i\n", strerror(-read), read);
+        nb_err++;
+        if (nb_err == 20) {
+          Thread::Err("error read i2c (%s), too many errors\n",
+                      strerror(-written));
+          return;
+        }
+        SleepMS(1);
+      } else if (read != 2) {
+        Thread::Err("error read i2c %i/2\n", read);
+        return;
+      } else if (read == 2) {
+        break;
+      }
+    }
+  }
+
+  // if(z!=-1)
+  // revoir ce filtrage!!!
+  {
+    z = 0.000001 * (float)(rx[0] * 256 + rx[1]) * 344 /
+        2; // d=v*t; v=344m/s, t=t usec/2 (aller retour)
+    // if(z>1) rt_printf("%i %i %f\n",rx[0],rx[1],z);
+    // on ne permet pas 2 mesures consecutives + grandes de 10cm
+    if (fabs(z - z_1) > 0.5 && is_init == true) {
+      Printf("z %f (anc %f) %lld\n", z, z_1, echo_time);
+      Printf("a revoir on suppose le sol plan\n");
+      z = z_1 + (z_1 - z_2); // on suppose que l'on continue a la meme vitesse
+    }
+    output->SetValue(0, 0, z);
+    output->SetDataTime(echo_time + (rx[0] * 256 + rx[1]) * 1000);
+    ProcessUpdate(output);
+    z_2 = z_1;
+    z_1 = z;
+    is_init = true;
+  }
+}
+
+void Srf08::SetRange(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  tx[0] = 2;              // range register
+  tx[1] = range->Value(); // range*43+43=dist max en mm
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("error write i2c (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("error write i2c %i/2\n", written);
+  }
+}
+
+void Srf08::SetMaxGain(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  // rt_printf("Srf08::SetMaxGain: %s
+  // ->%i\n",IODevice::ObjectName().c_str(),gain->Value());
+
+  tx[0] = 1; // max gain register
+  tx[1] = gain->Value();
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("error write i2c (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("error write i2c %i/2\n", written);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/Srf08.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/Srf08.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/Srf08.h	(revision 209)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Srf08.h
+ * \brief Class for ultra sonic SRF08
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef SRF08_H
+#define SRF08_H
+
+#include <Thread.h>
+#include <UsRangeFinder.h>
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class Srf08
+*
+* \brief Class for ultra sonic SRF08
+*/
+class Srf08 : public core::Thread, public UsRangeFinder {
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SRF08 sensor
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param i2cport i2c port
+  * \param address i2c slave address
+  * \param priority priority of the Thread
+  */
+  Srf08(std::string name,
+        core::I2cPort *i2cport, uint16_t address, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Srf08();
+
+  /*!
+  * \brief Set Range
+  *
+  * check datasheet for values
+  */
+  void SetRange(void);
+
+  /*!
+  * \brief Set Max Gain
+  *
+  * check datasheet for values
+  */
+  void SetMaxGain(void);
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  void SendEcho(void);
+  void GetEcho(void);
+
+  bool is_init;
+  core::Time echo_time;
+  float z_1, z_2;
+  gui::SpinBox *gain, *range;
+  uint16_t address;
+  core::I2cPort *i2cport;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SRF08_H
Index: tags/latest/lib/FlairSensorActuator/src/TargetController.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/TargetController.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/TargetController.cpp	(revision 209)
@@ -0,0 +1,161 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/30
+//  filename:   TargetController.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for target side remote controls
+//
+//
+/*********************************************************************/
+#include "TargetController.h"
+#include "Controller.h"
+#include <TabWidget.h>
+#include <Tab.h>
+#include <FrameworkManager.h>
+#include <cvmatrix.h>
+
+#include <cstring>
+#include <string>
+
+using namespace flair::core;
+using namespace flair::gui;
+using std::string;
+
+namespace flair {
+namespace sensor {
+
+TargetController::TargetController(string name,uint8_t priority) :
+    Thread(getFrameworkManager(),name,priority),IODevice(getFrameworkManager(),name) {
+    main_tab=new Tab(getFrameworkManager()->GetTabWidget(),name);
+    TabWidget* tab=new TabWidget(main_tab->NewRow(),name);
+    setup_tab=new Tab(tab,"Reglages");
+}
+
+TargetController::~TargetController() {
+  SafeStop();
+  Join();
+}
+
+std::string TargetController::GetAxisName(unsigned int axisId) const {
+  return string("axis") + std::to_string(axisId);
+}
+
+std::string TargetController::GetButtonName(unsigned int buttonId) const {
+  return string("button") + std::to_string(buttonId);
+}
+
+bool TargetController::SetLedOn(unsigned int ledId) {
+  if (!IsControllerActionSupported(ControllerAction::SetLedOn))
+    return false;
+  SwitchLedMessage *msgLed = new SwitchLedMessage(true, ledId);
+  changeStateQueue.push(msgLed);
+  return true;
+}
+
+bool TargetController::SetLedOff(unsigned int ledId) {
+  if (!IsControllerActionSupported(ControllerAction::SetLedOn))
+    return false;
+  SwitchLedMessage *msgLed = new SwitchLedMessage(false, ledId);
+  changeStateQueue.push(msgLed);
+  return true;
+}
+
+bool TargetController::Rumble(unsigned int leftForce, unsigned int leftTimeout,
+                              unsigned int rightForce,
+                              unsigned int rightTimeout) {
+  if (!IsControllerActionSupported(ControllerAction::Rumble))
+    return false;
+  RumbleMessage *msgRumble =
+      new RumbleMessage(leftForce, leftTimeout, rightForce, rightTimeout);
+  changeStateQueue.push(msgRumble);
+  return true;
+}
+
+bool TargetController::FlashLed(unsigned int ledId, unsigned int onTimeout,
+                                unsigned int offTimeout) {
+  if (!IsControllerActionSupported(ControllerAction::FlashLed))
+    return false;
+  FlashLedMessage *msgFlashLed =
+      new FlashLedMessage(ledId, onTimeout, offTimeout);
+  changeStateQueue.push(msgFlashLed);
+  return true;
+}
+
+float TargetController::GetAxisValue(unsigned int axisId) const {
+  // TODO we'd better throw an exception here
+  if (axis == NULL)
+    return 0;
+
+  axis->GetMutex();
+  float axisValue = axis->Value(axisId, 0);
+  axis->ReleaseMutex();
+  return axisValue;
+}
+
+bool TargetController::IsButtonPressed(unsigned int buttonId) const {
+  // TODO we'd better throw an exception here
+  if (button == NULL)
+    return false;
+
+  button->GetMutex();
+  bool buttonValue = button->Value(buttonId, 0);
+  button->ReleaseMutex();
+  return buttonValue;
+}
+
+void TargetController::Run() {
+  SetPeriodMS(20);; //50Hz
+
+  Message *message;
+
+  //if (getFrameworkManager()->ErrorOccured() || !ControllerInitialization()) {
+  if (!ControllerInitialization()) {
+    SafeStop();
+    Thread::Err("An error occured, we don't proceed with the loop.\n");
+  } else {
+
+    axis = new cvmatrix((IODevice *)this, axisNumber, 1, floatType);
+    button =
+        new cvmatrix((IODevice *)this, buttonNumber, 1, SignedIntegerType(8));
+
+    while (!ToBeStopped()) {
+      // Thread::Info("Debug: entering acquisition loop\n");
+      if (getFrameworkManager()->ConnectionLost() == true)
+        SafeStop();
+
+      if (IsDataFrameReady()) {
+        // Thread::Info("Debug: data frame is ready\n");
+
+        AcquireAxisData(*axis);
+        AcquireButtonData(*button);
+
+        // send the data
+        axis->SetDataTime(GetTime());
+        ProcessUpdate(axis);
+
+        // send pending controller state change request(s)
+
+        while (changeStateQueue.size() != 0) {
+          message = changeStateQueue.front();
+          if (ProcessMessage(message)) {
+            changeStateQueue.pop();
+            delete message;
+          }
+        }
+      }
+      WaitPeriod();
+    }
+  }
+}
+
+Tab *TargetController::GetTab() const { return setup_tab; }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/TargetController.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/TargetController.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/TargetController.h	(revision 209)
@@ -0,0 +1,110 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/14
+//  filename:   TargetController.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for target side remote controls
+//
+//
+/*********************************************************************/
+
+#ifndef TARGETCONTROLLER_H
+#define TARGETCONTROLLER_H
+
+#include <IODevice.h>
+#include <Thread.h>
+#include <stdint.h>
+#include <queue>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class Socket;
+class io_data;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
+}
+
+namespace flair {
+namespace sensor {
+enum class ControllerAction;
+
+/*! \class TargetController
+*
+* \brief Base Class for target side remote controls
+*
+*/
+class TargetController : public core::Thread, public core::IODevice {
+public:
+  TargetController(std::string name,uint8_t priority = 0);
+  ~TargetController();
+  // void DrawUserInterface();
+  virtual bool IsConnected() const = 0;
+  virtual bool IsDataFrameReady() = 0;
+  // axis stuff
+  unsigned int GetAxisNumber() const;
+  virtual std::string GetAxisName(unsigned int axisId) const;
+  float
+  GetAxisValue(unsigned int axisId) const; // always in the range [-1.0,1.0]
+  // button stuff
+  unsigned int GetButtonNumber() const;
+  bool IsButtonPressed(unsigned int buttonId) const;
+  virtual std::string GetButtonName(unsigned int axisId) const;
+  // controller state stuff
+  virtual bool IsControllerActionSupported(ControllerAction action) const {
+    return false;
+  };
+  bool SetLedOn(unsigned int ledId);
+  bool SetLedOff(unsigned int ledId);
+  bool Rumble(unsigned int left_force, unsigned int left_timeout,
+              unsigned int right_force, unsigned int right_timeout);
+  bool FlashLed(unsigned int ledId, unsigned int on_timeout,
+                unsigned int off_timeout);
+  void UpdateFrom(const core::io_data *data){}; // TODO
+  gui::Tab *GetTab(void) const;
+
+protected:
+  virtual bool ProcessMessage(core::Message *msg) = 0;
+  void QueueMessage(core::Message msg);
+  virtual bool ControllerInitialization() = 0; // {return true;};
+  // axis stuff
+  unsigned int axisNumber;
+  core::cvmatrix *axis = NULL;
+  virtual void AcquireAxisData(core::cvmatrix &axis) = 0; // responsible for
+                                                          // getting the axis
+                                                          // data from the
+                                                          // hardware
+  uint16_t bitsPerAxis;
+  // button stuff
+  unsigned int buttonNumber;
+  core::cvmatrix *button = NULL;
+  virtual void AcquireButtonData(core::cvmatrix &button) = 0; // responsible for
+                                                              // getting the
+                                                              // button data
+                                                              // from the
+                                                              // hardware
+  // controller state stuff
+  unsigned int ledNumber;
+
+private:
+  void Run();
+  std::queue<core::Message *> changeStateQueue;
+  flair::gui::Tab *main_tab;
+  flair::gui::Tab *setup_tab;
+};
+}
+}
+
+#endif // TARGETCONTROLLER_H
Index: tags/latest/lib/FlairSensorActuator/src/TargetEthController.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/TargetEthController.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/TargetEthController.cpp	(revision 209)
@@ -0,0 +1,362 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/30
+//  filename:   TargetEthController.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class that gets remote controls through an ethernet connection.
+//              Typical use case: a remote control is plugged in a workstation
+//              and sends remote control
+//              data to a distant target (this class) through Wifi//
+//
+/*********************************************************************/
+#include "TargetEthController.h"
+#include <Controller.h>
+#include <FrameworkManager.h>
+#include <TcpSocket.h>
+#include <UdpSocket.h>
+#include <cstring>
+#include <string>
+#include <cvmatrix.h>
+#include <stdexcept>
+
+using namespace flair::core;
+using namespace flair::gui;
+using std::string;
+
+namespace flair {
+namespace sensor {
+
+TargetEthController::TargetEthController(string name, uint16_t _port,
+                                         uint8_t priority)
+    : TargetController(name, priority), listeningPort(_port),
+      receiveCurrentPosition(0) {
+  const bool blocking = true;
+  listeningSocket =
+      new TcpSocket(getFrameworkManager(), "TEC_listening_socket", blocking, blocking);
+  dataSocket =
+      new UdpSocket(getFrameworkManager(), "TEC_data_socket", _port + 1); // receiving side
+}
+
+TargetEthController::~TargetEthController() {
+  // We are (currently) the server side. We must ask the client side to initiate
+  // tcp connexion closing to avoid the server socket
+  // to get stuck in TIME_WAIT state
+  Message msg(32);
+  if (controlSocket) {
+    Message cancelAcquisition(sizeof(ControllerAction));
+    ControllerAction exit = ControllerAction::Exit;
+    memcpy(cancelAcquisition.buffer, &exit, sizeof(ControllerAction));
+    controlSocket->SendMessage(cancelAcquisition.buffer,
+                               cancelAcquisition.bufferSize);
+    // We don't expect any more data from the client, we're just waiting for the
+    // socket to be closed by the client
+    controlSocket->RecvMessage(msg.buffer, msg.bufferSize);
+  }
+
+  // TargetController calls TargetEthController methods in its run
+  // we must stop the thread now
+  SafeStop();
+  Join();
+}
+
+bool TargetEthController::IsConnected() const {
+  // TODO
+}
+
+bool TargetEthController::IsDataFrameReady() {
+  // read up to the last data
+  ssize_t received;
+  size_t bytesToReceive = dataFrameSize - receiveCurrentPosition;
+  bool fullDatagramReceived = false;
+
+    do {
+        received=dataSocket->RecvMessage(receiveFrameBuffer+receiveCurrentPosition,bytesToReceive,TIME_NONBLOCK);
+        if (received>0) {
+            receiveCurrentPosition+=received;
+            bytesToReceive-=received;
+            if (bytesToReceive==0) {
+                //a full datagram has been read in receiveFrameBuffer
+                fullDatagramReceived=true;
+                //we swap the data and reception buffers to avoid copy
+                char *swapFrameBuffer=dataFrameBuffer;
+                dataFrameBuffer=receiveFrameBuffer;
+                receiveFrameBuffer=swapFrameBuffer;
+                receiveCurrentPosition=0;
+                bytesToReceive=dataFrameSize;
+            }
+        }
+    } while (!(received<0));
+
+  return fullDatagramReceived;
+}
+
+uint8_t TargetEthController::getByteOrNull(char *buffer, int byte,
+                                           size_t bufferSize) {
+  if (byte < bufferSize)
+    return buffer[byte];
+  else
+    return 0;
+}
+
+uint32_t TargetEthController::charBufferToUint32(char *buffer,
+                                                 size_t bufferSize) {
+  union {
+    uint32_t int32;
+    char byte[4];
+  } bitField;
+  if (!IsBigEndian()) {
+    bitField.byte[0] = getByteOrNull(buffer, 3, bufferSize);
+    bitField.byte[1] = getByteOrNull(buffer, 2, bufferSize);
+    bitField.byte[2] = getByteOrNull(buffer, 1, bufferSize);
+    bitField.byte[3] = getByteOrNull(buffer, 0, bufferSize);
+  } else {
+    bitField.byte[0] = getByteOrNull(buffer, 0, bufferSize);
+    bitField.byte[1] = getByteOrNull(buffer, 1, bufferSize);
+    bitField.byte[2] = getByteOrNull(buffer, 2, bufferSize);
+    bitField.byte[3] = getByteOrNull(buffer, 3, bufferSize);
+  }
+  return bitField.int32;
+}
+
+// read _up_to_16_bits_ in a buffer
+uint16_t TargetEthController::readBits(uint8_t offsetInBits,
+                                       uint8_t valueSizeInBits, char *buffer,
+                                       size_t bufferSize) {
+  // parameters check
+  if (valueSizeInBits > 16)
+    throw std::range_error("bitfield should be at max 16bits wide");
+  size_t minBufferSize = (offsetInBits + valueSizeInBits) / 8;
+  if ((offsetInBits + valueSizeInBits) % 8 != 0)
+    minBufferSize++;
+  if (bufferSize < minBufferSize)
+    throw std::range_error("buffer too small");
+  // skip first bytes
+  size_t bytesToSkip = offsetInBits / 8;
+  buffer += bytesToSkip;
+  bufferSize -= bytesToSkip;
+  offsetInBits -= bytesToSkip * 8;
+  // take care of endianness
+  uint32_t value = charBufferToUint32(buffer, bufferSize);
+  value >>= 32 - offsetInBits - valueSizeInBits;
+  value &= (1 << valueSizeInBits) - 1;
+  return (uint16_t)value;
+}
+
+void TargetEthController::AcquireAxisData(core::cvmatrix &axis) {
+  axis.GetMutex();
+  // char testFrameBuffer[3]={(char)0x09,(char)0x59,(char)0xB8};
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    uint16_t rawAxisValue =
+        readBits(i * bitsPerAxis, bitsPerAxis, dataFrameBuffer, dataFrameSize);
+    //        uint16_t
+    //        rawAxisValue=readBits(i*bitsPerAxis,bitsPerAxis,testFrameBuffer);
+    uint16_t scale = 1 << (bitsPerAxis - 1);
+    // Thread::Info("RawAxisValue=%d, scale=%d => scaled rawValue=%d, float
+    // value)%f\n",rawAxisValue,scale,rawAxisValue-scale,(rawAxisValue-scale)/(float)scale);
+    axis.SetValueNoMutex(i, 0, (rawAxisValue - scale) / (float)scale);
+  }
+  axis.ReleaseMutex();
+}
+
+void TargetEthController::AcquireButtonData(core::cvmatrix &button) {
+  uint8_t buttonValue;
+  int currentButton = 0;
+  button.GetMutex();
+  /*
+  for (unsigned int i=0;i<buttonNumber;i++) {
+      memcpy(&buttonValue,buttonOffset+i*sizeof(bool),sizeof(bool));
+      dataSocket->NetworkToHost((char*)&buttonValue,sizeof(bool));
+      button.SetValueNoMutex(i,0,buttonValue);
+//        if (buttonValue) Thread::Info("Debug: button '%s' pressed\n",
+GetButtonName(i).c_str());
+  }*/
+  for (unsigned int i = 0; i < buttonNumber / 8; i++) {
+    memcpy(&buttonValue, dataFrameBuffer + buttonOffset + i * sizeof(uint8_t),
+           sizeof(uint8_t));
+    //        dataSocket->NetworkToHost((char*)&buttonValue,sizeof(uint8_t));
+    for (unsigned int j = 0; j < 8; j++) {
+      button.SetValueNoMutex(currentButton, 0, (buttonValue >> j) & 0x01);
+      currentButton++;
+    }
+  }
+  button.ReleaseMutex();
+}
+
+string TargetEthController::GetAxisName(unsigned int axisId) const {
+  // TODO: should throw an exception if axisName==NULL or axisId>axisNumber
+  return axisName[axisId];
+}
+
+string TargetEthController::GetButtonName(unsigned int buttonId) const {
+  // TODO: should throw an exception if buttonName==NULL or
+  // buttonId>buttonNumber
+  return buttonName[buttonId];
+}
+
+bool TargetEthController::ProcessMessage(Message *msg) {
+  return !(controlSocket->SendMessage(msg->buffer, msg->bufferSize, 0) < 0);
+}
+
+bool TargetEthController::IsControllerActionSupported(
+    ControllerAction action) const {
+  // TODO: here we should ask the remote side (host). Probably through the
+  // control socket
+  switch (action) {
+  case ControllerAction::SetLedOn:
+    return true;
+  case ControllerAction::SetLedOff:
+    return true;
+  case ControllerAction::Rumble:
+    return true;
+  case ControllerAction::FlashLed:
+    return true;
+  default:
+    return false;
+  }
+}
+
+bool TargetEthController::ControllerInitialization() {
+  char message[1024];
+  ssize_t received;
+  bool connected = false;
+  bool mustReadMore;
+
+  listeningSocket->Listen(listeningPort);
+  Thread::Info("Debug: Listening to port %d\n", listeningPort);
+  // accept incoming connection
+  bool connectionAccepted = false;
+  while (!connectionAccepted) {
+    controlSocket = listeningSocket->Accept(10);
+    if (controlSocket == nullptr) {
+      // Timeout (or error btw)
+      if (ToBeStopped())
+        return false;
+    } else
+      connectionAccepted = true;
+  }
+  Thread::Info("Debug: Connexion accepted\n");
+
+  // get axis stuff
+  bool axisNumberRead = false;
+  while (!axisNumberRead) {
+    try {
+      axisNumber = controlSocket->ReadUInt32(10);
+      // Thread::Info("Debug: axisNumber %d\n", axisNumber);
+      axisNumberRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  bool bitsPerAxisRead = false;
+  while (!bitsPerAxisRead) {
+    try {
+      bitsPerAxis = controlSocket->ReadUInt32(10);
+      // Thread::Info("Debug: bits per axis %d\n", bitsPerAxis);
+      bitsPerAxisRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  axisName = new string[axisNumber];
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // read string size
+    int stringSize;
+    bool stringSizeRead = false;
+    while (!stringSizeRead) {
+      try {
+        stringSize = controlSocket->ReadUInt32(10);
+        stringSizeRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // read string
+    bool axisNameRead = false;
+    while (!axisNameRead) {
+      try {
+        axisName[i] = controlSocket->ReadString(stringSize, 10);
+        axisNameRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // Thread::Info("Debug: axisName for axis %d %s\n", i, axisName[i].c_str());
+  }
+
+  // get button stuff
+  bool buttonNumberRead = false;
+  while (!buttonNumberRead) {
+    try {
+      buttonNumber = controlSocket->ReadUInt32(10);
+      buttonNumberRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  // Thread::Info("Debug: buttonNumber %d\n", buttonNumber);
+  buttonName = new string[buttonNumber];
+  for (unsigned int i = 0; i < buttonNumber; i++) {
+    // read string size
+    int stringSize;
+    bool stringSizeRead = false;
+    while (!stringSizeRead) {
+      try {
+        stringSize = controlSocket->ReadUInt32(10);
+        stringSizeRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // read string
+    bool buttonNameRead = false;
+    while (!buttonNameRead) {
+      try {
+        buttonName[i] = controlSocket->ReadString(stringSize, 10);
+        buttonNameRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // Thread::Info("Debug: buttonName for button %d %s\n", i,
+    // buttonName[i].c_str());
+  }
+
+  //    dataFrameSize=axisNumber*sizeof(float)+buttonNumber/8*sizeof(uint8_t);
+  buttonOffset = (axisNumber * bitsPerAxis) / 8;
+  if ((axisNumber * bitsPerAxis) % 8 != 0)
+    buttonOffset++;
+  dataFrameSize = buttonOffset + (buttonNumber / 8) * sizeof(uint8_t);
+  if ((buttonNumber % 8) != 0)
+    dataFrameSize++;
+  dataFrameBuffer = new char[dataFrameSize];
+  receiveFrameBuffer = new char[dataFrameSize];
+
+  Thread::Info("Controller connected with host side\n");
+  if (buttonNumber % 8 != 0)
+    Thread::Err("Button number is not multiple of 8\n");
+  return true;
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/TargetEthController.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/TargetEthController.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/TargetEthController.h	(revision 209)
@@ -0,0 +1,92 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/14
+//  filename:   TargetEthController.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class that gets remote controls through an ethernet connection.
+//              Typical use case: a remote control is plugged in a workstation
+//              and sends remote control
+//              data to a distant target (this class) through Wifi
+//
+//
+/*********************************************************************/
+
+#ifndef TARGETETHCONTROLLER_H
+#define TARGETETHCONTROLLER_H
+
+#include "TargetController.h"
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class TcpSocket;
+class UdpSocket;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class TargetController
+*
+* \brief Base Class for target side remote controls
+*
+*/
+class TargetEthController : public TargetController {
+public:
+  TargetEthController(std::string name,
+                      uint16_t port, uint8_t priority = 0);
+  ~TargetEthController();
+  // void DrawUserInterface();
+protected:
+  bool IsConnected() const;
+  // axis stuff
+  std::string GetAxisName(unsigned int axisId) const;
+  // button stuff
+  std::string GetButtonName(unsigned int axisId) const;
+  // controller state stuff
+  bool ProcessMessage(core::Message *msg);
+  bool IsControllerActionSupported(ControllerAction action) const;
+
+  bool IsDataFrameReady();
+  void AcquireAxisData(core::cvmatrix &axis);     // responsible for getting the
+                                                  // axis data from the hardware
+  void AcquireButtonData(core::cvmatrix &button); // responsible for getting the
+                                                  // button data from the
+                                                  // hardware
+
+  bool ControllerInitialization();
+
+private:
+  uint16_t readBits(uint8_t offsetInBits, uint8_t valueSizeInBits, char *buffer,
+                    size_t bufferSize);
+  uint8_t getByteOrNull(char *buffer, int byte, size_t bufferSize);
+  uint32_t charBufferToUint32(char *buffer, size_t bufferSize);
+  core::TcpSocket *listeningSocket;
+  int listeningPort;
+  core::TcpSocket *controlSocket = NULL;
+  core::UdpSocket *dataSocket;
+  std::string *axisName = NULL;
+  std::string *buttonName = NULL;
+  size_t dataFrameSize;
+  char *dataFrameBuffer;
+  char *receiveFrameBuffer;
+  size_t receiveCurrentPosition;
+  uint8_t buttonOffset;
+};
+}
+}
+
+#endif // TARGETCONTROLLER_H
Index: tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.cpp	(revision 209)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/22
+//  filename:   UsRangeFinder.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for UsRangeFinder
+//
+//
+/*********************************************************************/
+
+#include "UsRangeFinder.h"
+#include <FrameworkManager.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <GroupBox.h>
+#include <Layout.h>
+#include <DataPlot1D.h>
+#include <cvmatrix.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+UsRangeFinder::UsRangeFinder(string name)
+    : IODevice(getFrameworkManager(), name) {
+  plot_tab = NULL;
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0, name);
+  output = new cvmatrix(this, desc, floatType);
+  delete desc;
+  AddDataToLog(output);
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Reglages");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+}
+
+UsRangeFinder::UsRangeFinder(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
+
+  output = NULL;
+}
+
+UsRangeFinder::~UsRangeFinder() {
+  if (main_tab != NULL)
+    delete main_tab;
+}
+
+GroupBox *UsRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
+
+Layout *UsRangeFinder::GetLayout(void) const { return sensor_tab; }
+
+DataPlot1D *UsRangeFinder::GetPlot(void) const { return plot; }
+
+Tab *UsRangeFinder::GetPlotTab(void) const { return plot_tab; }
+
+void UsRangeFinder::UseDefaultPlot(void) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plot_tab = new Tab(tab, "Mesures");
+  plot = new DataPlot1D(plot_tab->NewRow(), ObjectName(), 0, 2);
+  plot->AddCurve(output->Element(0));
+}
+
+void UsRangeFinder::LockUserInterface(void) const {
+  setup_groupbox->setEnabled(false);
+}
+
+void UsRangeFinder::UnlockUserInterface(void) const {
+  setup_groupbox->setEnabled(true);
+}
+
+float UsRangeFinder::Value(void) const { return output->Value(0, 0); }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/UsRangeFinder.h	(revision 209)
@@ -0,0 +1,149 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UsRangeFinder.h
+ * \brief Base class for UsRangeFinder
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/22
+ * \version 4.0
+ */
+
+#ifndef USRANGEFINDER_H
+#define USRANGEFINDER_H
+
+#include <IODevice.h>
+
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GroupBox;
+class Layout;
+class DataPlot1D;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class UsRangeFinder
+*
+* \brief Base class for UsRangeFinder
+*
+* Use this class to define a custom UsRangeFinder.
+*
+*/
+class UsRangeFinder : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Control part.
+	* It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  */
+  UsRangeFinder(std::string name);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  UsRangeFinder(const core::IODevice *parent, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~UsRangeFinder();
+
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
+
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
+
+  /*!
+  * \brief Use default plot
+  *
+  * Should no be used for the simulation part.
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief Plot
+  *
+  * \return DataPlot1D
+  */
+  gui::DataPlot1D *GetPlot(void) const;
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Value
+  *
+  * \return output value
+  */
+  float Value(void) const;
+
+protected:
+  /*!
+  * \brief Output matrix
+  *
+  * \return output matrix
+  */
+  core::cvmatrix *output;
+
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::Tab *sensor_tab;
+  gui::DataPlot1D *plot;
+  gui::Tab *plot_tab;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // USRANGEFINDER_H
Index: tags/latest/lib/FlairSensorActuator/src/V4LCamera.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/V4LCamera.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/V4LCamera.cpp	(revision 209)
@@ -0,0 +1,213 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/07/17
+//  filename:   V4LCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    base class for V4l camera
+//
+//
+/*********************************************************************/
+
+#include "V4LCamera.h"
+#include <GroupBox.h>
+#include <DoubleSpinBox.h>
+#include <CheckBox.h>
+#include <Label.h>
+#include <cvimage.h>
+#include <FrameworkManager.h>
+#include <linux/videodev2.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+V4LCamera::V4LCamera(string name,
+                     uint8_t camera_index, uint16_t width, uint16_t height,
+                     cvimage::Type::Format format, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority),
+      Camera(name, width, height, format) {
+  capture = cvCaptureFromCAM(camera_index);
+  if (capture < 0)
+    Thread::Err("cvCaptureFromCAM error\n");
+
+  if (cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width)<0)
+    Thread::Err("cvSetCaptureProperty error\n");
+  if (cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, height)<0)
+    Thread::Err("cvSetCaptureProperty error\n");
+
+  if (format == cvimage::Type::Format::UYVY) {
+    if (cvSetCaptureProperty(capture, CV_CAP_PROP_FORMAT, V4L2_PIX_FMT_UYVY)<0)
+      Thread::Err("cvSetCaptureProperty error\n");
+  } else if (format == cvimage::Type::Format::YUYV) {
+    if (cvSetCaptureProperty(capture, CV_CAP_PROP_FORMAT, V4L2_PIX_FMT_YUYV) <
+        0)
+      Thread::Err("cvSetCaptureProperty error\n");
+  } else {
+    Thread::Err("format not supported\n");
+  }
+
+  // station sol
+  gain = new DoubleSpinBox(GetGroupBox()->NewRow(), "gain:", 0, 1, 0.1);
+  exposure = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "exposure:", 0,
+                               1, 0.1);
+  bright =
+      new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "bright:", 0, 1, 0.1);
+  contrast = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "contrast:", 0,
+                               1, 0.1);
+  hue = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "hue:", 0, 1, 0.1);
+  sharpness = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "sharpness:",
+                                0, 1, 0.1);
+  sat = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "saturation:", 0, 1,
+                          0.1);
+  autogain = new CheckBox(GetGroupBox()->NewRow(), "autogain:");
+  autoexposure = new CheckBox(GetGroupBox()->LastRowLastCol(), "autoexposure:");
+  awb = new CheckBox(GetGroupBox()->LastRowLastCol(), "awb:");
+  fps = new Label(GetGroupBox()->NewRow(), "fps");
+  
+  hasProblems=false;
+}
+
+V4LCamera::~V4LCamera() {
+  SafeStop();
+  Join();
+}
+
+void V4LCamera::Run(void) {
+  Time cam_time, new_time, fpsNow, fpsPrev;
+  IplImage *img; // raw image
+  int fpsCounter = 0;
+
+  // init image old
+  if (!cvGrabFrame(capture)) {
+    Printf("Could not grab a frame\n");
+  }
+  cam_time = GetTime();
+  fpsPrev = cam_time;
+
+  while (!ToBeStopped()) {
+    //check for ps3eye deconnection in hds uav
+    if(cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH)<0) {
+      Thread::Warn("camera disconnected\n");
+      hasProblems=true;
+    }
+    
+    // fps counter
+    fpsCounter++;
+    if (fpsCounter == 100) {
+      fpsNow = GetTime();
+      fps->SetText("fps: %.1f",
+       fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.));
+      fpsCounter = 0;
+      fpsPrev = fpsNow;
+    }
+
+    // cam properties
+    if (gain->ValueChanged() == true && autogain->Value() == false)
+      SetGain(gain->Value());
+    if (exposure->ValueChanged() == true && autoexposure->Value() == false)
+      SetExposure(exposure->Value());
+    if (bright->ValueChanged() == true)
+      SetBrightness(bright->Value());
+    if (sat->ValueChanged() == true)
+      SetSaturation(sat->Value());
+    if (contrast->ValueChanged() == true)
+      SetContrast(contrast->Value());
+    if (hue->ValueChanged() == true)
+      SetHue(hue->Value());
+    if (sharpness->ValueChanged() == true)
+      cvSetCaptureProperty(capture, CV_CAP_PROP_SHARPNESS, sharpness->Value());
+    if (autogain->ValueChanged() == true) {
+      if (autogain->Value() == true) {
+        gain->setEnabled(false);
+      } else {
+        gain->setEnabled(true);
+        SetGain(gain->Value());
+      }
+      SetAutoGain(autogain->Value());
+    }
+    if (autoexposure->ValueChanged() == true) {
+      if (autoexposure->Value() == true) {
+        exposure->setEnabled(false);
+      } else {
+        exposure->setEnabled(true);
+        SetExposure(exposure->Value());
+      }
+      SetAutoExposure(autoexposure->Value());
+    }
+    if (awb->ValueChanged() == true)
+      cvSetCaptureProperty(capture, CV_CAP_PROP_AWB, awb->Value());
+
+    // cam pictures
+    img = cvRetrieveRawFrame(capture);
+    if (!cvGrabFrame(capture)) {
+      Printf("Could not grab a frame\n");
+    }
+    new_time = GetTime();
+    
+    //check for ps3eye deconnection in hds uav
+    if(new_time-cam_time>100*1000*1000) {
+      Thread::Warn("delta trop grand\n");
+      hasProblems=true;
+    }
+
+    output->GetMutex();
+    output->img->imageData = img->imageData;
+    output->ReleaseMutex();
+
+    output->SetDataTime(cam_time);
+    ProcessUpdate(output);
+
+    cam_time = new_time;
+  }
+
+  cvReleaseCapture(&capture);
+}
+
+bool V4LCamera::HasProblems(void) {
+  return hasProblems;
+}
+
+void V4LCamera::SetAutoGain(bool value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_AUTOGAIN, value);
+}
+
+void V4LCamera::SetAutoExposure(bool value) {
+  Thread::Warn("not implemented in opencv\n");
+}
+
+void V4LCamera::SetGain(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_GAIN, value);
+}
+
+void V4LCamera::SetExposure(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_EXPOSURE, value);
+}
+
+void V4LCamera::SetBrightness(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_BRIGHTNESS, value);
+}
+
+void V4LCamera::SetSaturation(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_SATURATION, value);
+}
+
+void V4LCamera::SetHue(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_HUE, value);
+}
+
+void V4LCamera::SetContrast(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_CONTRAST, value);
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/V4LCamera.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/V4LCamera.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/V4LCamera.h	(revision 209)
@@ -0,0 +1,151 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file V4LCamera.h
+ * \brief Base class for V4l camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/17
+ * \version 4.0
+ */
+
+#ifndef V4LCamera_H
+#define V4LCamera_H
+
+#include <Thread.h>
+#include "Camera.h"
+#include <highgui.h>
+
+namespace flair {
+namespace core {
+class cvimage;
+}
+namespace gui {
+class DoubleSpinBox;
+class CheckBox;
+class Label;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class V4LCamera
+*
+* \brief Base class for V4l camera
+*/
+class V4LCamera : public core::Thread, public Camera {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param camera_index camera index
+  * \param width width
+  * \param height height
+  * \param format image format
+  * \param priority priority of the Thread
+  */
+  V4LCamera(std::string name,
+            uint8_t camera_index, uint16_t width, uint16_t height,
+            core::cvimage::Type::Format format, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~V4LCamera();
+  
+    //hack for ps3eye in hds uav
+  //TODO: put this in ps3eye class
+  bool HasProblems(void);
+
+protected:
+  /*!
+  * \brief Set Gain
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetGain(float value);
+
+  /*!
+  * \brief Set Auto Gain
+  *
+  * \param value value
+  */
+  virtual void SetAutoGain(bool value);
+
+  /*!
+  * \brief Set Exposure
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetExposure(float value);
+
+  /*!
+  * \brief Set Auto Exposure
+  *
+  * \param value value
+  */
+  virtual void SetAutoExposure(bool value);
+
+  /*!
+  * \brief Set Brightness
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetBrightness(float value);
+
+  /*!
+  * \brief Set Saturation
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetSaturation(float value);
+
+  /*!
+  * \brief Set Hue
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetHue(float value);
+
+  /*!
+  * \brief Set Contrast
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetContrast(float value);
+  
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  CvCapture *capture;
+
+  gui::Tab *sensor_tab;
+  gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,*sat;
+  gui::CheckBox *autogain, *awb, *autoexposure;
+  gui::Label *fps;
+  bool hasProblems;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // V4LCamera_H
Index: tags/latest/lib/FlairSensorActuator/src/VrpnClient.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnClient.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnClient.cpp	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnClient.cpp
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class to connect to a Vrpn server
+//
+/*********************************************************************/
+
+#include "VrpnClient.h"
+#include "VrpnClient_impl.h"
+#include <FrameworkManager.h>
+#include <TabWidget.h>
+#include <Layout.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace {
+  flair::sensor::VrpnClient *singleton = NULL;
+}
+
+
+namespace flair {
+namespace sensor {
+
+VrpnClient *GetVrpnClient(void) { return singleton; }
+	
+VrpnClient::VrpnClient(string name,
+                       string address, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority) {
+	if (singleton != NULL) {
+    Err("VrpnClient must be instanced only one time\n");
+    return;
+  }
+
+  singleton = this;
+  pimpl_ = new VrpnClient_impl(this, name, address);
+}
+
+VrpnClient::VrpnClient(string name,
+                       SerialPort *serialport, uint16_t us_period,
+                       uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority) {
+	if (singleton != NULL) {
+    Err("VrpnClient must be instanced only one time\n");
+    return;
+  }
+
+  singleton = this;
+  pimpl_ = new VrpnClient_impl(this, name, serialport, us_period);
+}
+
+VrpnClient::~VrpnClient() {
+  SafeStop();
+  Join();
+
+  delete pimpl_;
+}
+
+Layout *VrpnClient::GetLayout(void) const {
+  return (Layout *)(pimpl_->setup_tab);
+}
+
+TabWidget *VrpnClient::GetTabWidget(void) const { return pimpl_->tab; }
+
+bool VrpnClient::UseXbee(void) const { return pimpl_->UseXbee(); }
+
+void VrpnClient::Run(void) { pimpl_->Run(); }
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/VrpnClient.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnClient.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnClient.h	(revision 209)
@@ -0,0 +1,118 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file VrpnClient.h
+ * \brief Class to connect to a Vrpn server
+ * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
+ * 7253
+ * \date 2013/04/03
+ * \version 4.0
+ */
+
+#ifndef VRPNCLIENT_H
+#define VRPNCLIENT_H
+
+#include <Thread.h>
+
+namespace flair {
+	namespace core {
+		class SerialPort;
+	}
+	namespace gui {
+		class TabWidget;
+		class Layout;
+	}
+}
+
+class VrpnClient_impl;
+class VrpnObject_impl;
+
+namespace flair {
+namespace sensor {
+/*! \class VrpnClient
+*
+* \brief Class to connect to a Vrpn server. The Thread is created with 
+*  the FrameworkManager as parent. FrameworkManager must be created before.
+* Only one instance of this class is allowed by program.
+*/
+class VrpnClient : public core::Thread {
+  friend class ::VrpnObject_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnClient. Connection is done by IP.
+  *
+  * \param name name
+  * \param address server address
+  * \param priority priority of the Thread
+  */
+  VrpnClient(std::string name,
+             std::string address,  uint8_t priority);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnClient. Connection is done by XBee modem.
+  *
+  * \param name name
+  * \param serialport SerialPort for XBee modem
+  * \param us_period Xbee RX timeout in us
+  * \param priority priority of the Thread
+  */
+  VrpnClient(std::string name,
+             core::SerialPort *serialport, uint16_t us_period,
+             uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~VrpnClient();
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Setup Tab
+  *
+  * \return a Tab available
+  */
+  gui::TabWidget *GetTabWidget(void) const;
+
+  /*!
+  * \brief Is XBee used?
+  *
+  * \return true if connection is based on XBee modem
+  */
+  bool UseXbee(void) const;
+
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+
+  class VrpnClient_impl *pimpl_;
+};
+
+/*!
+* \brief get VrpnClient
+*
+* \return the VrpnClient
+*/
+VrpnClient *GetVrpnClient(void);
+
+} // end namespace sensor
+} // end namespace flair
+#endif // VRPNCLIENT_H
Index: tags/latest/lib/FlairSensorActuator/src/VrpnClient_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 209)
@@ -0,0 +1,237 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnClient_impl.cpp
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet se connectant au serveur vrpn
+//
+//
+/*********************************************************************/
+
+#include "VrpnClient.h"
+#include "VrpnClient_impl.h"
+#include "VrpnObject.h"
+#include "VrpnObject_impl.h"
+#include <SerialPort.h>
+#include <vrpn_Connection.h>
+#include <FrameworkManager.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <GridLayout.h>
+#include <OneAxisRotation.h>
+#include <Vector3D.h>
+#include <Quaternion.h>
+#include <Mutex.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+#include <math.h>
+
+using std::string;
+using std::vector;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+VrpnClient_impl::VrpnClient_impl(VrpnClient *self, std::string name,
+                                 std::string address) {
+  this->self = self;
+  serialport = NULL;
+	isConnected=false;
+
+  mutex = new Mutex(self, name);
+
+  connection = vrpn_get_connection_by_name(address.c_str());
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Reglages");
+
+  rotation_1 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 1",OneAxisRotation::PreRotation);
+  rotation_2 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 2",OneAxisRotation::PreRotation);
+}
+
+VrpnClient_impl::VrpnClient_impl(VrpnClient *self, std::string name,
+                                 SerialPort *serialport, uint16_t us_period) {
+  this->us_period = us_period;
+  this->self = self;
+  this->serialport = serialport;
+  connection = NULL;
+  mutex = new Mutex(self, name);
+
+  serialport->SetBaudrate(111111);
+  serialport->SetRxTimeout(us_period * 1000);
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Reglages");
+
+  rotation_1 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 1",OneAxisRotation::PreRotation);
+  rotation_2 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 2",OneAxisRotation::PreRotation);
+}
+
+VrpnClient_impl::~VrpnClient_impl() {
+  if (!UseXbee()) {
+    // on fait une copie car le delete touche a trackables_copy via
+    // RemoveTrackable
+    vector<VrpnObject_impl *> trackables_copy = trackables;
+    for (unsigned int i = 0; i < trackables_copy.size(); i++)
+      delete trackables_copy.at(i)->self;
+    // trackables.clear();
+  } else {
+    // on fait une copie car le delete touche a xbee_objects_copy via
+    // RemoveTrackable
+    vector<xbee_object> xbee_objects_copy = xbee_objects;
+    for (unsigned int i = 0; i < xbee_objects_copy.size(); i++)
+      delete xbee_objects_copy.at(i).vrpnobject->self;
+  }
+
+  delete main_tab;
+
+  if (!UseXbee()) {
+    // it will automatically delete connection
+    connection->removeReference();
+  }
+}
+
+void VrpnClient_impl::ComputeRotations(Vector3Df &point) {
+  rotation_1->ComputeRotation(point);
+  rotation_2->ComputeRotation(point);
+}
+
+void VrpnClient_impl::ComputeRotations(Quaternion &quat) {
+  rotation_1->ComputeRotation(quat);
+  rotation_2->ComputeRotation(quat);
+}
+
+void VrpnClient_impl::AddTrackable(VrpnObject_impl *obj) {
+  mutex->GetMutex();
+  trackables.push_back(obj);
+  mutex->ReleaseMutex();
+}
+
+void VrpnClient_impl::RemoveTrackable(VrpnObject_impl *obj) {
+  mutex->GetMutex();
+  for (vector<VrpnObject_impl *>::iterator it = trackables.begin();
+       it < trackables.end(); it++) {
+    if (*it == obj) {
+      trackables.erase(it);
+      break;
+    }
+  }
+  for (vector<xbee_object>::iterator it = xbee_objects.begin();
+       it < xbee_objects.end(); it++) {
+    if ((*it).vrpnobject == obj) {
+      xbee_objects.erase(it);
+      break;
+    }
+  }
+  mutex->ReleaseMutex();
+}
+
+void VrpnClient_impl::AddTrackable(VrpnObject_impl *obj, uint8_t id) {
+  xbee_object tmp;
+  tmp.vrpnobject = obj;
+  tmp.id = id;
+  mutex->GetMutex();
+  xbee_objects.push_back(tmp);
+  mutex->ReleaseMutex();
+}
+
+bool VrpnClient_impl::UseXbee(void) {
+  if (connection == NULL) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+void VrpnClient_impl::Run(void) {
+	struct timeval timeout;
+	timeout.tv_sec=0;
+	timeout.tv_usec=100000;
+			
+  while (!self->ToBeStopped()) {
+    if (UseXbee()) {
+      ssize_t read = 0;
+      uint8_t response[38] = {0};
+
+      read = serialport->Read(response, sizeof(response));
+      if (read > 0 && read != sizeof(response))
+        read += serialport->Read(&response[read], sizeof(response) - read);
+      // int temps=(float)self->GetTime()/(1000*1000);
+      // self->Printf("%i %i %i\n",temps-last,temps,last);
+      // last=temps;
+      if (read < 0) {
+        // self->Warn("erreur rt_dev_read (%s)\n",strerror(-read));
+      } else if (read != sizeof(response)) {
+        self->Warn("erreur rt_dev_read %i/%i\n", read, sizeof(response));
+      } else {
+        // for(ssize_t i=0;i<read;i++) printf("%x ",response[i]);
+        // printf("\n");
+        uint8_t checksum = 0;
+        for (ssize_t i = 3; i < read; i++)
+          checksum += response[i];
+        if (checksum != 255) {
+          self->Err("checksum error\n");
+        } else {
+          vrpn_TRACKERCB t;
+          float pos[3];
+          float quat[4];
+          uint8_t id = response[8];
+
+          mutex->GetMutex();
+          if (id < xbee_objects.size()) {
+            memcpy(pos, &response[9], sizeof(pos));
+            memcpy(quat, &response[9] + sizeof(pos), sizeof(quat));
+            for (int i = 0; i < 3; i++)
+              t.pos[i] = pos[i];
+            for (int i = 0; i < 4; i++)
+              t.quat[i] = quat[i];
+            if (fabs(pos[0] > 10) || fabs(pos[1] > 10) || fabs(pos[2] > 10)) {
+              Printf("prob pos %f %f %f\n", pos[0], pos[1], pos[2]);
+            } else {
+              // self->Printf("%i %f %f %f
+              // %f\n",id,pos[0],pos[1],pos[2],(float)self->GetTime()/(1000*1000));
+              VrpnObject_impl::handle_pos(xbee_objects.at(id).vrpnobject, t);
+            }
+          }
+          mutex->ReleaseMutex();
+        }
+      }
+    } else {//!UseXbee()
+        if(connection->connected()==vrpn_true && !isConnected) {
+            isConnected=true;
+            Printf("VRPN connected\n");
+        }
+        if(connection->connected()==vrpn_false && isConnected) {
+            isConnected=false;
+            Printf("VRPN disconnected\n");
+        }
+        //timeout in mainloop is not well handled if not connected...
+        if(isConnected) {
+            //this is when trackables callbacks are called:
+            if(connection->mainloop(&timeout)!=0) {
+                self->Warn("connection dropped\n");
+            }
+            //printf("%lld\n",GetTime()/(1000*1000));
+            mutex->GetMutex();
+            for (unsigned int i = 0; i < trackables.size(); i++)
+                trackables.at(i)->tracker->mainloop();
+            mutex->ReleaseMutex();
+        } else {
+            connection->mainloop();
+            self->SleepMS(10);
+        }
+    }
+  }
+}
Index: tags/latest/lib/FlairSensorActuator/src/VrpnObject.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 209)
@@ -0,0 +1,84 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnObject.cpp
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for VRPN object
+//
+//
+/*********************************************************************/
+
+#include "VrpnObject.h"
+#include "VrpnObject_impl.h"
+#include "VrpnClient.h"
+#include <string.h>
+
+#include <cvmatrix.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+VrpnObject::VrpnObject(string name,
+                       const TabWidget *tab)
+    : IODevice(GetVrpnClient(), name) {
+  pimpl_ = new VrpnObject_impl(this, name, -1, tab);
+  AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
+}
+
+VrpnObject::VrpnObject(string name, uint8_t id,
+                       const TabWidget *tab)
+    : IODevice(GetVrpnClient(), name) {
+  Warn("Creation of object %s with id %i\n", name.c_str(), id);
+  pimpl_ = new VrpnObject_impl(this, name, id, tab);
+  AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
+}
+
+VrpnObject::~VrpnObject(void) { 
+  delete pimpl_;
+}
+
+cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
+
+cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
+
+Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
+
+DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
+
+DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
+
+DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
+
+Time VrpnObject::GetLastPacketTime(void) const {
+  return pimpl_->output->DataTime();
+}
+
+bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
+  return pimpl_->IsTracked(timeout_ms);
+}
+
+void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
+  pimpl_->GetQuaternion(quaternion);
+}
+
+void VrpnObject::GetPosition(Vector3Df &point) const {
+  pimpl_->GetPosition(point);
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/VrpnObject.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnObject.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnObject.h	(revision 209)
@@ -0,0 +1,178 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file VrpnObject.h
+ * \brief Class for VRPN object
+ * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
+ * 7253
+ * \date 2013/04/03
+ * \version 4.0
+ */
+
+#ifndef VRPNOBJECT_H
+#define VRPNOBJECT_H
+
+#include <IODevice.h>
+#include <Vector3D.h>
+#include <stdint.h>
+
+namespace flair {
+	namespace core {
+		class cvmatrix;
+		class Quaternion;
+	}
+	namespace gui {
+		class TabWidget;
+		class Tab;
+		class DataPlot1D;
+	}
+}
+
+class VrpnObject_impl;
+class VrpnClient_impl;
+
+namespace flair {
+namespace sensor {
+class VrpnClient;
+
+/*! \class VrpnObject
+*
+* \brief Class for VRPN object. The IODevice is created with 
+*  the VrpnClient as parent. VrpnClient must be created before.
+*/
+class VrpnObject : public core::IODevice {
+  friend class ::VrpnObject_impl;
+  friend class ::VrpnClient_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnObject. Connection is done by IP.
+  *
+  * \param name VRPN object name, should be the same as defined in the server
+  * \param tab Tab for the user interface
+  */
+  VrpnObject(std::string name,
+             const gui::TabWidget *tab);
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnObject. Connection is done by IP.
+  *
+  * \param name name
+  * \param id VRPN object id, should be the same as defined in the server
+  * \param tab Tab for the user interface
+  */
+  VrpnObject(std::string name, uint8_t id,
+             const gui::TabWidget *tab);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~VrpnObject(void);
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Get Last Packet Time
+  *
+  * \return Time of last received packe
+  */
+  core::Time GetLastPacketTime(void) const;
+
+  /*!
+  * \brief Is object tracked?
+  *
+  * \param timeout_ms timeout
+  * \return true if object is tracked during timeout_ms time
+  */
+  bool IsTracked(unsigned int timeout_ms) const;
+
+  /*!
+  * \brief Get Quaternion
+  *
+  * \param quaternion output datas
+  */
+  void GetQuaternion(core::Quaternion &quaternion) const;
+  /*!
+  * \brief Get Position
+  *
+  * \param point output datas
+  */
+  void GetPosition(core::Vector3Df &point) const;
+
+  /*!
+  * \brief Output matrix
+  *
+  * Matrix is of type float and as follows: \n
+  * (0,0) q0 \n
+  * (1,0) q1 \n
+  * (2,0) q2 \n
+	* (3,0) q3 \n
+  * (4,0) x \n
+  * (5,0) y \n
+  * (6,0) z \n
+  *
+  * \return Output matrix
+  */
+  core::cvmatrix *Output(void) const;
+
+  /*!
+  * \brief State matrix
+  *
+	* Used for plotting on ground station. \n
+  * Matrix is of type float and as follows: \n
+  * (0,0) roll (deg) \n
+  * (1,0) pitch (deg) \n
+  * (2,0) yaw (deg) \n
+  *
+  * \return State matrix
+  */
+  core::cvmatrix *State(void) const;
+
+  /*!
+  * \brief x plot
+  *
+  * \return x plot
+  */
+  gui::DataPlot1D *xPlot(void) const;
+
+  /*!
+  * \brief y plot
+  *
+  * \return y plot
+  */
+  gui::DataPlot1D *yPlot(void) const;
+
+  /*!
+  * \brief z plot
+  *
+  * \return z plot
+  */
+  gui::DataPlot1D *zPlot(void) const;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  class VrpnObject_impl *pimpl_;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // VRPNOBJECT_H
Index: tags/latest/lib/FlairSensorActuator/src/VrpnObject_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 209)
@@ -0,0 +1,190 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnObject.cpp
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet vrpn
+//
+//
+/*********************************************************************/
+#include "VrpnObject_impl.h"
+#include "VrpnObject.h"
+#include "VrpnClient.h"
+#include "VrpnClient_impl.h"
+#include <vrpn_Tracker.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <vrpn_Connection.h>
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <DataPlot1D.h>
+#include <OneAxisRotation.h>
+#include <Vector3D.h>
+#include <Euler.h>
+#include <math.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::sensor;
+
+VrpnObject_impl::VrpnObject_impl(VrpnObject *self,
+                                 string name, int id, const TabWidget *tab) {
+  parent = GetVrpnClient();
+  this->self = self;
+
+	if(parent==NULL) {
+		self->Err("VrpnClient must be instanced before creating VrpnObject\n");
+		return;
+	}
+  if (id == -1 && parent->UseXbee()) {
+    self->Err("erreur aucun identifiant specifie pour la connexion Xbee\n");
+  }
+  if (id != -1 && !parent->UseXbee()) {
+    self->Warn(
+        "identifiant pour la connexion Xbee ignore car pas en mode Xbee\n");
+  }
+  
+  // state
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(7, 1);
+  desc->SetElementName(0, 0, "q0");
+  desc->SetElementName(1, 0, "q1");
+  desc->SetElementName(2, 0, "q2");
+  desc->SetElementName(3, 0, "q3");
+  desc->SetElementName(4, 0, "x");
+  desc->SetElementName(5, 0, "y");
+  desc->SetElementName(6, 0, "z");
+  output = new cvmatrix(self, desc, floatType);
+  delete desc;
+
+  desc = new cvmatrix_descriptor(3, 1);
+  desc->SetElementName(0, 0, "roll");
+  desc->SetElementName(1, 0, "pitch");
+  desc->SetElementName(2, 0, "yaw");
+  state = new cvmatrix(self, desc, floatType);
+  delete desc;
+
+  // ui
+  plot_tab = new Tab(tab, "Mesures " + name);
+  x_plot = new DataPlot1D(plot_tab->NewRow(), "x", -10, 10);
+  x_plot->AddCurve(output->Element(4));
+  y_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "y", -10, 10);
+  y_plot->AddCurve(output->Element(5));
+  z_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "z", -2, 0);
+  z_plot->AddCurve(output->Element(6));
+  
+  if (parent->UseXbee()) {
+    tracker = NULL;
+    parent->pimpl_->AddTrackable(this, id);
+  } else {
+    tracker = new vrpn_Tracker_Remote(name.c_str(), parent->pimpl_->connection);
+    tracker->register_change_handler(this, handle_pos);
+    tracker->shutup = true;
+    parent->pimpl_->AddTrackable(this);
+  }
+ 
+}
+
+VrpnObject_impl::~VrpnObject_impl(void) {
+  parent->pimpl_->RemoveTrackable(this);
+  if (tracker != NULL) {// normal
+    tracker->unregister_change_handler(this, handle_pos);
+    delete tracker;
+  }
+  delete plot_tab;
+}
+
+bool VrpnObject_impl::IsTracked(unsigned int timeout_ms) {
+  output->GetMutex();
+  Time a = GetTime();
+  Time dt = a - output->DataTime();
+  output->ReleaseMutex();
+
+  if (dt > (Time)(timeout_ms * 1000000)) {
+    // self->Printf("%lld %lld %lld
+    // %lld\n",a,output->DataTime(),dt,(Time)(timeout_ms*1000000));
+    return false;
+  } else {
+    return true;
+  }
+}
+
+void VrpnObject_impl::GetQuaternion(Quaternion &quaternion) {
+  output->GetMutex();
+  quaternion.q0 = output->ValueNoMutex(0, 0);
+  quaternion.q1 = output->ValueNoMutex(1, 0);
+  quaternion.q2 = output->ValueNoMutex(2, 0);
+  quaternion.q3 = output->ValueNoMutex(3, 0);
+  output->ReleaseMutex();
+}
+
+void VrpnObject_impl::GetPosition(Vector3Df &point) {
+  output->GetMutex();
+  point.x = output->ValueNoMutex(4, 0);
+  point.y = output->ValueNoMutex(5, 0);
+  point.z = output->ValueNoMutex(6, 0);
+  output->ReleaseMutex();
+}
+
+void VRPN_CALLBACK
+VrpnObject_impl::handle_pos(void *userdata, const vrpn_TRACKERCB t) {
+  bool is_nan = false;
+  VrpnObject_impl *caller = reinterpret_cast<VrpnObject_impl *>(userdata);
+  Time time = GetTime();
+
+  // check if something is nan
+  for (int i = 0; i < 3; i++) {
+    if (isnan(t.pos[i]) == true)
+      is_nan = true;
+  }
+  for (int i = 0; i < 4; i++) {
+    if (isnan(t.quat[i]) == true)
+      is_nan = true;
+  }
+  if (is_nan == true) {
+    caller->self->Warn("data is nan, skipping it (time %lld)\n", time);
+    return;
+  }
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  caller->output->GetMutex();
+
+  // warning: t.quat is defined as (qx,qy,qz,qw), which is different from
+  // flair::core::Quaternion
+	Quaternion quaternion(t.quat[3],t.quat[0],t.quat[1],t.quat[2]);
+  Vector3Df pos((float)t.pos[0], (float)t.pos[1], (float)t.pos[2]);
+
+  // on effectue les rotation
+  caller->parent->pimpl_->ComputeRotations(pos);
+  caller->parent->pimpl_->ComputeRotations(quaternion);
+
+  caller->output->SetValueNoMutex(0, 0, quaternion.q0);
+  caller->output->SetValueNoMutex(1, 0, quaternion.q1);
+  caller->output->SetValueNoMutex(2, 0, quaternion.q2);
+  caller->output->SetValueNoMutex(3, 0, quaternion.q3);
+  caller->output->SetValueNoMutex(4, 0, pos.x);
+  caller->output->SetValueNoMutex(5, 0, pos.y);
+  caller->output->SetValueNoMutex(6, 0, pos.z);
+
+  caller->output->SetDataTime(time);
+  caller->output->ReleaseMutex();
+
+	Euler euler=quaternion.ToEuler();
+  caller->state->GetMutex();
+  caller->state->SetValueNoMutex(0, 0, Euler::ToDegree(euler.roll));
+  caller->state->SetValueNoMutex(1, 0, Euler::ToDegree(euler.pitch));
+  caller->state->SetValueNoMutex(2, 0, Euler::ToDegree(euler.yaw));
+  caller->state->ReleaseMutex();
+
+  caller->self->ProcessUpdate(caller->output);
+}
Index: tags/latest/lib/FlairSensorActuator/src/XBldc.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/XBldc.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/XBldc.cpp	(revision 209)
@@ -0,0 +1,41 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/13
+//  filename:   XBldc.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for Xufo Bldc
+//
+//
+/*********************************************************************/
+
+#include "XBldc.h"
+#include "XBldc_impl.h"
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+XBldc::XBldc(const IODevice *parent, Layout *layout, string name,
+             I2cPort *i2cport)
+    : Bldc(parent, layout, name, 4) {
+  pimpl_ = new XBldc_impl(this, i2cport);
+  
+  SetIsReady(true);
+}
+
+XBldc::~XBldc() { delete pimpl_; }
+
+void XBldc::SetMotors(float *value) { pimpl_->SetMotors(value); }
+
+} // end namespace actuator
+} // end namespace flair
Index: tags/latest/lib/FlairSensorActuator/src/XBldc.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/XBldc.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/XBldc.h	(revision 209)
@@ -0,0 +1,90 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file XBldc.h
+ * \brief Class for Xufo Bldc
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/13
+ * \version 4.0
+ */
+
+#ifndef XBLDC_H
+#define XBLDC_H
+
+#include "Bldc.h"
+
+namespace flair {
+namespace core {
+class IODevice;
+class I2cPort;
+}
+namespace gui {
+class Layout;
+}
+}
+
+class XBldc_impl;
+
+namespace flair {
+namespace actuator {
+/*! \class XBldc
+*
+* \brief Class for Xufo Bldc
+*/
+class XBldc : public Bldc {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a XBldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param i2cport i2cport
+  */
+  XBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+        core::I2cPort *i2cport);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~XBldc();
+
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
+
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
+
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *value);
+
+  class XBldc_impl *pimpl_;
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // XBLDC_H
Index: tags/latest/lib/FlairSensorActuator/src/XBldc_impl.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/XBldc_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/XBldc_impl.cpp	(revision 209)
@@ -0,0 +1,151 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/13
+//  filename:   XBldc_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c Xufo
+//
+//
+/*********************************************************************/
+
+#include "XBldc_impl.h"
+#include "XBldc.h"
+#include <I2cPort.h>
+#include <cvmatrix.h>
+#include <string.h>
+
+#define BASE_ADDRESS 0x01
+#define MAX_VALUE 200
+
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::actuator;
+
+XBldc_impl::XBldc_impl(XBldc *self, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
+
+  i2cport->SetTxTimeout(5000000);
+}
+
+XBldc_impl::~XBldc_impl() {}
+
+void XBldc_impl::SetMotors(float *value) {
+  uint8_t tosend_value[5];
+
+  for (int i = 0; i < 4; i++)
+    tosend_value[i] = (uint8_t)(MAX_VALUE * value[i]);
+
+  ssize_t written;
+  tosend_value[4] = 0xaa;
+  for (int i = 0; i < 4; i++)
+    tosend_value[4] += tosend_value[i];
+  self->Err("please verify motors adresses\n");
+  // todo faire la procedure changement addresse par la station sol
+  /*
+      i2cport->GetMutex();
+      i2cport->SetSlave(BASE_ADDRESS);
+
+      written =i2cport->Write(tosend_value, sizeof(tosend_value));
+      if(written<0)
+      {
+          self->Err("rt_dev_write error (%s)\n",strerror(-written));
+      }
+      else if (written != sizeof(tosend_value))
+      {
+          self->Err("rt_dev_write error %i/%i\n",written,sizeof(tosend_value));
+      }
+
+      i2cport->ReleaseMutex();*/
+}
+/*
+void XBldc_impl::StartTest(uint8_t moteur)
+{
+    unsigned char tx[4];
+    ssize_t written;
+
+    tx[0]=251;
+    tx[1]=moteur;
+    tx[2]=0;
+    tx[3]=231+moteur;
+
+    i2cport->GetMutex();
+    i2cport->SetSlave(BASE_ADDRESS);
+
+    written =i2cport->Write(tx, sizeof(tx));
+    if(written<0)
+    {
+        self->Err("rt_dev_write error (%s)\n",strerror(-written));
+    }
+    else if (written != sizeof(tx))
+    {
+        self->Err("rt_dev_write %i/%i error\n",written,sizeof(tx));
+    }
+
+    i2cport->ReleaseMutex();
+}
+*/
+void XBldc_impl::ChangeDirection(uint8_t moteur) {
+  unsigned char tx[4];
+  ssize_t written;
+
+  tx[0] = 254;
+  tx[1] = moteur;
+  tx[2] = 0;
+  tx[3] = 234 + moteur;
+
+  i2cport->GetMutex();
+  i2cport->SetSlave(BASE_ADDRESS);
+
+  written = i2cport->Write(tx, sizeof(tx));
+  if (written < 0) {
+    self->Err("rt_dev_write (%s) error\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write %i/%i error\n", written, sizeof(tx));
+  }
+
+  i2cport->ReleaseMutex();
+}
+
+void XBldc_impl::ChangeAdress(uint8_t old_add, uint8_t new_add) {
+  unsigned char tx[4];
+  ssize_t written;
+
+  tx[0] = 250;
+  tx[1] = old_add;
+  tx[2] = new_add;
+  tx[3] = 230 + old_add + new_add;
+
+  i2cport->GetMutex();
+  i2cport->SetSlave(BASE_ADDRESS);
+
+  written = i2cport->Write(tx, sizeof(tx));
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
+
+  i2cport->ReleaseMutex();
+}
+
+uint8_t XBldc_impl::Sat(float value, uint8_t min, uint8_t max) {
+  uint8_t sat_value = (uint8_t)value;
+
+  if (value > ((float)sat_value + 0.5))
+    sat_value++;
+
+  if (value < (float)min)
+    sat_value = min;
+  if (value > (float)max)
+    sat_value = max;
+
+  return sat_value;
+}
Index: tags/latest/lib/FlairSensorActuator/src/geodesie.cpp
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/geodesie.cpp	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/geodesie.cpp	(revision 209)
@@ -0,0 +1,406 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include <fstream>
+
+#include "geodesie.h"
+
+#ifdef _MSC_VER
+#pragma warning(disable : 4244)
+#endif //_MSC_VER
+
+namespace Geodesie {
+/// ////////////////////////////////////////////////////////////////////
+Matrice::Matrice(const Matrice &A) {
+  c0_l0 = A.c0_l0;
+  c1_l0 = A.c1_l0;
+  c2_l0 = A.c2_l0;
+  c0_l1 = A.c0_l1;
+  c1_l1 = A.c1_l1;
+  c2_l1 = A.c2_l1;
+  c0_l2 = A.c0_l2;
+  c1_l2 = A.c1_l2;
+  c2_l2 = A.c2_l2;
+}
+/// ////////////////////////////////////////////////////////////////////
+Matrice::Matrice() {
+  c0_l0 = 0.0;
+  c1_l0 = 0.0;
+  c2_l0 = 0.0;
+  c0_l1 = 0.0;
+  c1_l1 = 0.0;
+  c2_l1 = 0.0;
+  c0_l2 = 0.0;
+  c1_l2 = 0.0;
+  c2_l2 = 0.0;
+}
+/// ////////////////////////////////////////////////////////////////////
+void Matrice::Apply(double v0, double v1, double v2, double &Mv0, double &Mv1,
+                    double &Mv2) {
+  Mv0 = c0_l0 * v0 + c1_l0 * v1 + c2_l0 * v2;
+  Mv1 = c0_l1 * v0 + c1_l1 * v1 + c2_l1 * v2;
+  Mv2 = c0_l2 * v0 + c1_l2 * v1 + c2_l2 * v2;
+}
+/// ////////////////////////////////////////////////////////////////////
+Matrice ProdMat(const Matrice A, const Matrice B) {
+  Matrice out;
+
+  out.c0_l0 = A.c0_l0 * B.c0_l0 + A.c1_l0 * B.c0_l1 + A.c2_l0 * B.c0_l2;
+  out.c1_l0 = A.c0_l0 * B.c1_l0 + A.c1_l0 * B.c1_l1 + A.c2_l0 * B.c1_l2;
+  out.c2_l0 = A.c0_l0 * B.c2_l0 + A.c1_l0 * B.c2_l1 + A.c2_l0 * B.c2_l2;
+
+  out.c0_l1 = A.c0_l1 * B.c0_l0 + A.c1_l1 * B.c0_l1 + A.c2_l1 * B.c0_l2;
+  out.c1_l1 = A.c0_l1 * B.c1_l0 + A.c1_l1 * B.c1_l1 + A.c2_l1 * B.c1_l2;
+  out.c2_l1 = A.c0_l1 * B.c2_l0 + A.c1_l1 * B.c2_l1 + A.c2_l1 * B.c2_l2;
+
+  out.c0_l2 = A.c0_l2 * B.c0_l0 + A.c1_l2 * B.c0_l1 + A.c2_l2 * B.c0_l2;
+  out.c1_l2 = A.c0_l2 * B.c1_l0 + A.c1_l2 * B.c1_l1 + A.c2_l2 * B.c1_l2;
+  out.c2_l2 = A.c0_l2 * B.c2_l0 + A.c1_l2 * B.c2_l1 + A.c2_l2 * B.c2_l2;
+  return out;
+}
+
+/// ////////////////////////////////////////////////////////////////////
+Matrice TransMat(const Matrice A) {
+  Matrice out;
+  out.c0_l0 = A.c0_l0;
+  out.c1_l0 = A.c0_l1;
+  out.c2_l0 = A.c0_l2;
+  out.c0_l1 = A.c1_l0;
+  out.c1_l1 = A.c1_l1;
+  out.c2_l1 = A.c1_l2;
+  out.c0_l2 = A.c2_l0;
+  out.c1_l2 = A.c2_l1;
+  out.c2_l2 = A.c2_l2;
+  return out;
+}
+
+/// ////////////////////////////////////////////////////////////////////
+void Write(const Matrice A, std::ostream &out) {
+  out << A.c0_l0 << "\t" << A.c1_l0 << "\t" << A.c2_l0 << "\n";
+  out << A.c0_l1 << "\t" << A.c1_l1 << "\t" << A.c2_l1 << "\n";
+  out << A.c0_l2 << "\t" << A.c1_l2 << "\t" << A.c2_l2 << "\n";
+}
+
+/// ////////////////////////////////////////////////////////////////////
+Raf98::~Raf98() { m_dvalues.clear(); }
+
+//-----------------------------------------------------------------------------
+bool Raf98::Interpol(double longitude, double latitude, double *Hwgs84) const {
+  *Hwgs84 = 0.0;
+  if (m_dvalues.size() == 0)
+    return false;
+  const double longitude_min = -5.5;
+  const double longitude_max = 8.5;
+  if (longitude < longitude_min)
+    return false;
+  if (longitude > longitude_max)
+    return false;
+
+  const double latitude_min = 42;
+  const double latitude_max = 51.5;
+  if (latitude < latitude_min)
+    return false;
+  if (latitude > latitude_max)
+    return false;
+
+  // conversion en position
+  double longPix = (longitude - longitude_min) * 30.;
+  double latPix = (latitude_max - latitude) * 40.;
+
+  double RestCol, RestLig;
+  double ColIni, LigIni;
+  RestCol = modf(longPix, &ColIni);
+  RestLig = modf(latPix, &LigIni);
+
+  double Zbd = (1.0 - RestCol) * (1.0 - RestLig) * LitGrille(ColIni, LigIni);
+  Zbd += RestCol * (1.0 - RestLig) * LitGrille(ColIni + 1, LigIni);
+  Zbd += (1.0 - RestCol) * RestLig * LitGrille(ColIni, LigIni + 1);
+  Zbd += RestCol * RestLig * LitGrille(ColIni + 1, LigIni + 1);
+  *Hwgs84 = Zbd;
+
+  return true;
+}
+/// ////////////////////////////////////////////////////////////////////
+double Raf98::LitGrille(unsigned int c, unsigned int l) const {
+  const unsigned int w = 421;
+  //    const unsigned int h=381;
+  return m_dvalues.at(c + l * w);
+}
+/// ////////////////////////////////////////////////////////////////////
+bool Raf98::Load(const std::string &sin) {
+  std::ifstream in(sin.c_str());
+  unsigned int w = 421;
+  unsigned int h = 381;
+
+  m_dvalues.reserve(w * h);
+
+  char entete[1024]; // sur 3 lignes
+  in.getline(entete, 1023);
+  in.getline(entete, 1023);
+  in.getline(entete, 1023);
+
+  char bidon[1024];
+  double val;
+  for (unsigned int i = 0; i < h; ++i) {
+    for (unsigned int j = 0; j < 52; ++j) {
+      for (unsigned int k = 0; k < 8; ++k) {
+        in >> val;
+        m_dvalues.push_back(val);
+      }
+      in.getline(bidon, 1023);
+    }
+    for (unsigned int k = 0; k < 5; ++k) {
+      in >> val;
+      m_dvalues.push_back(val);
+    }
+    in.getline(bidon, 1023);
+    if (!in.good()) {
+      m_dvalues.clear();
+      return false;
+    }
+  }
+  return in.good();
+}
+
+} // namespace Geodesie
+
+/// ////////////////////////////////////////////////////////////////////
+/// ////////////////////////////////////////////////////////////////////
+
+/// ////////////////////////////////////////////////////////////////////
+// ALGO0001
+double Geodesie::LatitueIsometrique(double latitude, double e) {
+  double li;
+  li = log(tan(M_PI_4 + latitude / 2.)) +
+       e * log((1 - e * sin(latitude)) / (1 + e * sin(latitude))) / 2;
+  return li;
+}
+
+/// ////////////////////////////////////////////////////////////////////
+// ALGO0002
+double Geodesie::LatitueIsometrique2Lat(double latitude_iso, double e,
+                                        double epsilon) {
+  double latitude_i = 2 * atan(exp(latitude_iso)) - M_PI_2;
+  double latitude_ip1 = latitude_i + epsilon * 2;
+  while (fabs(latitude_i - latitude_ip1) > epsilon) {
+    latitude_i = latitude_ip1;
+    latitude_ip1 = 2 * atan(exp(e * 0.5 * log((1 + e * sin(latitude_i)) /
+                                              (1 - e * sin(latitude_i)))) *
+                            exp(latitude_iso)) -
+                   M_PI_2;
+  }
+  return latitude_ip1;
+}
+/// ////////////////////////////////////////////////////////////////////
+void Geodesie::Geo2ProjLambert(double lambda, double phi, double n, double c,
+                               double e, double lambdac, double xs, double ys,
+                               double &X, double &Y) {
+  double lat_iso = LatitueIsometrique(phi, e);
+  X = xs + c * exp(-n * lat_iso) * sin(n * (lambda - lambdac));
+  Y = ys - c * exp(-n * lat_iso) * cos(n * (lambda - lambdac));
+}
+/// ////////////////////////////////////////////////////////////////////
+// ALGO0004
+void Geodesie::Proj2GeoLambert(double X, double Y, double n, double c, double e,
+                               double lambdac, double xs, double ys,
+                               double epsilon, double &lambda, double &phi) {
+  double X_xs = X - xs;
+  double ys_Y = ys - Y;
+  double R = sqrt(X_xs * X_xs + ys_Y * ys_Y);
+  double gamma = atan(X_xs / ys_Y);
+  lambda = lambdac + gamma / n;
+  double lat_iso = -1 / n * log(fabs(R / c));
+  phi = LatitueIsometrique2Lat(lat_iso, e, epsilon);
+}
+/// ////////////////////////////////////////////////////////////////////
+double Geodesie::ConvMerApp(double longitude) {
+  double phi0_Lambert93 = Deg2Rad(46.5);
+  double lambda0_Lambert93 = Deg2Rad(3.0);
+  double conv = -sin(phi0_Lambert93) * (longitude - lambda0_Lambert93);
+  return conv;
+}
+
+////////////////////////////////////////////////////////////////////
+void Geodesie::Geographique_2_Lambert93(const Raf98 &raf98, double lambda,
+                                        double phi, double he, Matrice in,
+                                        double &E, double &N, double &h,
+                                        Matrice &out) {
+  Matrice passage;
+  double conv = Geodesie::ConvMerApp(lambda);
+  double c_ = cos(conv);
+  double s_ = sin(conv);
+
+  passage.c0_l0 = c_;
+  passage.c0_l1 = s_;
+  passage.c0_l2 = 0.0;
+
+  passage.c1_l0 = -s_;
+  passage.c1_l1 = c_;
+  passage.c1_l2 = 0.0;
+
+  passage.c2_l0 = 0.0;
+  passage.c2_l1 = 0.0;
+  passage.c2_l2 = 1.0;
+
+  out = ProdMat(passage, in);
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  h = he - diff_h;
+
+  Geodesie::Geo2ProjLambert(lambda, phi, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93, E,
+                            N);
+}
+////////////////////////////////////////////////////////////////////////
+void Geodesie::Geographique_2_Lambert93(const Raf98 &raf98, double lambda,
+                                        double phi, double he, double &E,
+                                        double &N, double &h) {
+  Geodesie::Geo2ProjLambert(lambda, phi, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93, E,
+                            N);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  h = he - diff_h;
+}
+/**
+    Converts Lambert93 coordinates (East, North, Height) into geographical
+   coordinates in radians (Longitude = Rad2Deg(lambda), Latitude = Rad2Deg(phi),
+   Height)
+*/
+void Geodesie::Lambert93_2_Geographique(const Raf98 &raf98, double E, double N,
+                                        double h, double &lambda, double &phi,
+                                        double &he) {
+  Geodesie::Proj2GeoLambert(E, N, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93,
+                            0.0000000000000001, lambda, phi);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  he = h + diff_h;
+}
+////////////////////////////////////////////////////////////////////////
+void Geodesie::Lambert93_2_Geographique(const Raf98 &raf98, double E, double N,
+                                        double h, Matrice in, double &lambda,
+                                        double &phi, double &he, Matrice &out) {
+  Geodesie::Proj2GeoLambert(E, N, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93,
+                            0.0000000000000001, lambda, phi);
+
+  Matrice passage;
+  double conv = Geodesie::ConvMerApp(lambda);
+  double c_ = cos(conv);
+  double s_ = sin(conv);
+
+  passage.c0_l0 = c_;
+  passage.c0_l1 = -s_;
+  passage.c0_l2 = 0.0;
+
+  passage.c1_l0 = s_;
+  passage.c1_l1 = c_;
+  passage.c1_l2 = 0.0;
+
+  passage.c2_l0 = 0.0;
+  passage.c2_l1 = 0.0;
+  passage.c2_l2 = 1.0;
+
+  out = ProdMat(passage, in);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  he = h + diff_h;
+}
+
+////////////////////////////////////////////////////////////////////////
+void Geodesie::Geographique_2_ECEF(double longitude, double latitude, double he,
+                                   double &x, double &y, double &z) {
+  const double n = GRS_a / sqrt(1.0 - pow(GRS_e, 2) * pow(sin(latitude), 2));
+  x = (n + he) * cos(latitude) * cos(longitude);
+  y = (n + he) * cos(latitude) * sin(longitude);
+  z = (n * (1.0 - pow(GRS_e, 2)) + he) * sin(latitude);
+}
+
+//from https://gist.github.com/klucar/1536194
+void Geodesie::ECEF_2_Geographique(double x, double y, double z,
+                                   double &longitude, double &latitude, double &he) {
+
+  double asq=pow(GRS_a, 2);
+  double esq=pow(GRS_e, 2);
+  double b = sqrt( asq * (1-esq) );
+  double bsq = pow(b,2);
+  double ep = sqrt( (asq - bsq)/bsq);
+  double p = sqrt( pow(x,2) + pow(y,2) );
+  double th = atan2(GRS_a*z, b*p);
+
+  longitude = atan2(y,x);
+  latitude = atan2( (z + pow(ep,2)*b*pow(sin(th),3) ), (p - esq*GRS_a*pow(cos(th),3)) );
+  double N = GRS_a/( sqrt(1-esq*pow(sin(latitude),2)) );
+  double alt = p / cos(latitude) - N;
+
+  // mod longitude to 0-2pi
+  if(longitude<0) longitude +=2*M_PI;
+
+  // correction for altitude near poles left out.
+}
+
+////////////////////////////////////////////////////////////////////////
+void Geodesie::ECEF_2_ENU(double x, double y, double z, double &e, double &n,
+                          double &u, double lon0, double lat0, double he0) {
+  double slat = std::sin(lat0);
+  double clat = std::cos(lat0);
+  double slon = std::sin(lon0);
+  double clon = std::cos(lon0);
+
+  Geodesie::Matrice C;
+  C.c0_l0 = -slon;
+  C.c1_l0 = clon;
+
+  C.c0_l1 = -clon * slat;
+  C.c1_l1 = -slon * slat;
+  C.c2_l1 = clat;
+
+  C.c0_l2 = clon * clat;
+  C.c1_l2 = slon * clat;
+  C.c2_l2 = slat;
+
+  double x0, y0, z0;
+  Geographique_2_ECEF(lon0, lat0, he0, x0, y0, z0);
+
+  x -= x0;
+  y -= y0;
+  z -= z0;
+
+  C.Apply(x, y, z, e, n, u);
+}
+
+void Geodesie::ENU_2_ECEF(double e, double n,double u,
+                          double &x, double &y, double &z,
+                          double lon0, double lat0, double he0) {
+  double slat = std::sin(lat0);//phi
+  double clat = std::cos(lat0);
+  double slon = std::sin(lon0);//lambda
+  double clon = std::cos(lon0);
+
+  Geodesie::Matrice C;
+  C.c0_l0 = -slon;
+  C.c1_l0 = -clon*slat;
+  C.c2_l0 = clon*clat;
+
+  C.c0_l1 = clon;
+  C.c1_l1 = -slon * slat;
+  C.c2_l1 = slon*clat;
+
+  C.c0_l2 = 0;
+  C.c1_l2 = clat;
+  C.c2_l2 = slat;
+
+  C.Apply(e, n, u,x,y,z);
+
+  double x0, y0, z0;
+  Geographique_2_ECEF(lon0, lat0, he0, x0, y0, z0);
+
+  x += x0;
+  y += y0;
+  z += z0;
+}
Index: tags/latest/lib/FlairSensorActuator/src/groups.dox
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/groups.dox	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/groups.dox	(revision 209)
@@ -0,0 +1,14 @@
+/*! \namespace flair::sensor
+ * 
+ * \brief Sensor classes
+ */
+
+/*! \namespace flair::actuator
+ * 
+ * \brief Actuator classes
+ */
+
+/*! \namespace flair::meta
+ * 
+ * \brief High level classes
+ */
Index: tags/latest/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h	(revision 209)
@@ -0,0 +1,58 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/06/15
+//  filename:   AfroBldc_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+
+#ifndef AFROBLDC_IMPL_H
+#define AFROBLDC_IMPL_H
+
+#include <stdint.h>
+#include <Object.h>
+
+#define MAX_MOTORS 8
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+class GroupBox;
+class Layout;
+}
+namespace actuator {
+class AfroBldc;
+}
+namespace sensor {
+class BatteryMonitor;
+}
+}
+
+class AfroBldc_impl {
+public:
+  AfroBldc_impl(flair::actuator::AfroBldc *self, flair::gui::Layout *layout,
+                flair::core::I2cPort *i2cport);
+  ~AfroBldc_impl();
+  void SetMotors(float *value);
+
+private:
+  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
+                                   // this function
+  int nb_mot;
+  flair::core::I2cPort *i2cport;
+  flair::actuator::AfroBldc *self;
+};
+
+#endif // AFROBLDC_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h	(revision 209)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/09/13
+//  filename:   BlCtrlV2_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c
+//
+//
+/*********************************************************************/
+
+#ifndef BLCTRLV2_IMPL_H
+#define BLCTRLV2_IMPL_H
+
+#include <stdint.h>
+#include <Object.h>
+
+#define MAX_MOTORS 8
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+class GroupBox;
+class Layout;
+}
+namespace actuator {
+class BlCtrlV2;
+}
+namespace sensor {
+class BatteryMonitor;
+}
+}
+
+class BlCtrlV2_impl {
+public:
+  BlCtrlV2_impl(flair::actuator::BlCtrlV2 *self, flair::gui::Layout *layout,
+                flair::core::I2cPort *i2cport);
+  ~BlCtrlV2_impl();
+  void SetMotors(float *value);
+  flair::sensor::BatteryMonitor *battery;
+  flair::gui::SpinBox *poles;
+
+private:
+  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
+                                   // this function
+  void DetectMotors(void);
+  void GetCurrentSpeedAndVoltage(float &current, float &speed,
+                                 float &voltage); // I2cPort mutex must be taken
+                                                  // before calling this
+                                                  // function
+  void GetCurrentAndSpeed(
+      float &current,
+      float &speed); // I2cPort mutex must be taken before calling this function
+  flair::core::Time last_voltage_time;
+  int nb_mot;
+  flair::core::I2cPort *i2cport;
+  flair::actuator::BlCtrlV2 *self;
+};
+
+#endif // BLCTRLV2_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/Bldc_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/Bldc_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/Bldc_impl.h	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/14
+//  filename:   Bldc_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Virtual class for brushless drivers
+//
+//
+/*********************************************************************/
+
+#ifndef BLDC_IMPL_H
+#define BLDC_IMPL_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+class Layout;
+class Label;
+class DataPlot1D;
+class TabWidget;
+class PushButton;
+}
+namespace actuator {
+class Bldc;
+}
+}
+
+class Bldc_impl {
+public:
+  Bldc_impl(flair::actuator::Bldc *self, flair::gui::Layout *layout,
+            std::string name, uint8_t motors_count);
+  Bldc_impl(flair::actuator::Bldc *self, uint8_t motors_count); // simulation
+  ~Bldc_impl();
+  void UpdateFrom(const flair::core::io_data *data);
+  void LockUserInterface(void) const;
+  void UnlockUserInterface(void) const;
+  bool are_enabled;
+  float *power;
+  void UseDefaultPlot(flair::gui::TabWidget *tab);
+  uint8_t motors_count;
+  flair::gui::Layout *layout;
+
+private:
+  float *values;
+  float Sat(float value);
+  flair::actuator::Bldc *self;
+  flair::gui::DoubleSpinBox *min_value, *max_value, *test_value;
+  flair::gui::Label *flight_time;
+  flair::gui::DataPlot1D *plots;
+  flair::core::Time flight_start_time;
+  flair::gui::PushButton **button_test;
+  int time_sec;
+  bool is_running;
+  flair::core::Time test_start_time;
+  int tested_motor; //=-1 if no motor is tested
+};
+
+#endif // BLDC_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h	(revision 209)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Gx3_25_imu_impl.h
+ * \brief Classe intégrant la centrale 3dmgx3-25
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef GX3_25_IMU_IMPL_H
+#define GX3_25_IMU_IMPL_H
+
+#include "Gx3_25_imu.h"
+#include <unistd.h> //ssize_t
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+class AhrsData;
+}
+namespace gui {
+class SpinBox;
+class CheckBox;
+class PushButton;
+class Label;
+}
+}
+
+/*! \class Gx3_25_imu_impl
+*
+* \brief Classe intégrant la centrale 3dmgx3-25
+*/
+
+class Gx3_25_imu_impl {
+
+public:
+  Gx3_25_imu_impl(flair::sensor::Gx3_25_imu *self, std::string name,
+                  flair::core::SerialPort *serialport,
+                  flair::sensor::Gx3_25_imu::Command_t command,
+                  flair::gui::GroupBox *setupgroupbox);
+  ~Gx3_25_imu_impl();
+  void Run(void);
+
+private:
+  void DeviceReset(void);
+  void GetData(uint8_t *buf, ssize_t buf_size, flair::core::Time *time);
+  float Dequeue(uint8_t **buf);
+  void GyrosBias(void);
+  void SamplingSettings(void);
+  void SetBaudrate(int value);
+  bool CalcChecksum(uint8_t *buf, int size);
+  int FirmwareNumber(void);
+  void PrintModelInfo(void);
+  void RealignUpNorth(bool realign_up, bool realign_north);
+
+  void SetContinuousMode(uint8_t continuous_command);
+
+  flair::gui::GroupBox *setupgroupbox;
+  flair::gui::SpinBox *data_rate, *gyro_acc_size, *mag_size, *up_comp,
+      *north_comp;
+  flair::gui::CheckBox *coning, *disable_magn, *disable_north_comp,
+      *disable_grav_comp;
+  flair::gui::PushButton *button_bias;
+  flair::gui::Label *data_rate_label;
+
+  flair::core::SerialPort *serialport;
+  uint8_t command;
+  flair::sensor::Gx3_25_imu *self;
+  flair::core::AhrsData *ahrsData;
+};
+
+#endif // GX3_25_IMU_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnClient_impl.h
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet se connectant au serveur vrpn
+//
+//
+/*********************************************************************/
+
+#ifndef VRPNCLIENT_IMPL_H
+#define VRPNCLIENT_IMPL_H
+
+#include <string>
+#include <vector>
+#include "Vector3D.h"
+
+namespace flair {
+namespace core {
+class OneAxisRotation;
+class Quaternion;
+class Mutex;
+class SerialPort;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class Layout;
+}
+namespace sensor {
+class VrpnClient;
+class VrpnObject;
+}
+}
+
+class VrpnObject_impl;
+class vrpn_Connection;
+
+class VrpnClient_impl {
+public:
+  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
+                  std::string address);
+  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
+                  flair::core::SerialPort *serialport, uint16_t us_period);
+  ~VrpnClient_impl();
+  void AddTrackable(VrpnObject_impl *obj);    // normal
+  void AddTrackable(VrpnObject_impl *obj, uint8_t id);  // xbee
+  void RemoveTrackable(VrpnObject_impl *obj);           // normal+xbee
+  void ComputeRotations(flair::core::Vector3Df &point);
+  void ComputeRotations(flair::core::Quaternion &quat);
+  bool UseXbee(void);
+  void Run(void);
+  flair::gui::Tab *setup_tab;
+  flair::gui::TabWidget *tab;
+  vrpn_Connection *connection;
+
+private:
+  flair::sensor::VrpnClient *self;
+  flair::core::Mutex *mutex;
+  uint16_t us_period;
+  std::vector<VrpnObject_impl *> trackables;
+  typedef struct xbee_object {
+    VrpnObject_impl *vrpnobject;
+    uint8_t id;
+  } xbee_object;
+
+  std::vector<xbee_object> xbee_objects;
+  flair::gui::Tab *main_tab;
+  flair::core::OneAxisRotation *rotation_1, *rotation_2;
+  flair::core::SerialPort *serialport;
+	bool isConnected;//only for ip connection, not for xbee
+};
+
+#endif // VRPNCLIENT_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 209)
@@ -0,0 +1,71 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/03
+//  filename:   VrpnObject_impl.h
+//
+//  author:     César Richard, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet vrpn
+//
+//
+/*********************************************************************/
+
+#ifndef VRPNOBJECT_IMPL_H
+#define VRPNOBJECT_IMPL_H
+
+#include <IODevice.h>
+#include <string>
+#include <stdint.h>
+#include <vrpn_Tracker.h>
+#include "Quaternion.h"
+#include "Vector3D.h"
+
+namespace flair {
+	namespace core {
+		class cvmatrix;
+	}
+	namespace gui {
+		class TabWidget;
+		class Tab;
+		class DataPlot1D;
+	}
+	namespace sensor {
+		class VrpnClient;
+		class VrpnObject;
+	}
+}
+
+class VrpnObject_impl {
+  friend class VrpnClient_impl;
+
+public:
+  VrpnObject_impl(flair::sensor::VrpnObject *self,
+                  std::string name,
+                  int id, const flair::gui::TabWidget *tab);
+  ~VrpnObject_impl(void);
+
+  void GetQuaternion(flair::core::Quaternion &quaternion);
+  void GetPosition(flair::core::Vector3Df &point);
+  bool IsTracked(unsigned int timeout_ms);
+
+  flair::gui::Tab *plot_tab;
+  flair::gui::DataPlot1D *x_plot;
+  flair::gui::DataPlot1D *y_plot;
+  flair::gui::DataPlot1D *z_plot;
+  flair::core::cvmatrix *output, *state;
+
+  static void VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
+
+private:
+  flair::sensor::VrpnObject *self;
+  const flair::sensor::VrpnClient *parent;
+  vrpn_Tracker_Remote *tracker;
+  void Update(void);
+};
+
+#endif // VRPNOBJECT_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/XBldc_impl.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/XBldc_impl.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/XBldc_impl.h	(revision 209)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/13
+//  filename:   XBldc_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant les moteurs i2c Xufo
+//
+//
+/*********************************************************************/
+
+#ifndef XBLDC_IMPL_H
+#define XBLDC_IMPL_H
+
+#include <IODevice.h>
+#include <stdint.h>
+
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace actuator {
+class XBldc;
+}
+}
+
+class XBldc_impl {
+
+public:
+  XBldc_impl(flair::actuator::XBldc *self, flair::core::I2cPort *i2cport);
+  ~XBldc_impl();
+  void UpdateFrom(flair::core::io_data *data);
+  void SetMotors(float *value);
+
+private:
+  uint8_t Sat(float value, uint8_t min, uint8_t max);
+  // void StartTest(uint8_t moteur);
+  void ChangeDirection(uint8_t moteur);
+  void ChangeAdress(uint8_t old_add, uint8_t new_add);
+  flair::actuator::XBldc *self;
+  flair::core::I2cPort *i2cport;
+};
+
+#endif // XBLDC_IMPL_H
Index: tags/latest/lib/FlairSensorActuator/src/unexported/geodesie.h
===================================================================
--- tags/latest/lib/FlairSensorActuator/src/unexported/geodesie.h	(revision 209)
+++ tags/latest/lib/FlairSensorActuator/src/unexported/geodesie.h	(revision 209)
@@ -0,0 +1,189 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef GEODESIE_H
+#define GEODESIE_H
+
+#include <cmath>
+#include <iostream>
+#include <vector>
+
+namespace Geodesie {
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923
+#endif
+#ifndef M_PI_4
+#define M_PI_4 0.78539816339744830962
+#endif
+
+////////////////////////////////////////////////////////////////////////
+struct Matrice {
+  Matrice(const Matrice &A);
+  Matrice();
+  void Apply(double v0, double v1, double v2, double &Mv0, double &Mv1,
+             double &Mv2);
+  double c0_l0;
+  double c1_l0;
+  double c2_l0;
+  double c0_l1;
+  double c1_l1;
+  double c2_l1;
+  double c0_l2;
+  double c1_l2;
+  double c2_l2;
+}; // class
+
+Matrice TransMat(const Matrice A);
+
+Matrice ProdMat(const Matrice A, const Matrice B);
+void Write(const Matrice A, std::ostream &out);
+
+////////////////////////////////////////////////////////////////////////
+class Raf98 {
+private:
+  std::vector<double> m_dvalues;
+  double LitGrille(unsigned int c, unsigned int l) const;
+
+public:
+  ~Raf98();
+  Raf98() {}
+  bool Load(const std::string &s);
+  bool Interpol(double longitude /*deg*/, double latitude /*deg*/,
+                double *Hwgs84) const;
+}; // class
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+inline double Deg2Rad(double deg) { return deg * M_PI / 180.0; }
+inline double Rad2Deg(double rad) { return rad * 180.0 / M_PI; }
+////////////////////////////////////////////////////////////////////////
+
+const double a_Lambert93 = 6378137;
+const double f_Lambert93 = 1 / 298.257222101;
+const double e_Lambert93 = sqrt(f_Lambert93 * (2 - f_Lambert93));
+const double lambda0_Lambert93 = Deg2Rad(3.0); // degres
+const double phi0_Lambert93 = Deg2Rad(46.5);
+const double phi1_Lambert93 = Deg2Rad(44.0);
+const double phi2_Lambert93 = Deg2Rad(49.0); // degres
+const double X0_Lambert93 = 700000;          //
+const double Y0_Lambert93 = 6600000;         //
+const double n_Lambert93 = 0.7256077650;
+const double c_Lambert93 = 11754255.426;
+const double xs_Lambert93 = 700000;
+const double ys_Lambert93 = 12655612.050;
+
+const double GRS_a = 6378137;
+const double GRS_f = 1 / 298.257222101;
+const double GRS_b = GRS_a * (1 - GRS_f);
+const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b, 2)) / pow(GRS_a, 2));
+
+////////////////////////////////////////////////////////////////////////
+void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
+                              double he, Matrice in, double &E, double &N,
+                              double &h, Matrice &out);
+void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
+                              double he, double &E, double &N, double &h);
+void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
+                              double &lambda, double &phi, double &he);
+void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
+                              Matrice in, double &lambda, double &phi,
+                              double &he, Matrice &out);
+/** Convert from geographique to ECEF.
+ * @param[in] longitude Longitude in radian.
+ * @param[in] latitude Latitude in radian.
+ * @param[in] he Height in meter.
+ */
+void Geographique_2_ECEF(double longitude, double latitude, double he,
+                         double &x, double &y, double &z);
+
+/** Convert from ECEF to geographique.
+ */
+void ECEF_2_Geographique(double x, double y, double z,
+                          double &longitude, double &latitude, double &he);
+
+/** Convert from ECEF to ENU.
+ * @param[in] lon0 Longitude of the origin in radian.
+ * @param[in] lat0 Latitude of the origin in radian.
+ * @param[in] he0 Height of the origin in radian.
+ */
+void ECEF_2_ENU(double x, double y, double z, double &e, double &n, double &u,
+                double lon0, double lat0, double he0);
+
+/** Convert from ECEF to ENU.
+ * @param[in] lon0 Longitude of the origin in radian.
+ * @param[in] lat0 Latitude of the origin in radian.
+ * @param[in] he0 Height of the origin in radian.
+ */
+void ENU_2_ECEF(double e, double n, double u,double &x, double &y, double &z,
+                double lon0, double lat0, double he0);
+
+////////////////////////////////////////////////////////////////////////
+
+// ALGO0001
+double LatitueIsometrique(double latitude, double e);
+// ALGO0002
+double LatitueIsometrique2Lat(double latitude_iso, double e, double epsilon);
+
+// ALGO0003
+void Geo2ProjLambert(double lambda, double phi, double n, double c, double e,
+                     double lambdac, double xs, double ys, double &X,
+                     double &Y);
+// ALGO0004
+void Proj2GeoLambert(double X, double Y, double n, double c, double e,
+                     double lambdac, double xs, double ys, double epsilon,
+                     double &lambda, double &phi);
+
+double ConvMerApp(double longitude);
+
+/**
+Converts Cartesian (x, y) coordinates to polar coordinates (r, theta)
+*/
+template <typename _T1, typename _T2>
+void cartesianToPolar(const _T1 x, const _T1 y, _T2 &r, _T2 &theta) {
+  r = std::sqrt(x * x + y * y);
+  theta = std::atan2(x, y);
+}
+
+/**
+Converts polar coordinates (r, theta) to Cartesian (x, y) coordinates
+*/
+template <typename _T1, typename _T2>
+void polarToCartesian(const _T1 r, const _T1 theta, _T2 &x, _T2 &y) {
+  x = r * std::cos(theta);
+  y = r * std::sin(theta);
+}
+
+/**
+Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta,
+phi)
+Angles expressed in radians.
+*/
+template <typename _T1, typename _T2>
+void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 &r,
+                          _T2 &theta, _T2 &phi) {
+  r = std::sqrt(x * x + y * y + z * z);
+  theta = std::acos(z / r);
+  phi = std::atan2(y, x);
+}
+
+/**
+Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z)
+coordinates.
+Angles expressed in radians.
+*/
+template <typename _T1, typename _T2>
+void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 &x,
+                          _T2 &y, _T2 &z) {
+  x = r * std::sin(theta) * std::cos(phi);
+  y = r * std::sin(theta) * std::sin(phi);
+  z = r * std::cos(theta);
+}
+
+} // namespace Geodesie
+
+#endif // GEODESIE_H
Index: tags/latest/lib/FlairSimulator/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairSimulator/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairSimulator/CMakeLists.txt	(revision 209)
@@ -0,0 +1,45 @@
+PROJECT(FlairSimulator)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+INCLUDE_DIRECTORIES(
+      	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
+	${CMAKE_CURRENT_SOURCE_DIR}/../FlairSensorActuator/src
+	${CMAKE_SYSROOT}/usr/include/vrpn
+	${CMAKE_SYSROOT}/usr/include/opencv
+	${CMAKE_SYSROOT}/usr/include/irrlicht
+)
+
+FILE(GLOB SIMU_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/no_gl)
+add_dependencies(FlairSimulator_nogl compile_info)
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/gl)
+add_dependencies(FlairSimulator_gl compile_info)
+endif()
Index: tags/latest/lib/FlairSimulator/gl/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairSimulator/gl/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairSimulator/gl/CMakeLists.txt	(revision 209)
@@ -0,0 +1,13 @@
+PROJECT(FlairSimulator_gl)
+
+ADD_DEFINITIONS(-D_GNU_SOURCE -D_REENTRANT -DGL)
+
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SIMU_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
Index: tags/latest/lib/FlairSimulator/no_gl/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairSimulator/no_gl/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairSimulator/no_gl/CMakeLists.txt	(revision 209)
@@ -0,0 +1,15 @@
+PROJECT(FlairSimulator_nogl)
+
+ADD_DEFINITIONS(-D_GNU_SOURCE -D_REENTRANT)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SIMU_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../src/*.h")
+INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/FlairSimulator)
Index: tags/latest/lib/FlairSimulator/src/Blade.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Blade.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Blade.cpp	(revision 209)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/22
+//  filename:   Blade.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une helice
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Blade.h"
+#include "MeshSceneNode.h"
+#include "Model.h"
+#include "Gui.h"
+#include "Simulator.h"
+#include <IGeometryCreator.h>
+#include <ISceneManager.h>
+#include <IFileSystem.h>
+#include <IVideoDriver.h>
+
+using namespace irr;
+using namespace irr::video;
+using namespace irr::scene;
+using namespace irr::core;
+using namespace irr::io;
+using namespace flair::core;
+
+namespace flair {
+namespace simulator {
+
+Blade::Blade(Model *parent, const vector3df &position, bool inverted, s32 id)
+    : ISceneNode(parent->getSceneNode(), getGui()->getSceneManager(), id,
+                 position) {
+  ISceneManager *mgr = getGui()->getSceneManager();
+
+  const IGeometryCreator *geo;
+  geo = mgr->getGeometryCreator();
+  pale = geo->createCubeMesh(vector3df(63.5, 0.5, 5));
+
+  float angle;
+  if (inverted == false) {
+    angle = 20;
+  } else {
+    angle = -20;
+  }
+
+  ITexture *texture = getGui()->getTexture("carbone.jpg");
+  pale_1 = new MeshSceneNode(parent, pale, vector3df(-30, 0, 0),
+                             vector3df(-angle + 90, 0, 0), texture);
+  pale_1->setParent(this);
+  pale_2 = new MeshSceneNode(parent, pale, vector3df(30, 0, 0),
+                             vector3df(angle + 90, 0, 0), texture);
+  pale_2->setParent(this);
+
+  anim = mgr->createRotationAnimator(vector3df(0.f, 0.f, 0.f));
+  addAnimator(anim);
+}
+
+void Blade::OnRegisterSceneNode() {
+  if (IsVisible)
+    SceneManager->registerNodeForRendering(this);
+
+  ISceneNode::OnRegisterSceneNode();
+}
+
+void Blade::SetRotationSpeed(float value) {
+  IAttributes *attribs =
+      getSceneManager()->getFileSystem()->createEmptyAttributes();
+
+  attribs->setAttribute("Type", "rotation");
+  attribs->setAttribute("Rotation", vector3df(0.f, 0.f, value));
+  anim->deserializeAttributes(attribs);
+
+  attribs->drop();
+}
+
+void Blade::render() {
+  IVideoDriver *driver = SceneManager->getVideoDriver();
+  driver->setTransform(ETS_WORLD, AbsoluteTransformation);
+}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Blade.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Blade.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Blade.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/22
+//  filename:   Blade.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une Blade
+//
+/*********************************************************************/
+
+#ifndef BLADE_H
+#define BLADE_H
+
+#include <ISceneNode.h>
+
+namespace irr {
+namespace scene {
+class IMesh;
+}
+}
+
+namespace flair {
+namespace simulator {
+class MeshSceneNode;
+class Model;
+
+class Blade : public irr::scene::ISceneNode {
+public:
+  Blade(Model *parent,
+        const irr::core::vector3df &position = irr::core::vector3df(0, 0, 0),
+        bool inverted = false, irr::s32 id = -1);
+  virtual void OnRegisterSceneNode(void);
+  virtual void render(void);
+  virtual const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const {
+    return Box;
+  }
+  void SetRotationSpeed(float value);
+
+private:
+  irr::scene::IMesh *pale;
+  irr::core::aabbox3d<irr::f32> Box;
+  MeshSceneNode *pale_1, *pale_2;
+  irr::scene::ISceneNodeAnimator *anim;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // BLADE_H
Index: tags/latest/lib/FlairSimulator/src/Castle.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Castle.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Castle.cpp	(revision 209)
@@ -0,0 +1,42 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Castle.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant une map chateau
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Castle.h"
+#include <IrrlichtDevice.h>
+#include <IFileSystem.h>
+
+using namespace irr::core;
+using namespace flair::core;
+
+namespace flair {
+namespace simulator {
+
+Castle::Castle(int app_width, int app_height,
+               int scene_width, int scene_height, std::string media_path)
+    : Gui("Castle", app_width, app_height, scene_width, scene_height,
+          media_path) {
+  // carte
+  std::string file = media_path + "/map-20kdm2.pk3";
+  getDevice()->getFileSystem()->addFileArchive(file.c_str());
+  setMesh("20kdm2.bsp", vector3df(-1400, -65, -1349));
+}
+
+Castle::~Castle() {}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Castle.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Castle.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Castle.h	(revision 209)
@@ -0,0 +1,34 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Castle.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant une map chateau
+//
+/*********************************************************************/
+
+#ifndef CASTLE_H
+#define CASTLE_H
+
+#include <Gui.h>
+namespace flair {
+namespace simulator {
+class Castle : public Gui {
+public:
+  Castle(int app_width,
+         int app_height, int scene_width, int scene_height,
+         std::string media_path);
+  ~Castle();
+
+private:
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // CASTLE_H
Index: tags/latest/lib/FlairSimulator/src/DiscreteTimeVariable.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/DiscreteTimeVariable.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/DiscreteTimeVariable.h	(revision 209)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/03/30
+//  filename:   DiscreteTimeVariable.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    base class for discrete time variable
+//
+/*********************************************************************/
+
+#ifndef DISCRETETIMEVARIABLE_H
+#define DISCRETETIMEVARIABLE_H
+
+#include <stdlib.h>
+
+namespace flair {
+namespace simulator {
+template <typename T, size_t size> class DiscreteTimeVariable {
+public:
+  DiscreteTimeVariable(){};
+  ~DiscreteTimeVariable(){};
+  T &operator[](ssize_t idx) {
+    if (idx > 0)
+      idx = 0;
+    if (idx < (ssize_t)(-size + 1))
+      idx = -size + 1;
+    return array[-idx];
+  }
+  const T &operator[](ssize_t idx) const {
+    return const_cast<T &>(*this)[idx];
+  };
+  void Update(void) {
+    for (int i = size - 1; i > 0; i--) {
+      array[i] = array[i - 1];
+    }
+  }
+
+private:
+  T array[size];
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // DISCRETETIMEVARIABLE_H
Index: tags/latest/lib/FlairSimulator/src/FixedCamera.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/FixedCamera.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/FixedCamera.cpp	(revision 209)
@@ -0,0 +1,112 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/01
+//  filename:   FixedCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class for a fixed camera in the gui
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "FixedCamera.h"
+#include "Simulator.h"
+#include "Model.h"
+#include "Model_impl.h"
+#include "Gui.h"
+#include <ICursorControl.h>
+#include <ICameraSceneNode.h>
+#include <IrrlichtDevice.h>
+#include <ISceneManager.h>
+#include <Euler.h>
+
+using namespace irr;
+using namespace gui;
+using namespace core;
+using namespace scene;
+
+namespace flair {
+namespace simulator {
+
+FixedCamera::FixedCamera(std::string name,core::Vector3Df position,core::Vector3Df lookat,float inRotateSpeed,float inZoomSpeed):VisualizationCamera(name)  {
+  Rotating = false;
+  rotateSpeed=inRotateSpeed;
+  zoomSpeed=inZoomSpeed;
+
+  camera->bindTargetAndRotation(true);
+  camera->setPosition(vector3df(ToIrrlichtCoordinates(position)));
+  camera->setTarget(vector3df(ToIrrlichtCoordinates(lookat)));
+
+  fov=camera->getFOV();
+}
+
+FixedCamera::~FixedCamera() {}
+
+void FixedCamera::animateNode(ISceneNode *node, u32 timeMs) {
+  ICameraSceneNode *camera = static_cast<ICameraSceneNode *>(node);
+
+  if (LMouseKey == true) {
+    if (!Rotating) {
+      RotateStart = MousePos;
+      Rotating = true;
+      target = (camera->getTarget() - camera->getAbsolutePosition());
+    } else {
+      float nRotY = (RotateStart.Y - MousePos.Y) * rotateSpeed;
+      float nRotZ = -(RotateStart.X - MousePos.X) * rotateSpeed;
+
+      //normal between target and up vector
+      cameraAxeY=target.crossProduct(vector3df(0,0,1));
+      cameraAxeY.normalize();
+
+      //rotation around z axis
+      irr::core::quaternion q1(target.X,target.Y,target.Z,0);
+      irr::core::quaternion q2;
+      q2.fromAngleAxis(nRotZ,vector3df(0,0,1));
+      irr::core::quaternion q3=q2*q1;
+      q2.makeInverse();
+      q3=q3*q2;
+
+      //rotation around cameraAxeY
+      q1.set(q3.X,q3.Y,q3.Z,0);
+      q2.fromAngleAxis(nRotY,cameraAxeY);
+      q3=q2*q1;
+      q2.makeInverse();
+      q3=q3*q2;
+
+      //check angle
+      vector3df newTarget(q3.X,q3.Y,q3.Z);
+      float angle=acos(newTarget.dotProduct(vector3df(0,0,1))/newTarget.getLength());
+      vector3df cross = newTarget.crossProduct(vector3df(0,0,1));
+      if (cross.dotProduct(cameraAxeY) > 0) {
+        newTarget += camera->getAbsolutePosition();
+        camera->setTarget(newTarget);
+      }
+    }
+  } else if (Rotating) {
+    Rotating = false;
+  }
+
+  //handle zoom
+  float newFov=fov+currentZoom*zoomSpeed;
+  if(newFov>fov) {
+    newFov=fov;
+    currentZoom=0;
+  }
+  if(newFov<0) {
+    newFov=zoomSpeed;
+    currentZoom=1-fov/zoomSpeed;
+  }
+  camera->setFOV(newFov);
+}
+
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/FixedCamera.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/FixedCamera.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/FixedCamera.h	(revision 209)
@@ -0,0 +1,45 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/01
+//  filename:   FixedCamera.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    cclass for a fixed camera in the gui
+//
+/*********************************************************************/
+
+#ifndef FIXEDCAMERA_H
+#define FIXEDCAMERA_H
+
+#include "VisualizationCamera.h"
+#include <Vector3D.h>
+
+namespace flair {
+namespace simulator {
+
+class FixedCamera : public VisualizationCamera {
+public:
+  FixedCamera(std::string name,core::Vector3Df position,core::Vector3Df lookat=core::Vector3Df(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f);
+  ~FixedCamera();
+
+  void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
+
+private:
+  irr::core::position2df RotateStart;
+  bool Rotating;
+  float rotateSpeed;
+  float zoomSpeed;
+  float fov;
+  irr::core::vector3df target,cameraAxeY;
+};
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // FIXEDCAMERA_H
Index: tags/latest/lib/FlairSimulator/src/FollowMeCamera.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/FollowMeCamera.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/FollowMeCamera.cpp	(revision 209)
@@ -0,0 +1,111 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/21
+//  filename:   FollowMeCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une animation poursuite pour camera
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "FollowMeCamera.h"
+#include "Simulator.h"
+#include "Model.h"
+#include "Model_impl.h"
+#include "Gui.h"
+#include <ICursorControl.h>
+#include <ICameraSceneNode.h>
+#include <IrrlichtDevice.h>
+#include <ISceneManager.h>
+
+using namespace irr;
+using namespace gui;
+using namespace core;
+using namespace scene;
+
+namespace flair {
+namespace simulator {
+
+FollowMeCamera::FollowMeCamera(const ISceneNode *parent, std::string name,float inRotateSpeed,
+                             float inZoomSpeed):VisualizationCamera(name)  {
+  this->parent = parent;
+  rotateSpeed=inRotateSpeed;
+  zoomSpeed=inZoomSpeed;
+  RotY = 20;
+  RotZ = 0;
+  Rotating = false;
+}
+
+FollowMeCamera::~FollowMeCamera() {}
+
+void FollowMeCamera::setPositionOffset(vector3df newpos) {
+  pos_offset = ToIrrlichtCoordinates(newpos);
+}
+
+void FollowMeCamera::setTargetOffset(vector3df newpos) {
+  target_offset = ToIrrlichtCoordinates(newpos);
+}
+
+float FollowMeCamera::sat(float value) {
+  if (value > 89)
+    value = 89;
+  if (value < -89)
+    value = -89;
+  return value;
+}
+
+void FollowMeCamera::animateNode(ISceneNode *node, u32 timeMs) {
+
+  float nRotY = RotY;
+  float nRotZ = RotZ;
+
+  if (LMouseKey == true) {
+    if (!Rotating) {
+      RotateStart = MousePos;
+      Rotating = true;
+      nRotY = RotY;
+      nRotZ = RotZ;
+    } else {
+      nRotY += (RotateStart.Y - MousePos.Y) * rotateSpeed;
+      nRotZ += (RotateStart.X - MousePos.X) * rotateSpeed;
+      nRotY = sat(nRotY);
+    }
+  } else if (Rotating) {
+    RotY += (RotateStart.Y - MousePos.Y) * rotateSpeed;
+    RotZ += (RotateStart.X - MousePos.X) * rotateSpeed;
+    RotY = sat(RotY);
+    nRotY = RotY;
+    nRotZ = RotZ;
+    Rotating = false;
+  }
+
+  float newCurrentZoom= 100+currentZoom * zoomSpeed;
+  if (newCurrentZoom <= 0) {
+    newCurrentZoom =zoomSpeed;
+    currentZoom =1-100/zoomSpeed;
+  }
+
+  vector3df pos;
+  pos.X = -newCurrentZoom;
+  pos.Y = 0;
+  pos.Z = 0;
+
+  pos.rotateXZBy(-nRotY);
+  pos.rotateXYBy(getSimulator()->Yaw() + nRotZ + parent->getRotation().Z);
+
+  camera->setPosition(parent->getPosition() + pos + pos_offset);
+  camera->setTarget(parent->getPosition() + target_offset);
+}
+
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/GenericObject.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/GenericObject.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/GenericObject.cpp	(revision 209)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   GenericObject.cpp
+//
+//  author:     Cesar Richard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#ifdef GL
+#include "GenericObject.h"
+#include "Simulator.h"
+#include "Simulator_impl.h"
+#include "Gui.h"
+
+#include "Quaternion.h"
+#include "Euler.h"
+#include <ISceneManager.h>
+#include <IMeshSceneNode.h>
+
+using namespace irr;
+using namespace video;
+using namespace scene;
+using namespace core;
+
+using namespace flair::core;
+using namespace flair::simulator;
+
+namespace flair {
+namespace simulator {
+
+GenericObject::GenericObject(IMesh *mesh)
+{
+	meshSceneNode=getGui()->getSceneManager()->addMeshSceneNode(mesh);
+	
+  selector = getGui()->getSceneManager()->createTriangleSelector(mesh, meshSceneNode);
+  meshSceneNode->setTriangleSelector(selector);
+	
+  meshSceneNode->setMaterialFlag(EMF_LIGHTING, false);
+
+  getSimulator()->pimpl_->objects.push_back(this);
+}
+
+GenericObject::~GenericObject() {}
+
+ITriangleSelector *GenericObject::TriangleSelector(void) { return selector; }
+
+void GenericObject::setScale(float value) {
+  meshSceneNode->setScale(vector3df(value, value, value));
+}
+
+void GenericObject::setScale(const vector3df& scale) { 
+	meshSceneNode->setScale(scale);
+}
+
+void GenericObject::setPosition(const vector3df& pos) {
+  meshSceneNode->setPosition(ToIrrlichtCoordinates(pos));
+}
+
+void GenericObject::setRotation(const vector3df& rotation) {
+  Euler eulerA(rotation.X, rotation.Y, rotation.Z);
+  Euler eulerB;
+  Quaternion quatA, quatB;
+  eulerA.ToQuaternion(quatA);
+  quatB = ToIrrlichtOrientation(quatA);
+  quatB.ToEuler(eulerB);
+
+  meshSceneNode->setRotation(Euler::ToDegree(1) *
+                          vector3df(eulerB.roll, eulerB.pitch, eulerB.yaw));
+}
+
+} // end namespace simulator
+} // end namespace flair
+#endif
Index: tags/latest/lib/FlairSimulator/src/Gui.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Gui.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Gui.cpp	(revision 209)
@@ -0,0 +1,179 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Gui.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une Gui
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Gui.h"
+#include "Gui_impl.h"
+#include "Simulator.h"
+#include "Model.h"
+#include <IMeshSceneNode.h>
+#include <IVideoDriver.h>
+#include <ISceneManager.h>
+#include <algorithm>
+#include <GL/gl.h>
+#include "compile_info.h"
+
+//todo: put it on seprate file, but not possible with static lib?
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairSimulator");
+}
+
+using namespace irr;
+using namespace irr::video;
+using namespace irr::core;
+using namespace irr::scene;
+using namespace irr::gui;
+using namespace flair::core;
+
+namespace {
+flair::simulator::Gui *gui_ = NULL;
+std::vector<std::string> extensions;
+bool getGlInfo();
+}
+
+namespace flair {
+namespace simulator {
+
+Gui *getGui(void) { return gui_; }
+
+bool noGui(void) {
+  if (gui_ == NULL) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+// getGlinfo, code from Song Ho Ahn (song.ahn@gmail.com)
+bool getGlInfo() {
+  char *str = 0;
+  char *tok = 0;
+
+  // get all extensions as a string
+  str = (char *)glGetString(GL_EXTENSIONS);
+
+  // split extensions
+  if (str) {
+    tok = strtok((char *)str, " ");
+    while (tok) {
+      extensions.push_back(tok); // put a extension into struct
+      tok = strtok(0, " ");      // next token
+    }
+  } else {
+    printf("cannot get gl extensions\n");
+  }
+
+  // sort extension by alphabetical order
+  std::sort(extensions.begin(), extensions.end());
+}
+
+// isGlExtensionSupported, code from Song Ho Ahn (song.ahn@gmail.com)
+bool isGlExtensionSupported(const std::string &ext) {
+  if (extensions.size() == 0)
+    getGlInfo();
+
+  // search corresponding extension
+  std::vector<std::string>::const_iterator iter = extensions.begin();
+  std::vector<std::string>::const_iterator endIter = extensions.end();
+
+  while (iter != endIter) {
+    if (ext == *iter)
+      return true;
+    else
+      ++iter;
+  }
+  return false;
+}
+
+float ToIrrlichtScale(float value) { return value * 100.; }
+
+float ToSimulatorScale(float value) { return value / 100.; }
+
+vector3df ToIrrlichtCoordinates(vector3df vect) {
+  return ToIrrlichtScale(1) * vector3df(vect.X, vect.Y, -vect.Z);
+}
+
+template<typename T> vector3df ToIrrlichtCoordinates(Vector3D<T> vect) {
+  return ToIrrlichtScale(1) * vector3df(vect.x, vect.y, -vect.z);
+}
+
+Vector3Df ToSimulatorCoordinates(vector3df vect) {
+  return ToSimulatorScale(1) * Vector3Df(vect.X, vect.Y, -vect.Z);
+}
+
+Quaternion ToIrrlichtOrientation(Quaternion quat) {
+  /* original code
+  Euler euler;
+  quat.ToEuler(euler);
+  matrix4 m;
+  m.setRotationRadians(vector3df(0, 0, euler.yaw));
+  matrix4 n;
+  n.setRotationRadians(vector3df(0, -euler.pitch,0));
+  m *= n;
+  n.setRotationRadians(vector3df(-euler.roll, 0, 0));
+  m *= n;
+  */
+  // seems to be equivalent to:
+  return Quaternion(quat.q0, -quat.q1, -quat.q2, quat.q3);
+}
+
+
+template irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<double>);
+template irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<float>);
+
+Gui::Gui(std::string name, int app_width,
+         int app_height, int scene_width, int scene_height,
+         std::string media_path, E_DRIVER_TYPE driver_type)
+    : Object(getSimulator(), name, "Gui") {
+  if (gui_ != NULL)
+    Err("Gui should be instanced only one time\n");
+  pimpl_ = new Gui_impl(this, app_width, app_height, scene_width, scene_height,
+                        media_path, driver_type);
+  gui_ = this;
+}
+
+Gui::~Gui() { delete pimpl_; }
+
+float Gui::getAspectRatio(void) const {
+  return (float)pimpl_->scene_width / (float)pimpl_->scene_height;
+}
+
+ISceneManager *Gui::getSceneManager(void) const { return pimpl_->smgr; }
+
+void Gui::setMesh(std::string file, vector3df position, vector3df rotation,
+                  vector3df scale) {
+  pimpl_->setMesh(file, position, rotation, scale);
+}
+
+vector3df Gui::getRotation(void) const { return pimpl_->node->getRotation(); }
+
+IrrlichtDevice *Gui::getDevice(void) const { return pimpl_->device; }
+
+ITexture *Gui::getTexture(std::string filename) const {
+  filename = pimpl_->media_path + "/" + filename;
+  return pimpl_->driver->getTexture(filename.c_str());
+}
+
+IAnimatedMesh *Gui::getMesh(std::string filename) const {
+  filename = pimpl_->media_path + "/" + filename;
+  return pimpl_->smgr->getMesh(filename.c_str());
+}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Gui.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Gui.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Gui.h	(revision 209)
@@ -0,0 +1,153 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Gui.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une Gui
+//
+/*********************************************************************/
+
+#ifndef GUI_H
+#define GUI_H
+
+#include <Object.h>
+#include <Vector3D.h>
+#include <EDriverTypes.h>
+#include <vector3d.h>
+
+namespace irr {
+class IrrlichtDevice;
+namespace video {
+class ITexture;
+}
+namespace scene {
+class IAnimatedMesh;
+class ISceneManager;
+}
+}
+
+namespace flair {
+namespace core {
+class Object;
+class Euler;
+class Quaternion;
+}
+}
+
+class Gui_impl;
+class Simulator_impl;
+class Model_impl;
+
+namespace flair {
+namespace simulator {
+
+class Gui: public core::Object {
+  friend class ::Simulator_impl;
+  friend class VisualizationCamera;
+
+public:
+  Gui(std::string name, int app_width, int app_height,
+      int scene_width, int scene_height, std::string media_path,
+      irr::video::E_DRIVER_TYPE driver_type = irr::video::EDT_OPENGL);
+  ~Gui();
+  irr::core::vector3df getRotation(void) const;
+  irr::video::ITexture *getTexture(std::string filename) const;
+  irr::scene::IAnimatedMesh *getMesh(std::string filename) const;
+  irr::scene::ISceneManager *getSceneManager(void) const;
+  irr::IrrlichtDevice *getDevice(void) const;
+  float getAspectRatio(void) const;
+
+protected:
+  void setMesh(std::string file,
+               irr::core::vector3df position = irr::core::vector3df(0, 0, 0),
+               irr::core::vector3df rotation = irr::core::vector3df(0, 0, 0),
+               irr::core::vector3df scale = irr::core::vector3df(1, 1, 1));
+
+private:
+  Gui_impl *pimpl_;
+};
+
+/*!
+* \brief get Gui
+*
+* \return the Gui
+*/
+Gui *getGui(void);
+
+bool noGui(void);
+
+bool isGlExtensionSupported(
+    const std::string &ext); // check if a extension is supported
+
+/*!
+* \brief Convert to irrlicht scale
+*
+* \param value value in simulator scale
+*
+* \return value in irrlicht scale
+*/
+float ToIrrlichtScale(float value);
+
+/*!
+* \brief Convert to simulator scale
+*
+* \param value value in irrlicht scale
+*
+* \return value in simulator scale
+*/
+float ToSimulatorScale(float value);
+
+/*!
+* \brief Convert to irrlicht coordinates
+*
+* irrlicht is left handed and as a different scale
+*
+* \param vect vector in simulator coordinates
+*
+* \return vector in irrlicht coordinates
+*/
+irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df vect);
+
+/*!
+* \brief Convert to irrlicht coordinates
+*
+* irrlicht is left handed and as a different scale
+*
+* \param vect vector in simulator coordinates
+*
+* \return vector in irrlicht coordinates
+*/
+template<typename T>  irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<T> vect);
+
+/*!
+* \brief Convert to simulator coordinates
+*
+* irrlicht is left handed and as a different scale
+*
+* \param vect vector in irrlicht coordinates
+*
+* \return vector in simulator coordinates
+*/
+core::Vector3Df ToSimulatorCoordinates(irr::core::vector3df vect);
+
+/*!
+* \brief Convert to irrlicht orientation
+*
+* irrlicht is left handed
+*
+* \param quat quaternion in simulator frame
+*
+* \return quaternion in irrlicht frame
+*/
+core::Quaternion ToIrrlichtOrientation(core::Quaternion quat);
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GUI_H
Index: tags/latest/lib/FlairSimulator/src/Gui_impl.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Gui_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Gui_impl.cpp	(revision 209)
@@ -0,0 +1,393 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Gui.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une Gui
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Gui_impl.h"
+#include "Gui.h"
+#include "Simulator.h"
+#include "GenericObject.h"
+#include "Model.h"
+#include "Model_impl.h"
+#include "VisualizationCamera.h"
+#include "FollowMeCamera.h"
+#include <Object.h>
+#include <Euler.h>
+#include <irrlicht.h>
+#include <unistd.h>
+#include <sstream>
+
+using namespace irr;
+using namespace irr::video;
+using namespace irr::core;
+using namespace irr::scene;
+using namespace irr::gui;
+using namespace flair::core;
+using namespace flair::simulator;
+
+class MyEventReceiver : public IEventReceiver {
+public:
+  // This is the one method that we have to implement
+  bool OnEvent(const SEvent &event) {
+    // Remember whether each key is down or up
+    if (event.EventType == EET_KEY_INPUT_EVENT)
+      KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
+
+    if (model)
+      return model->OnEvent(event);
+
+    return false;
+  }
+
+  // This is used to check whether a key is being held down
+  bool IsKeyDown(EKEY_CODE keyCode) {
+    if (KeyIsDown[keyCode] == true) {
+      KeyIsDown[keyCode] = false;
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  MyEventReceiver(void) {
+    model = NULL;
+    for (u32 i = 0; i < KEY_KEY_CODES_COUNT; ++i)
+      KeyIsDown[i] = false;
+  }
+  void SetModel(Model *model) { this->model = model; }
+
+private:
+  // We use this array to store the current state of each key
+  bool KeyIsDown[KEY_KEY_CODES_COUNT];
+  Model *model;
+};
+
+Gui_impl::Gui_impl(Gui *self, int app_width, int app_height, int scene_width,
+                   int scene_height, std::string media_path,
+                   E_DRIVER_TYPE driver_type) {
+  this->self = self;
+  dbtFile_w = NULL;
+  dbtFile_r = NULL;
+  this->media_path = media_path;
+  this->scene_width = scene_width;
+  this->scene_height = scene_height;
+
+  device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),
+                        16, false, false, false);
+  receiver = new MyEventReceiver();
+  device->setEventReceiver(receiver);
+  device->getLogger()->setLogLevel(ELL_NONE);
+
+  device->getCursorControl()->setVisible(false);
+  device->setResizable(false);
+
+  // font = device->getGUIEnvironment()->getBuiltInFont();
+  driver = device->getVideoDriver();
+  smgr = device->getSceneManager();
+
+  smgr->setAmbientLight(video::SColorf(1, 1, 1));
+
+  /*
+env = device->getGUIEnvironment();
+IGUISkin* skin = env->getSkin();
+  font = env->getFont("./fonthaettenschweiler.bmp");
+
+  if (font)
+          skin->setFont(font);
+
+  // create menu
+
+  IGUIContextMenu* menu = env->addMenu();
+  menu->setMinSize(core::dimension2du(640,20));
+  menu->addItem(L"File", -1, true, true);
+  menu->addItem(L"View", -1, true, true);
+  menu->addItem(L"Camera", -1, true, true);
+  menu->addItem(L"Help", -1, true, true);
+
+  // disable alpha
+
+  for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
+  {
+          video::SColor col =
+env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
+          col.setAlpha(255);
+          env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
+  }
+   */
+}
+
+Gui_impl::~Gui_impl() {
+  // printf("del Gui_impl\n");
+  //device->drop();
+
+  delete receiver;
+  // printf("del Gui_impl ok\n");
+}
+
+void Gui_impl::AddVisualizationCamera(VisualizationCamera* camera) {
+  cameras.push_back(camera);
+}
+
+void Gui_impl::setMesh(std::string file, vector3df position, vector3df rotation,
+                       vector3df scale) {
+  IAnimatedMesh *mesh = smgr->getMesh(file.c_str());
+
+  if (!mesh) {
+    // model could not be loaded
+    self->Err("Model %s could not be loaded\n", file.c_str());
+    return;
+  }
+
+  node = smgr->addOctreeSceneNode(mesh->getMesh(0), 0, -1, 1024);
+  node->setPosition(position);
+  rotation +=
+      irr::core::vector3df(90, 0, Euler::ToDegree(getSimulator()->Yaw()));
+  node->setRotation(rotation);
+  for (int i = 0; i < node->getMaterialCount(); i++) {
+    node->getMaterial(i).TextureLayer->TextureWrapU = video::ETC_REPEAT;
+    node->getMaterial(i).TextureLayer->TextureWrapV = video::ETC_REPEAT;
+  }
+  // Ceillig
+  // node->getMaterial(0).getTextureMatrix(0).setTextureScale(scale.X/2.0,scale.Z/2.0);
+  // Walls
+  node->getMaterial(1).getTextureMatrix(0).setTextureScale(1 / (scale.Y / 2.5),
+                                                           1 / (scale.Z / 2.5));
+  // Floor
+  node->getMaterial(2).getTextureMatrix(0).setTextureScale(
+      1 / (scale.X / 20.0), 1 / (scale.Z / 20.0));
+
+  node->setScale(scale);
+  // selector
+  selector = smgr->createOctreeTriangleSelector(node->getMesh(), node, 128);
+  node->setTriangleSelector(selector);
+}
+
+void Gui_impl::RunGui(std::vector<Model *> models,
+                      std::vector<GenericObject *> objects) {
+  int lastFPS = -1;
+  int cam_id = 0;
+
+  receiver->SetModel(models.at(0));
+
+  for (size_t i = 0; i < models.size(); i++) {
+    models.at(i)->Draw();
+  }
+
+  for (size_t i = 0; i < models.size(); i++) {
+    models.at(i)->pimpl_->MetaTriangleSelector()->addTriangleSelector(selector);
+    for (size_t j = 0; j < objects.size(); j++) {
+      models.at(i)->pimpl_->MetaTriangleSelector()->addTriangleSelector(
+          objects.at(j)->TriangleSelector());
+    }
+    for (size_t j = 0; j < models.size(); j++) {
+      if (i == j) continue;
+      models.at(i)->pimpl_->MetaTriangleSelector()->addTriangleSelector(
+          models.at(j)->pimpl_->TriangleSelector());
+    }
+  }
+
+  selector->drop(); // As soon as we're done with the selector, drop it.*/
+
+  // wait all models to be started
+  for (size_t i = 0; i < models.size(); i++) {
+    models.at(i)->pimpl_->SynchronizationPoint();
+  }
+
+  setWindowCaption(0, 0);
+
+  while (device->run()) {
+    if (dbtFile_r != NULL) {// rejeu
+      takeScreenshot(); // on enregistre l'image precedente
+      road_time_t time;
+      road_timerange_t tr = 0;
+      if (read_hdfile(dbtFile_r, (void *)dbtbuf, &time, &tr) != 0) {
+        vector3df vect;
+        char *buf = dbtbuf;
+        for (size_t i = 0; i < models.size(); i++) {
+          models.at(i)->ReaddbtBuf(buf);
+          buf += models.at(i)->dbtSize();
+        }
+      } else {
+        // Printf("fin play\n");
+        close_hdfile(dbtFile_r);
+        dbtFile_r = NULL;
+        free(dbtbuf);
+        for (size_t i = 0; i < models.size(); i++) {
+          models.at(i)->pimpl_->Resume();
+        }
+      }
+    } else { // mode normal
+      for (size_t i = 0; i < models.size(); i++) {
+        models.at(i)->pimpl_->UpdatePos();
+      }
+    }
+
+    driver->beginScene(true, true, video::SColor(255, 200, 200, 200));
+
+    // vue poursuite
+    //smgr->setActiveCamera(models.at(cam_id)->getFollowMeCamera()->getCameraSceneNode());
+    smgr->setActiveCamera(cameras.at(cam_id)->getCameraSceneNode());
+    driver->setViewPort(core::rect<s32>(0, 0, scene_width, scene_height));
+    smgr->drawAll(); // commente voir plus bas
+                     /*
+                 env->drawAll();
+                 if (font)
+                 {
+                                     font->draw(L"This demo shows that Irrlicht is also capable
+                 of drawing 2D graphics.",
+                                             core::rect<s32>(130,10,300,50),
+                                             video::SColor(255,255,255,255));
+                 }
+                 else
+                 {
+                 printf("err\n");
+                 }
+                 device->setWindowCaption(L"toto");*/
+
+    if (dbtFile_r == NULL) {// mode normal
+      for (size_t i = 0; i < models.size(); i++) {
+        models.at(i)->pimpl_->CheckCollision();
+      }
+    }
+
+    for (size_t i = 0; i < models.size(); i++) {
+      models.at(i)->ProcessUpdate(NULL);
+    }
+
+    // on fait ca ici, devrait etre un peu plus haut
+    // mais a priori souci avec models.at(i)->pimpl_->CheckCollision();
+    // (setelipsoid?)
+    //smgr->setActiveCamera(models.at(cam_id)->getFollowMeCamera()->getCameraSceneNode());
+    smgr->setActiveCamera(cameras.at(cam_id)->getCameraSceneNode());
+    driver->setViewPort(core::rect<s32>(0, 0, scene_width, scene_height));
+    smgr->drawAll();
+
+    driver->endScene();
+
+    int fps = driver->getFPS();
+
+    if (lastFPS != fps) {
+      setWindowCaption(cam_id, fps);
+      lastFPS = fps;
+    }
+
+    if (receiver->IsKeyDown(KEY_PRIOR)) {
+      cam_id++;
+      if (cam_id >= (int)cameras.size()) cam_id = 0;
+      receiver->SetModel(getModelFromVisualizationCamera(models,cameras.at(cam_id)));
+      setWindowCaption(cam_id, fps);
+    }
+    if (receiver->IsKeyDown(KEY_NEXT)) {
+      cam_id--;
+      if (cam_id < 0) cam_id = cameras.size() - 1;
+      receiver->SetModel(getModelFromVisualizationCamera(models,cameras.at(cam_id)));
+      setWindowCaption(cam_id, fps);
+    }
+
+    // enregistrement DBT
+    if (receiver->IsKeyDown(KEY_KEY_R) && dbtFile_w == NULL) {
+      dbtFile_w = inithdFile((char *)"./record.dbt", UAV, dbtSize(models));
+      dbtbuf = (char *)malloc(dbtSize(models));
+    }
+    if (receiver->IsKeyDown(KEY_KEY_S) && dbtFile_w != NULL) {
+      close_hdfile(dbtFile_w);
+      dbtFile_w = NULL;
+      free(dbtbuf);
+      // rt_printf("stop rec\n");
+    }
+    if (dbtFile_w != NULL) {
+      Time time = GetTime();
+      vector3df vect;
+      char *buf = dbtbuf;
+
+      for (size_t i = 0; i < models.size(); i++) {
+        models.at(i)->WritedbtBuf(buf);
+        buf += models.at(i)->dbtSize();
+      }
+
+      write_hdfile(dbtFile_w, dbtbuf, (road_time_t)(time / 1000),
+                   (road_timerange_t)(time % 1000), dbtSize(models));
+    }
+
+    // lecture dbt
+    if (receiver->IsKeyDown(KEY_KEY_P) && dbtFile_r == NULL) {
+      dbtFile_r = open_hdfile((char *)"./record.dbt", READ_MODE);
+      dbtbuf = (char *)malloc(dbtSize(models));
+      // on suspend les models pour ne pas interferer
+      for (size_t i = 0; i < models.size(); i++) {
+        models.at(i)->pimpl_->Suspend();
+      }
+    }
+    if (receiver->IsKeyDown(KEY_KEY_S) && dbtFile_r != NULL) {
+      // rt_printf("stop play\n");
+      close_hdfile(dbtFile_r);
+      dbtFile_r = NULL;
+      free(dbtbuf);
+      // on resume les models
+      for (size_t i = 0; i < models.size(); i++) {
+        models.at(i)->pimpl_->Resume();
+      }
+    }
+  }
+
+  receiver->SetModel(NULL);
+}
+
+Model *Gui_impl::getModelFromVisualizationCamera(std::vector<Model *> models,VisualizationCamera *camera) {
+  for (size_t i = 0; i < models.size(); i++) {
+      if(models.at(i)->getFollowMeCamera()==camera) return models.at(i);
+  }
+  return NULL;
+}
+
+void Gui_impl::setWindowCaption(int cam_id, int fps) {
+  std::ostringstream text;
+
+  text << "Cam: " << cameras.at(cam_id)->getName().c_str()
+     << ", FPS: " << fps;
+
+  device->setWindowCaption(stringw(text.str().c_str()).c_str());
+}
+
+void Gui_impl::takeScreenshot(void) {
+  static int cpt = 0;
+  // get image from the last rendered frame
+  IImage *const image = driver->createScreenShot();
+  if (image) // should always be true, but you never know. ;)
+  {
+    // construct a filename, consisting of local time and file extension
+    c8 filename[64];
+    // snprintf(filename, 64, "screenshot_%u.png",
+    // device->getTimer()->getRealTime());
+    snprintf(filename, 64, "screenshot_%u.png", cpt);
+    cpt++;
+    // write screenshot to file
+    if (!driver->writeImageToFile(image, filename))
+      device->getLogger()->log(L"Failed to take screenshot.", ELL_WARNING);
+
+    // Don't forget to drop image since we don't need it anymore.
+    image->drop();
+  }
+}
+
+size_t Gui_impl::dbtSize(std::vector<Model *> models) {
+  size_t size = 0;
+  for (size_t i = 0; i < models.size(); i++) {
+    size += models.at(i)->dbtSize();
+  }
+
+  return size;
+}
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Man.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Man.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Man.cpp	(revision 209)
@@ -0,0 +1,157 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/15
+//  filename:   Man.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant un personnage
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Man.h"
+#include "Gui.h"
+#include "Euler.h"
+#include <ISceneManager.h>
+#include <IAnimatedMeshSceneNode.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include "FollowMeCamera.h"
+
+class addAnimatedMeshSceneNode;
+using namespace irr;
+using namespace irr::core;
+using namespace irr::scene;
+using namespace irr::video;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace simulator {
+
+Man::Man(std::string name,uint32_t modelId) : Model(name,modelId) {
+  node = getGui()->getSceneManager()->addAnimatedMeshSceneNode(
+      getGui()->getMesh("ninja.b3d"), getSceneNode(), -1, vector3df(0, 0, 0),
+      vector3df(90, 0, 90), vector3df(10, 10, 10));
+
+  node->setFrameLoop(0, 13);
+  node->setAnimationSpeed(0);
+  node->getMaterial(0).NormalizeNormals = true;
+  node->getMaterial(0).Lighting = false;
+
+  getFollowMeCamera()->setPositionOffset(vector3df(0, 0, -1));
+  getFollowMeCamera()->setTargetOffset(vector3df(0, 0, -1));
+
+  setTriangleSelector(
+      getGui()->getSceneManager()->createTriangleSelector(node));
+  Box()->addInternalBox(node->getTransformedBoundingBox());
+
+  Tab *setup_tab = new Tab(GetTabWidget(), "model");
+  t_speed = new DoubleSpinBox(setup_tab->NewRow(), "translational speed (m/s):",
+                              0, 5, 0.1);
+  r_speed = new DoubleSpinBox(setup_tab->NewRow(), "rotational speed (deg/s):",
+                              0, 180, 10);
+                              
+  SetIsReady(true);
+}
+
+Man::~Man() {}
+
+void Man::CalcModel(void) {
+  // compute quaternion from W
+  // Quaternion derivative: dQ = 0.5*(Q*Qw)
+  Quaternion dQ = state[-1].Quat.GetDerivative(state[0].W);
+
+  // Quaternion integration
+  state[0].Quat = state[-1].Quat + dQ * dT();
+  state[0].Quat.Normalize();
+
+  Vector3D<double> dir = state[0].Vel;
+  dir.Rotate(state[0].Quat);
+  state[0].Pos = state[-1].Pos + dT() * dir;
+}
+
+bool Man::OnEvent(const SEvent &event) {
+  if (event.EventType != EET_KEY_INPUT_EVENT)
+    return false;
+
+  if (event.KeyInput.PressedDown == false) {
+    state[0].Vel.x = 0;
+    state[0].W.z = 0;
+    node->setAnimationSpeed(0);
+  } else {
+    switch (event.KeyInput.Key) {
+    case KEY_UP:
+      state[0].Vel.x = t_speed->Value();
+      node->setAnimationSpeed(t_speed->Value() * 10.f);
+      break;
+    case KEY_DOWN:
+      state[0].Vel.x = -t_speed->Value();
+      node->setAnimationSpeed(-t_speed->Value() * 10.f);
+      break;
+    case KEY_LEFT:
+      state[0].W.z = -Euler::ToRadian(r_speed->Value());
+      node->setAnimationSpeed(r_speed->Value() * .15f);
+      break;
+    case KEY_RIGHT:
+      state[0].W.z = Euler::ToRadian(r_speed->Value());
+      node->setAnimationSpeed(-r_speed->Value() * .15f);
+      break;
+    default:
+      return false;
+      break;
+    }
+  }
+
+  return true;
+}
+
+size_t Man::dbtSize(void) const { return 6 * sizeof(float); }
+
+void Man::WritedbtBuf(char *dbtbuf) { /*
+                                         float *buf=(float*)dbtbuf;
+                                         vector3df vect=node->getPosition();
+                                         memcpy(buf,&vect.X,sizeof(float));
+                                         buf++;
+                                         memcpy(buf,&vect.Y,sizeof(float));
+                                         buf++;
+                                         memcpy(buf,&vect.Z,sizeof(float));
+                                         buf++;
+                                         vect=node->getRotation();
+                                         memcpy(buf,&vect.X,sizeof(float));
+                                         buf++;
+                                         memcpy(buf,&vect.Y,sizeof(float));
+                                         buf++;
+                                         memcpy(buf,&vect.Z,sizeof(float));
+                                         buf++;*/
+}
+
+void Man::ReaddbtBuf(char *dbtbuf) { /*
+                                        float *buf=(float*)dbtbuf;
+                                        vector3df vect;
+                                        memcpy(&vect.X,buf,sizeof(float));
+                                        buf++;
+                                        memcpy(&vect.Y,buf,sizeof(float));
+                                        buf++;
+                                        memcpy(&vect.Z,buf,sizeof(float));
+                                        buf++;
+                                        node->setPosition(vect);
+                                        memcpy(&vect.X,buf,sizeof(float));
+                                        buf++;
+                                        memcpy(&vect.Y,buf,sizeof(float));
+                                        buf++;
+                                        memcpy(&vect.Z,buf,sizeof(float));
+                                        buf++;
+                                        node->setRotation(vect);
+                                        node->setAnimationSpeed(2.f);*/
+}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Man.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Man.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Man.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/15
+//  filename:   Man.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant un personnage
+//
+/*********************************************************************/
+
+#ifndef MAN_H
+#define MAN_H
+
+#include <Model.h>
+
+namespace irr {
+namespace scene {
+class IAnimatedMeshSceneNode;
+}
+}
+
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+}
+}
+
+namespace flair {
+namespace simulator {
+
+class Man : private Model {
+public:
+  Man(std::string name,uint32_t modelId);
+  ~Man();
+
+private:
+  size_t dbtSize(void) const;
+  void WritedbtBuf(char *dbtbuf);
+  void ReaddbtBuf(char *dbtbuf);
+  void CalcModel(void);
+  void AnimateModel(void){};
+  bool OnEvent(const irr::SEvent &event);
+
+  irr::scene::IAnimatedMeshSceneNode *node;
+  gui::DoubleSpinBox *t_speed, *r_speed;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // MAN_H
Index: tags/latest/lib/FlairSimulator/src/MeshSceneNode.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/MeshSceneNode.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/MeshSceneNode.cpp	(revision 209)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/22
+//  filename:   MeshSceneNode.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un IMeshSceneNode
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "MeshSceneNode.h"
+#include "Gui.h"
+#include "Model.h"
+#include <ISceneManager.h>
+#include <IVideoDriver.h>
+
+using namespace irr;
+using namespace irr::video;
+using namespace irr::scene;
+using namespace irr::core;
+using namespace flair::core;
+
+namespace flair {
+namespace simulator {
+
+MeshSceneNode::MeshSceneNode(Model *parent, IMesh *mesh,
+                             const vector3df &position,
+                             const vector3df &rotation, ITexture *texture,
+                             s32 id)
+    : IMeshSceneNode(parent->getSceneNode(), getGui()->getSceneManager(), id,
+                     position, rotation) {
+  Material.Wireframe = false;
+  Material.Lighting = false;
+
+  setMesh(mesh);
+
+  if (texture != NULL) {
+    setMaterialTexture(0, texture);
+  }
+
+  parent->Box()->addInternalBox(getTransformedBoundingBox());
+}
+
+void MeshSceneNode::OnRegisterSceneNode(void) {
+  if (IsVisible)
+    SceneManager->registerNodeForRendering(this);
+
+  ISceneNode::OnRegisterSceneNode();
+}
+
+void MeshSceneNode::render(void) {
+  IVideoDriver *driver = SceneManager->getVideoDriver();
+
+  driver->setMaterial(Material);
+  driver->setTransform(ETS_WORLD, AbsoluteTransformation);
+  driver->drawMeshBuffer(mesh->getMeshBuffer(0));
+}
+
+SMaterial &MeshSceneNode::getMaterial(u32 i) { return Material; }
+
+void MeshSceneNode::setMesh(IMesh *ptr) {
+  mesh = ptr;
+  Box = mesh->getBoundingBox();
+}
+
+IMesh *MeshSceneNode::getMesh(void) { return mesh; }
+
+void MeshSceneNode::setReadOnlyMaterials(bool readonly) {}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/MeshSceneNode.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/MeshSceneNode.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/MeshSceneNode.h	(revision 209)
@@ -0,0 +1,60 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/22
+//  filename:   MeshSceneNode.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un IMeshSceneNode
+//
+/*********************************************************************/
+
+#ifndef MESHSCENENODE_H
+#define MESHSCENENODE_H
+
+#include <IMeshSceneNode.h>
+
+namespace flair {
+namespace simulator {
+class Model;
+
+class MeshSceneNode : public irr::scene::IMeshSceneNode {
+public:
+  MeshSceneNode(
+      Model *parent, irr::scene::IMesh *mesh,
+      const irr::core::vector3df &position = irr::core::vector3df(0, 0, 0),
+      const irr::core::vector3df &rotation = irr::core::vector3df(0, 0, 0),
+      irr::video::ITexture *texture = NULL, irr::s32 id = -1);
+
+  virtual void OnRegisterSceneNode(void);
+  virtual void render(void);
+  virtual const irr::core::aabbox3d<irr::f32> &getBoundingBox() const {
+    return Box;
+  }
+  virtual irr::u32 getMaterialCount(void) const { return 1; }
+  virtual irr::video::SMaterial &getMaterial(irr::u32 i);
+  virtual void setMesh(irr::scene::IMesh *ptr);
+  virtual irr::scene::IMesh *getMesh(void);
+  virtual void setReadOnlyMaterials(bool readonly);
+  virtual bool isReadOnlyMaterials(void) const { return false; }
+  virtual irr::scene::IShadowVolumeSceneNode *
+  addShadowVolumeSceneNode(const irr::scene::IMesh *shadowMesh = 0,
+                           irr::s32 id = -1, bool zfailmethod = true,
+                           irr::f32 infinity = 1000.0f) {
+    return NULL;
+  }
+
+private:
+  irr::scene::IMesh *mesh;
+  irr::core::aabbox3d<irr::f32> Box;
+  irr::video::SMaterial Material;
+};
+} // end namespace simulator
+} // end namespace flair
+
+#endif // MESHSCENENODE_H
Index: tags/latest/lib/FlairSimulator/src/Model.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Model.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Model.cpp	(revision 209)
@@ -0,0 +1,78 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Model.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#include "Model.h"
+#include "Model_impl.h"
+#include "Simulator.h"
+#include <DoubleSpinBox.h>
+
+#ifdef GL
+#include "FollowMeCamera.h"
+#include <ICameraSceneNode.h>
+using namespace irr;
+using namespace irr::scene;
+using namespace irr::core;
+#endif
+
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace simulator {
+
+Model::Model(std::string name,uint32_t modelId)
+    : IODevice(getSimulator(), name) {
+  pimpl_ = new Model_impl(this, name,modelId);
+}
+
+Model::~Model() { delete pimpl_; }
+#ifdef GL
+ISceneNode *Model::getSceneNode() const { return pimpl_; }
+/*
+only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
+void Model::setPosition(Vector3D pos)
+{
+    //note that irrlicht frame is left handed
+    pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
+}
+*/
+void Model::setScale(float value) {
+  pimpl_->setScale(vector3df(value, value, value));
+}
+
+aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
+
+FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
+
+void Model::setTriangleSelector(ITriangleSelector *selector) {
+
+  pimpl_->selector = selector;
+  pimpl_->setTriangleSelector(selector);
+}
+
+void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
+#endif
+
+TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
+
+double Model::dT(void) const { return pimpl_->dT->Value(); }
+
+int Model::GetId(void) const {
+  return pimpl_->modelId;
+}
+
+} // end namespace simulator
+} // end namespace flair
Index: tags/latest/lib/FlairSimulator/src/Model.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Model.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Model.h	(revision 209)
@@ -0,0 +1,114 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Model.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#ifndef MODEL_H
+#define MODEL_H
+
+#include <IODevice.h>
+#include <Quaternion.h>
+#include <Vector3D.h>
+#include <DiscreteTimeVariable.h>
+
+#ifdef GL
+#include <aabbox3d.h>
+#include <IEventReceiver.h>
+namespace irr {
+class SEvent;
+namespace scene {
+class ISceneManager;
+class ISceneNode;
+class ITriangleSelector;
+}
+}
+#endif
+
+namespace flair {
+namespace gui {
+class TabWidget;
+}
+namespace sensor {
+class SensorGL;
+}
+}
+
+class Gui_impl;
+class Simulator_impl;
+class Model_impl;
+
+namespace flair {
+namespace simulator {
+class FollowMeCamera;
+
+class Model : public core::IODevice
+#ifdef GL
+, public irr::IEventReceiver
+#endif
+ {
+  friend class ::Gui_impl;
+  friend class ::Simulator_impl;
+  friend class ::Model_impl;
+  friend class sensor::SensorGL;
+
+public:
+  Model(std::string name,uint32_t modelId);
+  virtual ~Model();
+
+  typedef struct simu_state {
+    core::Quaternion Quat;
+    core::Vector3Df W;
+    core::Vector3D<double> Pos;
+    core::Vector3D<double> Vel;
+  } simu_state_t;
+
+#ifdef GL
+  irr::scene::ISceneNode *getSceneNode() const;
+  irr::core::aabbox3d<irr::f32> *Box() const;
+
+  virtual size_t dbtSize(void) const = 0;
+  virtual void Draw(void){};
+  virtual void ExtraDraw(void){};
+  virtual void WritedbtBuf(char *dbtbuf) = 0;
+  virtual void ReaddbtBuf(char *dbtbuf) = 0;
+
+  //default event handling
+  bool OnEvent(const irr::SEvent &event) { return false;};
+
+  //! Sets the value of the camera's far clipping plane (default: 2000.0f)
+  /** \param zf: New z far value. */
+  void setCameraFarValue(float zf);
+#endif
+  gui::TabWidget *GetTabWidget(void) const;
+  int GetId(void) const;
+
+protected:
+  DiscreteTimeVariable<simu_state_t, 3> state;
+  double dT(void) const;
+  virtual void CalcModel(void) = 0;
+#ifdef GL
+  FollowMeCamera *getFollowMeCamera(void) const;
+  virtual void AnimateModel(void) = 0;
+  // void setPosition(core::Vector3D pos);
+  void setScale(float value);
+  void setTriangleSelector(irr::scene::ITriangleSelector *selector);
+#endif
+
+private:
+  void UpdateFrom(const core::io_data *data){};
+  class Model_impl *pimpl_;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // MODEL_H
Index: tags/latest/lib/FlairSimulator/src/Model_impl.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Model_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Model_impl.cpp	(revision 209)
@@ -0,0 +1,354 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Model_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#include "Model.h"
+#include "Model_impl.h"
+#include "Simulator.h"
+#include "Simulator_impl.h"
+#include "TabWidget.h"
+#include "Tab.h"
+#include "DoubleSpinBox.h"
+#include "Vector3DSpinBox.h"
+#include "SpinBox.h"
+#include "CheckBox.h"
+#include "cvmatrix.h"
+#include "Euler.h"
+#include <math.h>
+
+#ifdef GL
+#include "ConditionVariable.h"
+#include "Gui.h"
+#include "Gui_impl.h"
+#include <ISceneManager.h>
+#include <ISceneNodeAnimatorCollisionResponse.h>
+#include <IMetaTriangleSelector.h>
+#include <IVideoDriver.h>
+#include <ICameraSceneNode.h>
+#include "FollowMeCamera.h"
+
+using namespace irr;
+using namespace video;
+using namespace scene;
+using namespace core;
+using namespace io;
+#endif
+
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::simulator;
+
+#ifdef GL
+Model_impl::Model_impl(Model *self, std::string name,uint32_t modelId)
+    : ISceneNode(getGui()->getSceneManager()->getRootSceneNode(), getGui()->getSceneManager(), -1),
+      Thread(self, name, 99), vrpn_Tracker(name.c_str(), getSimulator()->pimpl_)
+
+#else
+Model_impl::Model_impl(Model *self, std::string name,uint32_t modelId)
+    : Thread(self, name, 99), vrpn_Tracker(name.c_str(), getSimulator()->pimpl_)
+#endif
+{
+  this->self = self;
+  this->modelId=modelId;
+
+#ifdef GL
+  // for sync with gui
+  cond = new ConditionVariable(this, name);
+  sync_count = 0;
+
+  // collisions
+  collision_mutex = new Mutex(this);
+  collision_occured = false;
+
+  // selector for collisions
+  selector = getSceneManager()->createTriangleSelectorFromBoundingBox(this);
+  setTriangleSelector(selector);
+  meta_selector = getSceneManager()->createMetaTriangleSelector();
+
+  anim = getSceneManager()->createCollisionResponseAnimator(
+      meta_selector, this, vector3df(1, 1, 1), vector3df(0, 0, 0),
+      vector3df(0, 0, 0));
+  addAnimator(anim);
+
+  // camera
+  camera = new FollowMeCamera(this,name);
+
+  position_init = false;
+#endif
+
+  // init user interface
+  Tab *tab = new Tab(getSimulator()->GetTabWidget(), ObjectName());
+  tabwidget = new TabWidget(tab->NewRow(), "tabs");
+  Tab *sampl = new Tab(tabwidget, "sampling");
+  dT = new DoubleSpinBox(sampl->NewRow(), "Tech (s):", 0.001, 1, 0.001, 3);
+  Tab *layout = new Tab(tabwidget, "optitrack");
+  enable_opti = new CheckBox(layout->NewRow(), "enabled");
+  Tab *init = new Tab(tabwidget, "init");
+  pos_init = new Vector3DSpinBox(init->NewRow(), "position", -50, 50, 1);
+  yaw_init = new SpinBox(init->NewRow(), "yaw (deg):", -180, 180, 10);
+
+  // modele
+  states_mutex = new Mutex(this);
+  self->state[0].Pos = pos_init->Value();
+  self->state[0].Vel.x = 0;
+  self->state[0].Vel.y = 0;
+  self->state[0].Vel.z = 0;
+  self->state[0].Quat = ComputeInitRotation(Quaternion(1, 0, 0, 0));
+  self->state[0].W.x = 0;
+  self->state[0].W.y = 0;
+  self->state[0].W.z = 0;
+
+  self->state[-1] = self->state[0];
+  self->state[-2] = self->state[0];
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(19, 1);
+  desc->SetElementName(0, 0, "q0");
+  desc->SetElementName(1, 0, "q1");
+  desc->SetElementName(2, 0, "q2");
+  desc->SetElementName(3, 0, "q3");
+  desc->SetElementName(4, 0, "x");
+  desc->SetElementName(5, 0, "y");
+  desc->SetElementName(6, 0, "z");
+  desc->SetElementName(7, 0, "wx");
+  desc->SetElementName(8, 0, "wy");
+  desc->SetElementName(9, 0, "wz");
+  desc->SetElementName(10, 0, "vx");
+  desc->SetElementName(11, 0, "vy");
+  desc->SetElementName(12, 0, "vz");
+  desc->SetElementName(13, 0, "ax");
+  desc->SetElementName(14, 0, "ay");
+  desc->SetElementName(15, 0, "az");
+  desc->SetElementName(16, 0, "mx");
+  desc->SetElementName(17, 0, "my");
+  desc->SetElementName(18, 0, "mz");
+  output = new cvmatrix(this, desc, floatType, "state");
+  delete desc;
+
+  self->AddDataToLog(output);
+  
+  getSimulator()->pimpl_->models.push_back(self);
+}
+
+Model_impl::~Model_impl() {
+  SafeStop();
+  Join();
+#ifdef GL
+  remove(); // remove ISceneNode
+#endif
+}
+
+Quaternion Model_impl::ComputeInitRotation(Quaternion quat_in) {
+  Quaternion yaw_rot_quat;
+  Euler yaw_rot_euler(0, 0, Euler::ToRadian(yaw_init->Value()));
+  yaw_rot_euler.ToQuaternion(yaw_rot_quat);
+  return yaw_rot_quat * quat_in;
+}
+
+void Model_impl::mainloop(void) {
+  if (enable_opti->Value() == false)
+    return;
+  vrpn_gettimeofday(&_timestamp, NULL);
+  vrpn_Tracker::timestamp = _timestamp;
+
+  // change to vrpn reference
+  states_mutex->GetMutex();
+  Quaternion quat = getSimulator()->ToVRPNReference(self->state[0].Quat);
+  Vector3D<double> position = getSimulator()->ToVRPNReference(self->state[0].Pos);
+  states_mutex->ReleaseMutex();
+
+  pos[0] = position.x;
+  pos[1] = position.y;
+  pos[2] = position.z;
+  // warning: d_quat is defined as (qx,qy,qz,qw), which is different from
+  // flair::core::Quaternion
+  d_quat[0] = quat.q1;
+  d_quat[1] = quat.q2;
+  d_quat[2] = quat.q3;
+  d_quat[3] = quat.q0;
+
+  char msgbuf[1000];
+
+  d_sensor = 0;
+
+  int len = vrpn_Tracker::encode_to(msgbuf);
+
+  if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id,
+                                 msgbuf, vrpn_CONNECTION_LOW_LATENCY)) {
+    fprintf(stderr, "can't write message: tossing\n");
+  }
+
+  server_mainloop();
+}
+
+#ifdef GL
+ITriangleSelector *Model_impl::TriangleSelector(void) { return selector; }
+
+IMetaTriangleSelector *Model_impl::MetaTriangleSelector(void) {
+  return meta_selector;
+}
+
+void Model_impl::UpdatePos(void) {
+  vector3df nodePosition;
+  Quaternion nodeOrientation;
+  Euler euler;
+
+  states_mutex->GetMutex();
+//self->state[0].Pos.x=0;
+//self->state[0].Pos.y=0;
+  nodePosition = ToIrrlichtCoordinates(self->state[0].Pos);
+  nodeOrientation = ToIrrlichtOrientation(self->state[0].Quat);
+  states_mutex->ReleaseMutex();
+
+  setPosition(nodePosition);
+
+  nodeOrientation.ToEuler(euler);
+  ISceneNode::setRotation(Euler::ToDegree(1) * vector3df(euler.roll,euler.pitch, euler.yaw));
+
+  if (position_init == false) {
+    anim->setTargetNode(this); // a faire pour se teleporter sans les collisions
+    position_init = true;
+  }
+
+  self->AnimateModel();
+}
+
+void Model_impl::CheckCollision(void) {
+  // TODO: setEllipsoidRadius should be called in Model::setScale
+  // but we need to call recalculateBoundingBox
+  anim->setEllipsoidRadius(getTransformedBoundingBox().getExtent());
+
+  if (anim->collisionOccurred() == true) {
+    vector3df pos;
+    vector3df pos_rel;
+    vector3df nodePosition;
+    pos = anim->getCollisionPoint();
+    nodePosition = getPosition();
+    pos_rel = pos - nodePosition;
+    // printf("collision %f %f %f\n",pos.X,pos.Y,pos.Z);
+    // printf("drone %f %f %f\n",nodePosition.X,nodePosition.Y,nodePosition.Z);
+    // printf("rel %f %f %f\n",pos_rel.X,pos_rel.Z,pos_rel.Y);
+
+    collision_mutex->GetMutex();
+    collision_occured = true;
+    collision_point = ToSimulatorCoordinates(nodePosition);
+    collision_mutex->ReleaseMutex();
+  }
+}
+
+void Model_impl::CollisionHandler(void) {
+  collision_mutex->GetMutex();
+  if (collision_occured == true) {
+    collision_occured = false;
+    states_mutex->GetMutex();
+    self->state[0].Pos = collision_point;
+    self->state[-1].Pos = self->state[0].Pos;
+    self->state[-2].Pos = self->state[0].Pos;
+    states_mutex->ReleaseMutex();
+  }
+  collision_mutex->ReleaseMutex();
+}
+
+void Model_impl::OnRegisterSceneNode(void) {
+  if (IsVisible)
+    SceneManager->registerNodeForRendering(this);
+
+  ISceneNode::OnRegisterSceneNode();
+}
+
+void Model_impl::render(void) {
+  IVideoDriver *driver = SceneManager->getVideoDriver();
+  driver->setTransform(ETS_WORLD, AbsoluteTransformation);
+}
+
+// le premier arrive attend l'autre
+void Model_impl::SynchronizationPoint() {
+  cond->GetMutex();
+  sync_count++;
+
+  if (sync_count < 2) {
+    cond->CondWait();
+  } else {
+    cond->CondSignal();
+  }
+
+  cond->ReleaseMutex();
+}
+#endif // GL
+
+void Model_impl::Run(void) {
+  // Ask Xenomai to warn us upon switches to secondary mode.
+  WarnUponSwitches(true);
+
+#ifdef GL
+  // synchronize with gui
+  SynchronizationPoint();
+#endif
+
+  SetPeriodMS(dT->Value() * 1000.);
+
+  while (!ToBeStopped()) {
+    if (dT->ValueChanged())
+      SetPeriodMS(dT->Value() * 1000.);
+    WaitPeriod();
+
+#ifdef GL
+    CollisionHandler();
+#endif
+    states_mutex->GetMutex();
+    self->CalcModel();
+
+    output->GetMutex();
+    output->SetValueNoMutex(0, 0, self->state[0].Quat.q0);
+    output->SetValueNoMutex(1, 0, self->state[0].Quat.q1);
+    output->SetValueNoMutex(2, 0, self->state[0].Quat.q2);
+    output->SetValueNoMutex(3, 0, self->state[0].Quat.q3);
+    output->SetValueNoMutex(4, 0, self->state[0].Pos.x);
+    output->SetValueNoMutex(5, 0, self->state[0].Pos.y);
+    output->SetValueNoMutex(6, 0, self->state[0].Pos.z);
+    output->SetValueNoMutex(7, 0, self->state[0].W.x);
+    output->SetValueNoMutex(8, 0, self->state[0].W.y);
+    output->SetValueNoMutex(9, 0, self->state[0].W.z);
+    output->SetValueNoMutex(10, 0, self->state[0].Vel.x);
+    output->SetValueNoMutex(11, 0, self->state[0].Vel.y);
+    output->SetValueNoMutex(12, 0, self->state[0].Vel.z);
+    //todo: put acc and mag
+    output->SetValueNoMutex(13, 0, 0);
+    output->SetValueNoMutex(14, 0, 0);
+    output->SetValueNoMutex(15, 0, 0);
+    output->SetValueNoMutex(16, 0, 0);
+    output->SetValueNoMutex(17, 0, 0);
+    output->SetValueNoMutex(18, 0, 0);
+    output->ReleaseMutex();
+    output->SetDataTime(GetTime());
+
+    self->state.Update();
+
+    if (pos_init->ValueChanged() || yaw_init->ValueChanged()) {
+      self->state[-1].Quat = ComputeInitRotation(Quaternion(1, 0, 0, 0));
+      self->state[-2].Quat = ComputeInitRotation(Quaternion(1, 0, 0, 0));
+      self->state[-1].Pos = pos_init->Value();
+      self->state[-2].Pos = self->state[-1].Pos;
+#ifdef GL
+      position_init = false;
+#endif
+    }
+
+    states_mutex->ReleaseMutex();
+
+    self->ProcessUpdate(output);
+  }
+
+  WarnUponSwitches(false);
+}
Index: tags/latest/lib/FlairSimulator/src/Parser.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Parser.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Parser.cpp	(revision 209)
@@ -0,0 +1,244 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/08/02
+//  filename:   Parser.cpp
+//
+//  author:     César Richard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant un XML decrivant une map
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "Parser.h"
+#include "Simulator.h"
+#include "FixedCamera.h"
+#include "GenericObject.h"
+#include <vector3d.h>
+#include <Vector3D.h>
+#include <IrrlichtDevice.h>
+#include <IFileSystem.h>
+#include <IAnimatedMesh.h>
+#include <IGeometryCreator.h>
+#include <ISceneManager.h>
+
+using namespace irr;
+using namespace irr::core;
+using namespace irr::scene;
+using namespace irr::video;
+using namespace flair::core;
+using namespace flair::simulator;
+
+// todo: getMeshVect doit plutot donner point3D et euler
+// adaptr le xml et la dtd
+
+namespace flair {
+namespace simulator {
+Parser::Parser(int app_width, int app_height,
+               int scene_width, int scene_height, std::string media_path,
+               std::string xmlFile)
+    : Gui("Parser", app_width, app_height, scene_width, scene_height,
+          media_path) {
+  this->media_path = media_path;
+  xmlNode *root_element = NULL;
+  doc = xmlReadFile(xmlFile.c_str(), NULL, 0);
+  xmlDtdPtr dtd = NULL;
+  dtd = xmlParseDTD(NULL,
+                    (const xmlChar *)(media_path.append("/scene.dtd").c_str()));
+
+  if (dtd == NULL) {
+    // xmlGenericError(xmlGenericErrorContext,
+    Err("Could not parse DTD scene.dtd\n");
+  } else {
+    xmlValidCtxt cvp;
+    cvp.userData = (void *)stderr;
+    cvp.error = (xmlValidityErrorFunc)fprintf;
+    cvp.warning = (xmlValidityWarningFunc)fprintf;
+    if (!xmlValidateDtd(&cvp, doc, dtd)) {
+      // xmlGenericError(xmlGenericErrorContext,
+      Err("Document does not validate against scene.dtd\n");
+    }
+  }
+
+  if (doc == NULL) {
+    Err("error: could not parse file %s\n", xmlFile.c_str());
+  } else {
+    /*
+     * Get the root element node
+     */
+    root_element = xmlDocGetRootElement(doc);
+    processElements(root_element);
+  }
+}
+
+Parser::~Parser() {
+  if (doc != NULL) {
+    /*
+     * free the document
+     */
+    xmlFreeDoc(doc);
+    ;
+  }
+  /*
+   *Free the global variables that may
+   *have been allocated by the parser.
+   */
+  xmlCleanupParser();
+}
+
+/* Recursive function that prints the XML structure */
+void Parser::processElements(xmlNode *a_node) {
+  xmlNode *cur_node = NULL;
+  for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
+    if (cur_node->type == XML_ELEMENT_NODE) {
+      if (xmlStrEqual(cur_node->name, (xmlChar *)"params")) {
+        processParams(cur_node->children);
+      } else if (xmlStrEqual(cur_node->name, (xmlChar *)"objects")) {
+        processObjects(cur_node->children);
+      } else {
+        processElements(cur_node->children);
+      }
+    }
+  }
+}
+
+void Parser::processObjects(xmlNode *a_node) {
+  xmlNode *cur_node = NULL;
+
+  for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, (xmlChar *)"mesh")) {
+			FILE *fp;
+			std::string fileName = this->media_path+"/";
+      fp = NULL;
+      fp = fopen(fileName.append((char *)xmlGetProp(
+                                     cur_node, (xmlChar *)"model")).c_str(),"rb");
+      if (fp != NULL) {
+        GenericObject *object =
+            new GenericObject(getGui()->getMesh((char *)xmlGetProp(cur_node, (xmlChar *)"model")));
+        object->setPosition(
+            getMeshVect(cur_node->children, (xmlChar *)"position"));
+        object->setRotation(
+            getMeshVect(cur_node->children, (xmlChar *)"rotation"));
+        object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
+      } else {
+        Err("FATAL ERROR : File %s %s doesn't exist !\r\n",
+            (char *)xmlGetProp(cur_node, (xmlChar *)"model"),fileName.c_str());
+      }
+    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"cylinder")) {
+			const IGeometryCreator *geo;
+			geo = getGui()->getSceneManager()->getGeometryCreator();
+			IMesh* mesh=geo->createCylinderMesh(
+          ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"radius"))),
+          ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length"))),
+          atof((char *)xmlGetProp(cur_node, (xmlChar *)"tesselation")),
+          getScolor(cur_node->children));
+          //SColor(100, 255, 100, 100));
+      GenericObject *object = new GenericObject(mesh);
+      object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position"));
+      object->setRotation(getMeshVect(cur_node->children, (xmlChar *)"rotation"));
+      object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
+    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"eight")) {
+			const IGeometryCreator *geo;
+			geo = getGui()->getSceneManager()->getGeometryCreator();
+			IMesh* mesh=geo->createCubeMesh(
+          vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length")),
+                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"width")),
+                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"eight"))));
+			
+      GenericObject *object =new GenericObject(mesh);
+      object->setPosition(
+          getMeshVect(cur_node->children, (xmlChar *)"position"));
+      object->setRotation(
+          getMeshVect(cur_node->children, (xmlChar *)"rotation"));
+      object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
+    }
+  }
+}
+
+void Parser::processParams(xmlNode *a_node) {
+
+  xmlNode *cur_node = NULL;
+  for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, (xmlChar *)"archive")) {
+      std::string file =
+          media_path + "/" + (char *)xmlGetProp(cur_node, (xmlChar *)"path");
+      getDevice()->getFileSystem()->addFileArchive(file.c_str());
+    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"mesh")) {
+      setMesh((char *)xmlGetProp(cur_node, (xmlChar *)"model"),
+              getSceneVect(cur_node->children, (xmlChar *)"position"),
+              getSceneVect(cur_node->children, (xmlChar *)"rotation"),
+              getSceneVect(cur_node->children, (xmlChar *)"scale", true));
+    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"camera")) {
+      FixedCamera* fixedCamera=new FixedCamera(std::string((char *)xmlGetProp(cur_node, (xmlChar *)"name")),
+                                               getMeshVector3D(cur_node->children, (xmlChar *)"position"),
+                                               getMeshVector3D(cur_node->children, (xmlChar *)"lookat"));
+    }
+  }
+}
+
+SColor Parser::getScolor(xmlNode *mesh_node) {
+  xmlNode *cur_node = NULL;
+  for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, (xmlChar *)"color")) {
+      return SColor(atoi((char *)xmlGetProp(cur_node, (xmlChar *)"a")),
+                       atoi((char *)xmlGetProp(cur_node, (xmlChar *)"r")),
+                       atoi((char *)xmlGetProp(cur_node, (xmlChar *)"g")),
+                       atoi((char *)xmlGetProp(cur_node, (xmlChar *)"b")));
+    }
+  }
+  return SColor(255,0, 0, 0);
+}
+
+// todo rendre un vector3D framework
+// retirer irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df
+// vect);
+vector3df Parser::getMeshVect(xmlNode *mesh_node, xmlChar *param) {
+  xmlNode *cur_node = NULL;
+  for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, param)) {
+      return vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
+                       atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")),
+                       atof((char *)xmlGetProp(cur_node, (xmlChar *)"z")));
+    }
+  }
+  return vector3df(0, 0, 0);
+}
+
+Vector3Df Parser::getMeshVector3D(xmlNode *mesh_node, xmlChar *param) {
+  xmlNode *cur_node = NULL;
+  for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, param)) {
+      return Vector3Df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
+                       atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")),
+                       atof((char *)xmlGetProp(cur_node, (xmlChar *)"z")));
+    }
+  }
+  return Vector3Df(0, 0, 0);
+}
+
+vector3df Parser::getSceneVect(xmlNode *mesh_node, xmlChar *param,
+                               bool isScale) {
+  xmlNode *cur_node = NULL;
+  for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) {
+    if (xmlStrEqual(cur_node->name, param)) {
+      if (isScale) {
+        return vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
+                         atof((char *)xmlGetProp(cur_node, (xmlChar *)"z")),
+                         atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")));
+      }
+      return vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
+                       -atof((char *)xmlGetProp(cur_node, (xmlChar *)"z")),
+                       atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")));
+    }
+  }
+  return vector3df(0, 0, 0);
+}
+
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/Parser.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Parser.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Parser.h	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/08/02
+//  filename:   Parser.h
+//
+//  author:     César Richard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe chargeant un XML decrivant une map
+//
+/*********************************************************************/
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <Gui.h>
+#include <Vector3D.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <SColor.h>
+
+namespace flair {
+namespace simulator {
+class Parser : public Gui {
+
+  /*can create:
+  - cylinders: in y axis
+  - fixed cameras
+
+  */
+public:
+  Parser(int app_width, int app_height, int scene_width,
+         int scene_height, std::string media_path, std::string xmlFile);
+  ~Parser();
+
+private:
+  xmlDoc *doc;
+  std::string media_path;
+  void processElements(xmlNode *a_node);
+  void processObjects(xmlNode *a_node);
+  void processParams(xmlNode *a_node);
+	irr::video::SColor getScolor(xmlNode *mesh_node);
+  irr::core::vector3df getMeshVect(xmlNode *mesh_node, xmlChar *param);
+  irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param,
+                                    bool isScale = false);
+  core::Vector3Df getMeshVector3D(xmlNode *mesh_node, xmlChar *param);
+};
+}
+}
+#endif // PARSER_H
Index: tags/latest/lib/FlairSimulator/src/SensorGL.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/SensorGL.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SensorGL.cpp	(revision 209)
@@ -0,0 +1,43 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   SensorGL.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele de capteur
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "SensorGL.h"
+#include "Gui.h"
+#include "Model.h"
+#include "Model_impl.h"
+#include <ISceneManager.h>
+
+using namespace irr::scene;
+using namespace flair::simulator;
+
+namespace flair {
+namespace sensor {
+
+SensorGL::SensorGL(const Model *parent) {
+  collMan = getGui()->getSceneManager()->getSceneCollisionManager();
+  node = parent->Model::pimpl_;
+}
+
+SensorGL::~SensorGL() {}
+
+ISceneCollisionManager *SensorGL::CollMan(void) const { return collMan; }
+
+ISceneNode *SensorGL::Node(void) const { return node; }
+
+} // end namespace simulator
+} // end namespace flair
+#endif
Index: tags/latest/lib/FlairSimulator/src/SensorGL.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/SensorGL.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SensorGL.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   SensorGL.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele de capteur
+//
+/*********************************************************************/
+
+#ifndef SENSORGL_H
+#define SENSORGL_H
+
+namespace irr {
+namespace scene {
+class ISceneNode;
+class ISceneCollisionManager;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Model;
+}
+}
+
+namespace flair {
+namespace sensor {
+class SensorGL {
+public:
+  SensorGL(const simulator::Model *parent);
+  virtual ~SensorGL() = 0;
+
+protected:
+#ifdef GL
+  irr::scene::ISceneCollisionManager *CollMan(void) const;
+  irr::scene::ISceneNode *Node(void) const;
+#endif
+private:
+#ifdef GL
+  irr::scene::ISceneCollisionManager *collMan;
+  irr::scene::ISceneNode *node;
+#endif
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SENSORGL_H
Index: tags/latest/lib/FlairSimulator/src/SimuCameraGL.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 209)
@@ -0,0 +1,235 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/03/07
+//  filename:   SimuCameraGL.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//              pbo code from Song Ho Ahn (song.ahn@gmail.com)
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation camera
+//
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "SimuCameraGL.h"
+#include "Model.h"
+#include <SharedMem.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include <Vector3DSpinBox.h>
+#include <Gui.h>
+#include <Euler.h>
+
+#include <ISceneManager.h>
+#include <ICameraSceneNode.h>
+#include <IVideoDriver.h>
+
+#define PBO_COUNT 2
+
+using namespace irr;
+using namespace irr::scene;
+using namespace irr::core;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::simulator;
+
+namespace flair {
+namespace sensor {
+
+SimuCameraGL::SimuCameraGL(const Model *parent, std::string name, int width,
+                           int height, int x, int y, uint32_t modelId,uint32_t deviceId)
+    : SimuCamera(parent, name, width, height, 3, modelId,deviceId), SensorGL(parent) {
+  smgr = getGui()->getSceneManager();
+  camera = smgr->addCameraSceneNode();
+  camera->addAnimator(this);
+  camera->setAspectRatio((float)width /(float)height); // on force a cause du view port
+
+  this->width = width;
+  this->height = height;
+  this->x = x;
+  this->y = y;
+
+  index = 0;
+
+  // user interface
+  Tab *setup_tab = new Tab(parent->GetTabWidget(), name);
+  position = new Vector3DSpinBox(setup_tab->NewRow(), "position", -2, 2, .01);
+  direction = new Vector3DSpinBox(setup_tab->NewRow(), "direction", -2, 2, .01);
+  up = new Vector3DSpinBox(setup_tab->NewRow(), "up", -2, 2, .01);
+  fov = new DoubleSpinBox(setup_tab->NewRow(), "fov:", 0, 180, 5);
+
+  if (strcmp((char *)glGetString(GL_VENDOR),
+             "Intel Open Source Technology Center") == 0) {
+    //Thread::Warn("disabling cameras output for Intel card (bug with PBO)\n");
+    Thread::Warn("camera output for Intel card may have bugs with PBO\n");
+    //disable_output = true;
+    disable_output = false;
+  } else {
+    disable_output = false;
+  }
+
+  if (isGlExtensionSupported("GL_ARB_pixel_buffer_object")) {
+    use_pbo = true;
+    // create 2 pixel buffer objects, you need to delete them when program
+    // exits.
+    // glBufferDataARB with NULL pointer reserves only memory space.
+    pboIds = (GLuint *)malloc(PBO_COUNT * sizeof(GLuint));
+    glGenBuffersARB(PBO_COUNT, pboIds);
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[0]);
+    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3+sizeof(Time), 0,
+                    GL_STREAM_READ_ARB);
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[1]);
+    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3+sizeof(Time), 0,
+                    GL_STREAM_READ_ARB);
+
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
+  } else {
+    use_pbo = false;
+    buffer = (char *)malloc(width * height * 3+sizeof(Time));
+    Thread::Warn("GL_ARB_pixel_buffer_object is not suppoorted\n");
+  }
+  if (isGlExtensionSupported("GL_PACK_INVERT_MESA")) {
+    invert_pixel = false;
+    Thread::Warn("GL_PACK_INVERT_MESA is supported\n");
+  } else {
+    invert_pixel = true;
+  }
+}
+
+SimuCameraGL::~SimuCameraGL() {
+  if (use_pbo) {
+    glDeleteBuffersARB(PBO_COUNT, pboIds);
+    free(pboIds);
+  } else {
+    free(buffer);
+  }
+  camera->removeAnimator(this);
+  camera->drop();
+}
+
+void SimuCameraGL::setNearValue(float zn) { camera->setNearValue(zn); }
+
+void SimuCameraGL::setFarValue(float zf) { camera->setFarValue(zf); }
+
+void SimuCameraGL::UpdateFrom(const io_data *data) {
+  if (noGui() == false && data == NULL) {
+    smgr->setActiveCamera(camera);
+    smgr->getVideoDriver()->setViewPort(rect<s32>(x, y, x + width, y + height));
+    smgr->drawAll();
+    getImage();
+  }
+}
+
+void SimuCameraGL::getImage(void) {
+  if (disable_output)
+    return;
+  // convert from irrlicht top left origin to gl bottom left origin
+  int y = smgr->getVideoDriver()->getScreenSize().Height - height - this->y;
+
+  // We want to read the front buffer to get the latest render finished.
+  Time a = GetTime();
+  glReadBuffer(GL_FRONT);
+  if (use_pbo) // with PBO
+  {
+    // increment current index first then get the next index
+    // "index" is used to read pixels from a framebuffer to a PBO
+    // "nextIndex" is used to process pixels in the other PBO
+    index = (index + 1) % PBO_COUNT;
+    int nextIndex = (index + 1) % PBO_COUNT;
+
+    // copy pixels from framebuffer to PBO
+    // Use offset instead of pointer.
+    // OpenGL should perform asynch DMA transfer, so glReadPixels() will return
+    // immediately.
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[index]);
+    glReadPixels(x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, 0);
+    Time time=GetTime();
+    // map the PBO that contain framebuffer pixels before processing it
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[nextIndex]);
+    GLubyte *src = (GLubyte *)glMapBufferARB(
+        GL_PIXEL_PACK_BUFFER_ARB, GL_READ_WRITE_ARB); // GL_READ_ONLY_ARB);
+    if (src) {
+      putImage((char *)src,time);
+      glUnmapBufferARB(
+          GL_PIXEL_PACK_BUFFER_ARB); // release pointer to the mapped buffer
+    }
+    glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
+  } else {
+    glReadPixels(x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, buffer);
+    putImage(buffer,GetTime());
+  }
+
+  glReadBuffer(GL_BACK);
+  Time b = GetTime();
+  Time c = b - a;
+  // printf("%s %f\n",Thread::ObjectName().c_str(),(float)(c/1000000.));
+}
+
+void SimuCameraGL::putImage(char *buf,Time imageTime) {
+  if (invert_pixel == true) {
+    // opengl images are horizontally flipped, so we have to fix that here.
+    const s32 pitch = width * 3;
+    char *pixels = buf;
+    char *p2 = pixels + (height - 1) * pitch;
+    char *tmpBuffer = new char[pitch];
+    for (int i = 0; i < height; i += 2) {
+      memcpy(tmpBuffer, pixels, pitch);
+      memcpy(pixels, p2, pitch);
+      memcpy(p2, tmpBuffer, pitch);
+      pixels += pitch;
+      p2 -= pitch;
+    }
+    delete[] tmpBuffer;
+  }
+  memcpy(buf+width * height * 3,&imageTime,sizeof(Time));
+  shmem->Write(buf, width * height * 3+sizeof(Time));
+}
+
+void SimuCameraGL::animateNode(ISceneNode *node, u32 timeMs) {
+  ICameraSceneNode *camera = static_cast<ICameraSceneNode *>(node);
+
+  matrix4 m;
+  m.setRotationDegrees(Node()->getRotation());
+
+  // transform forward vector of camera
+  vector3df frv = ToIrrlichtCoordinates(direction->Value());
+  m.transformVect(frv);
+
+  // transform upvector of camera
+  vector3df upv = ToIrrlichtCoordinates(up->Value());
+  m.transformVect(upv);
+
+  // transform camera offset (thanks to Zeuss for finding it was missing)
+  vector3df offset = ToIrrlichtCoordinates(position->Value());
+  m.transformVect(offset);
+
+  // set camera
+  camera->setPosition(Node()->getPosition() +
+                      offset); // position camera in front of the ship
+  camera->setUpVector(upv);    // set up vector of camera >> Zeuss - tested with
+  // +node->getPostion() and it didnt work, but this
+  // works fine.
+  camera->setTarget(Node()->getPosition() + offset + frv); // set target of
+                                                           // camera (look at
+                                                           // point) >> Zeuss -
+                                                           // Dont forget to add
+                                                           // the node positiob
+
+  camera->setFOV(Euler::ToRadian(fov->Value()));
+}
+
+ISceneNodeAnimator *SimuCameraGL::createClone(ISceneNode *node,
+                                              ISceneManager *newManager) {
+  return NULL;
+}
+
+} // end namespace sensor
+} // end namespace flair
+#endif
Index: tags/latest/lib/FlairSimulator/src/SimuCameraGL.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuCameraGL.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuCameraGL.h	(revision 209)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuCameraGL.h
+ * \brief Class for a simulation camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/03/07
+ * \version 3.4
+ */
+
+#ifndef SIMUCAMERAGL_H
+#define SIMUCAMERAGL_H
+
+#include <SimuCamera.h>
+#include <SensorGL.h>
+#include <ISceneNodeAnimator.h>
+
+// in order to get function prototypes from glext.h, define GL_GLEXT_PROTOTYPES
+// before including glext.h
+#define GL_GLEXT_PROTOTYPES
+#include <GL/gl.h>
+
+namespace irr {
+namespace scene {
+class ICameraSceneNode;
+}
+}
+
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+class Vector3DSpinBox;
+}
+namespace simulator {
+class Model;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuCameraGL
+* \brief Class for a simulation camera
+*
+*/
+class SimuCameraGL : public SimuCamera,
+                     public SensorGL,
+                     public irr::scene::ISceneNodeAnimator {
+public:
+  // top left origin
+  SimuCameraGL(const simulator::Model *parent, std::string name, int width,
+               int height, int x, int y, uint32_t modelId,uint32_t deviceId);
+  ~SimuCameraGL();
+  //! Sets the value of the near clipping plane. (default: 1.0f)
+  /** \param zn: New z near value. */
+  void setNearValue(float zn);
+
+  //! Sets the value of the far clipping plane (default: 2000.0f)
+  /** \param zf: New z far value. */
+  void setFarValue(float zf);
+
+private:
+  void UpdateFrom(const core::io_data *data);
+  void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
+  ISceneNodeAnimator *createClone(irr::scene::ISceneNode *node,
+                                  irr::scene::ISceneManager *newManager = 0);
+  void getImage(void);
+  void putImage(char *pixels,core::Time imageTime);
+  irr::scene::ICameraSceneNode *camera;
+  irr::scene::ISceneManager *smgr;
+  gui::Vector3DSpinBox *position, *direction, *up;
+  gui::DoubleSpinBox *fov;
+  int width, height, x, y;
+  char *buffer;
+  bool use_pbo, invert_pixel, disable_output;
+  GLuint *pboIds;
+  int index;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // SIMUCAMERAGL_H
Index: tags/latest/lib/FlairSimulator/src/SimuLaserGL.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuLaserGL.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuLaserGL.cpp	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuUsGL.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "SimuLaserGL.h"
+#include "Model.h"
+#include "Gui.h"
+#include <cvmatrix.h>
+#include <SharedMem.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include <Vector3DSpinBox.h>
+#include <ISceneNode.h>
+#include <ISceneCollisionManager.h>
+
+using namespace irr;
+using namespace irr::scene;
+using namespace irr::core;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::simulator;
+
+namespace flair {
+namespace sensor {
+SimuLaserGL::SimuLaserGL(const Model *parent, std::string name, uint32_t modelId,uint32_t deviceId)
+    : SimuLaser(parent, name, modelId,deviceId), SensorGL(parent) {
+  Tab *setup_tab = new Tab(parent->GetTabWidget(), name);
+  position = new Vector3DSpinBox(setup_tab->NewRow(), "position", -2, 2, .01);
+  direction = new Vector3DSpinBox(setup_tab->NewRow(), "direction", -2, 2, .01);
+  range = new DoubleSpinBox(setup_tab->NewRow(), "range:", 0, 30, 1);
+}
+
+SimuLaserGL::~SimuLaserGL() {}
+
+void SimuLaserGL::UpdateFrom(const io_data *data) {
+  float value[360];
+
+  if (noGui() == false && data == NULL) {
+    for (int i = 0; i < 360; i++) {
+      line3d<f32> ray_laser;         // rayon provenant de l'ultra son
+      vector3df intersection_laser;  // point intersection us avec le sol
+      triangle3df hitTriangle_laser; // triangle intersection us avec le sol
+
+      // get rotation matrix of node - Zeuss must be getRotation not
+      // getRelativeTransformation
+      matrix4 m;
+      matrix4 M;
+      m.setRotationDegrees(Node()->getRotation());
+
+      // Matrice de rotation pour balayage du laser, angle i
+      M.setRotationDegrees(vector3df(0, 0, i));
+      // transform forward vector of us
+      vector3df frv = ToIrrlichtCoordinates(direction->Value());
+      M.transformVect(frv);
+      m.transformVect(frv);
+      frv.normalize();
+
+      // transform pos vector of us
+      vector3df pos = ToIrrlichtCoordinates(position->Value());
+      m.transformVect(pos);
+
+      ray_laser.start = Node()->getPosition() + pos;
+      ray_laser.end = ray_laser.start + ToIrrlichtScale(range->Value()) * frv;
+
+      scene::ISceneNode *selectedSceneNode =
+          CollMan()->getSceneNodeAndCollisionPointFromRay(
+              ray_laser, intersection_laser, hitTriangle_laser);
+      // //////////////////////////////////////////
+      if (selectedSceneNode) //
+      {
+        value[i] = ToSimulatorScale(
+            ray_laser.start.getDistanceFrom(intersection_laser));
+      } else {
+        value[i] = -1;
+      }
+    }
+    shmem->Write((char *)value, 360 * sizeof(float));
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+#endif
Index: tags/latest/lib/FlairSimulator/src/SimuLaserGL.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuLaserGL.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuLaserGL.h	(revision 209)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuUsGL.h
+ * \brief Class for a simulation us
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 3.4
+ */
+
+#ifndef SIMULASERGL_H
+#define SIMULASERGL_H
+
+#include <SimuLaser.h>
+#include <SensorGL.h>
+
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+class Vector3DSpinBox;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Model;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuUsGL
+* \brief Class for a simulation us
+*
+*/
+class SimuLaserGL : public SimuLaser, public SensorGL {
+public:
+  SimuLaserGL(const simulator::Model *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+  ~SimuLaserGL();
+
+private:
+  void UpdateFrom(const core::io_data *data);
+  gui::DoubleSpinBox *range;
+  gui::Vector3DSpinBox *position, *direction;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULASERGL_H
Index: tags/latest/lib/FlairSimulator/src/SimuUsGL.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 209)
@@ -0,0 +1,98 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimuUsGL.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#include "SimuUsGL.h"
+#include "Model.h"
+#include <cvmatrix.h>
+#include <SharedMem.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include <Vector3DSpinBox.h>
+
+#ifdef GL
+#include "Gui.h"
+#include <ISceneNode.h>
+#include <ISceneCollisionManager.h>
+using namespace irr;
+using namespace irr::scene;
+using namespace irr::core;
+#endif
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::simulator;
+
+namespace flair {
+namespace sensor {
+SimuUsGL::SimuUsGL(const Model *parent, std::string name, uint32_t modelId,uint32_t deviceId)
+    : SimuUs(parent, name, modelId,deviceId), SensorGL(parent) {
+  Tab *setup_tab = new Tab(parent->GetTabWidget(), name);
+  position = new Vector3DSpinBox(setup_tab->NewRow(), "position", -2, 2, .01);
+  direction = new Vector3DSpinBox(setup_tab->NewRow(), "direction", -2, 2, .01);
+  range = new DoubleSpinBox(setup_tab->NewRow(), "range:", 0, 1000, 1,0,6.);
+}
+
+SimuUsGL::~SimuUsGL() {}
+
+void SimuUsGL::UpdateFrom(const io_data *data) {
+  float value;
+#ifdef GL
+  if (noGui() == true) {
+#endif
+    // todo: utiliser le placement de l'us dans le drone et sa portée
+    cvmatrix *input = (cvmatrix *)data;
+    value = input->Value(9, 0);
+    shmem->Write((char *)&value, sizeof(float));
+#ifdef GL
+  }
+
+  if (noGui() == false && data == NULL) {
+    line3d<f32> ray_us;         // rayon provenant de l'ultra son
+    vector3df intersection_us;  // point intersection us avec le sol
+    triangle3df hitTriangle_us; // triangle intersection us avec le sol
+
+    // get rotation matrix of node - Zeuss must be getRotation not
+    // getRelativeTransformation
+    matrix4 m;
+    m.setRotationDegrees(Node()->getRotation());
+
+    // transform forward vector of us
+    vector3df frv = ToIrrlichtCoordinates(direction->Value());
+    m.transformVect(frv);
+    frv.normalize();
+
+    // transform pos vector of us
+    vector3df pos = ToIrrlichtCoordinates(position->Value());
+    m.transformVect(pos);
+
+    ray_us.start = Node()->getPosition() + pos;
+    ray_us.end = ray_us.start + ToIrrlichtScale(range->Value()) * frv;
+
+    scene::ISceneNode *selectedSceneNode =
+        CollMan()->getSceneNodeAndCollisionPointFromRay(ray_us, intersection_us,
+                                                        hitTriangle_us);
+
+    if (selectedSceneNode) {
+      float value =
+          ToSimulatorScale(ray_us.start.getDistanceFrom(intersection_us));
+      shmem->Write((char *)&value, sizeof(float));
+    }
+  }
+#endif
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/lib/FlairSimulator/src/SimuUsGL.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/SimuUsGL.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/SimuUsGL.h	(revision 209)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimuUsGL.h
+ * \brief Class for a simulation us
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 3.4
+ */
+
+#ifndef SIMUUSGL_H
+#define SIMUUSGL_H
+
+#include <SimuUs.h>
+#include <SensorGL.h>
+
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+class Vector3DSpinBox;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Model;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimuUsGL
+* \brief Class for a simulation us
+*
+*/
+class SimuUsGL : public SimuUs, public SensorGL {
+public:
+  SimuUsGL(const simulator::Model *parent, std::string name, uint32_t modelId,uint32_t deviceId);
+  ~SimuUsGL();
+
+private:
+  void UpdateFrom(const core::io_data *data);
+  gui::DoubleSpinBox *range;
+  gui::Vector3DSpinBox *position, *direction;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMUUSGL_H
Index: tags/latest/lib/FlairSimulator/src/Simulator.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Simulator.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Simulator.cpp	(revision 209)
@@ -0,0 +1,73 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Simulator.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base du Simulator
+//
+/*********************************************************************/
+
+#include "Simulator.h"
+#include "Simulator_impl.h"
+#include "Euler.h"
+#include "Quaternion.h"
+#include "Vector3D.h"
+#ifdef GL
+#include "Gui.h"
+#endif
+
+using namespace std;
+using namespace flair::core;
+
+namespace {
+flair::simulator::Simulator *simu = NULL;
+}
+
+namespace flair {
+namespace simulator {
+
+Simulator *getSimulator(void) { return simu; }
+
+Simulator::Simulator(string name, int optitrack_mstime, float yaw_deg)
+    : FrameworkManager(name) {
+  if (simu != NULL)
+    Err("Simulator should be instanced only one time\n");
+
+  pimpl_ = new Simulator_impl(this, optitrack_mstime, yaw_deg);
+  simu = this;
+}
+
+Simulator::~Simulator() { delete pimpl_; }
+
+Quaternion Simulator::ToVRPNReference(Quaternion quat_in) {
+  Quaternion yaw_rot_quat;
+  Euler yaw_rot_euler(
+      0, 0, -pimpl_->yaw_rad); // yaw_rad is vrpn rotation in earth reference
+  yaw_rot_euler.ToQuaternion(yaw_rot_quat);
+
+  return yaw_rot_quat * quat_in;
+}
+
+Vector3D<double> Simulator::ToVRPNReference(Vector3D<double> point_in) {
+  Quaternion yaw_rot_quat;
+  Euler yaw_rot_euler(
+      0, 0, -pimpl_->yaw_rad); // yaw_rad is vrpn rotation in earth reference
+  yaw_rot_euler.ToQuaternion(yaw_rot_quat);
+  point_in.Rotate(yaw_rot_quat);
+
+  return point_in;
+}
+
+float Simulator::Yaw(void) const { return pimpl_->yaw_rad; }
+
+void Simulator::RunSimu(void) { pimpl_->RunSimu(); }
+
+} // end namespace simulator
+} // end namespace flair
Index: tags/latest/lib/FlairSimulator/src/Simulator.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/Simulator.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Simulator.h	(revision 209)
@@ -0,0 +1,71 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Simulator.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base du simulateur
+//
+/*********************************************************************/
+
+#ifndef SIMULATOR_H
+#define SIMULATOR_H
+
+#include <FrameworkManager.h>
+#include <Vector3D.h>
+#include <stdint.h>
+
+class Simulator_impl;
+class Model_impl;
+
+namespace flair {
+namespace core {
+class Quaternion;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Model;
+class Gui;
+
+class Simulator : public core::FrameworkManager {
+  friend class ::Model_impl;
+  friend class Gui;
+  friend class GenericObject;
+
+public:
+  // yaw_deg: rotation of the vrpn coordinate with respect to the earth
+  // coordinate, around z axis
+  Simulator(std::string name, int optitrack_mstime = 10, float yaw_deg = 30);
+  ~Simulator();
+  void RunSimu(void);
+  // get rotation of the vrpn coordinate with respect to the earth coordinate,
+  // around z axis; in radians
+  float Yaw(void) const;
+  // compute rotation of the vrpn coordinate with respect to the earth
+  // coordinate, around z axis
+  core::Quaternion ToVRPNReference(core::Quaternion quat_in);
+  core::Vector3D<double> ToVRPNReference(core::Vector3D<double> point_in);
+
+private:
+  Simulator_impl *pimpl_;
+};
+
+/*!
+* \brief get Simulator
+*
+* \return the Simulator
+*/
+Simulator *getSimulator(void);
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // SIMULATOR_H
Index: tags/latest/lib/FlairSimulator/src/Simulator_impl.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/Simulator_impl.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/Simulator_impl.cpp	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Simulator_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base du Simulator
+//
+/*********************************************************************/
+
+#include "Simulator_impl.h"
+#include "Simulator.h"
+#include "Euler.h"
+#ifdef GL
+#include "Gui.h"
+#include "Gui_impl.h"
+#include <ISceneManager.h>
+#endif
+#include "Model.h"
+#include "Model_impl.h"
+#include <unistd.h>
+
+using namespace flair::core;
+using namespace flair::simulator;
+
+Simulator_impl::Simulator_impl(Simulator *self, int optitrack_mstime,
+                               float yaw_deg)
+    : vrpn_Connection_IP(), Thread(self, "simulator", 1) {
+  this->self = self;
+  this->optitrack_mstime = optitrack_mstime;
+  yaw_rad = Euler::ToRadian(yaw_deg);
+}
+
+Simulator_impl::~Simulator_impl() {
+  // printf("del Simulator_impl\n");
+
+  SafeStop();
+  Join();
+
+  for (size_t i = 0; i < models.size(); i++) {
+    models.at(i)->pimpl_->SafeStop();
+    models.at(i)->pimpl_->Join();
+#ifdef GL
+    getGui()->getSceneManager()->getRootSceneNode()->removeChild(models.at(i)->pimpl_);
+#endif
+    delete models.at(i);
+  }
+
+#ifdef GL
+  if (getGui() != NULL)
+    delete getGui();
+#endif
+
+  // printf("del Simulator_impl ok\n");
+}
+
+void Simulator_impl::Run(void) {
+  SetPeriodMS(optitrack_mstime);
+
+  while (ToBeStopped() == false) {
+    WaitPeriod();
+    // printf("%lld\n",GetTime());
+    mainloop();
+    for (size_t i = 0; i < models.size(); i++) {
+      models.at(i)->pimpl_->mainloop();
+    }
+  }
+}
+
+void Simulator_impl::RunSimu(void) {
+  if (models.size() == 0) {
+    self->Err("No model to run\n");
+    return;
+  }
+
+  for (size_t i = 0; i < models.size(); i++) {
+    models.at(i)->pimpl_->Start();
+  }
+
+  Start();
+
+#ifdef GL
+  if (getGui() != NULL) {
+    getGui()->pimpl_->RunGui(models, objects);
+  } else
+#endif
+  {
+    models.at(0)->pimpl_->Join();
+  }
+
+  SafeStop();
+  Join();
+}
Index: tags/latest/lib/FlairSimulator/src/VisualizationCamera.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/VisualizationCamera.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/VisualizationCamera.cpp	(revision 209)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/01
+//  filename:   VisualizationCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class for a visualization camera in the gui
+//
+/*********************************************************************/
+#ifdef GL
+
+#include "VisualizationCamera.h"
+#include "Simulator.h"
+#include "Model.h"
+#include "Model_impl.h"
+#include "Gui.h"
+#include "Gui_impl.h"
+#include <ICursorControl.h>
+#include <ICameraSceneNode.h>
+#include <IrrlichtDevice.h>
+#include <ISceneManager.h>
+
+using namespace irr;
+using namespace gui;
+using namespace core;
+using namespace scene;
+
+namespace flair {
+namespace simulator {
+
+VisualizationCamera::VisualizationCamera(std::string inName) {
+  name=inName;
+  currentZoom = 0;
+  LMouseKey = false;
+
+   // camera
+  camera = getGui()->getSceneManager()->addCameraSceneNode();
+  camera->setAspectRatio(getGui()->getAspectRatio()); // on force a cause du view port
+  camera->setUpVector(vector3df(0, 0, 1));
+  camera->addAnimator(this);
+  camera->setFarValue(8000);
+
+  getGui()->pimpl_->AddVisualizationCamera(this);
+}
+
+VisualizationCamera::~VisualizationCamera() {}
+
+std::string VisualizationCamera::getName(void) {
+  return name;
+}
+
+ICameraSceneNode *VisualizationCamera::getCameraSceneNode(void) {
+  return camera;
+}
+
+ISceneNodeAnimator *VisualizationCamera::createClone(ISceneNode *node,
+                                               ISceneManager *newManager) {
+  return NULL;
+}
+
+bool VisualizationCamera::OnEvent(const irr::SEvent& event) {
+  if (event.EventType != EET_MOUSE_INPUT_EVENT)
+    return false;
+
+  switch (event.MouseInput.Event) {
+
+  case EMIE_MOUSE_WHEEL:
+    currentZoom -= event.MouseInput.Wheel;
+    break;
+  case EMIE_LMOUSE_PRESSED_DOWN:
+    LMouseKey = true;
+    break;
+  case EMIE_LMOUSE_LEFT_UP:
+    LMouseKey = false;
+    break;
+  case EMIE_MOUSE_MOVED:
+    MousePos = getGui()->getDevice()->getCursorControl()->getRelativePosition();
+    break;
+  default:
+    return false;
+    break;
+  }
+
+  return true;
+}
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // GL
Index: tags/latest/lib/FlairSimulator/src/VisualizationCamera.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/VisualizationCamera.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/VisualizationCamera.h	(revision 209)
@@ -0,0 +1,59 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/01
+//  filename:   VisualizationCamera.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    cclass for a visualization camera in the gui
+//
+/*********************************************************************/
+
+#ifndef VISUALIZATIONCAMERA_H
+#define VISUALIZATIONCAMERA_H
+
+#include <ISceneNodeAnimator.h>
+#include <position2d.h>
+#include <Vector3D.h>
+#include <string>
+
+namespace irr {
+  namespace scene {
+    class ICameraSceneNode;
+  }
+}
+
+namespace flair {
+namespace simulator {
+
+class VisualizationCamera : private irr::scene::ISceneNodeAnimator {
+public:
+  VisualizationCamera(std::string name);
+  ~VisualizationCamera();
+
+  ISceneNodeAnimator *createClone(irr::scene::ISceneNode *node,
+                                  irr::scene::ISceneManager *newManager = 0);
+  virtual bool OnEvent(const irr::SEvent& event);
+  irr::scene::ICameraSceneNode *getCameraSceneNode(void);
+  std::string getName(void);
+
+private:
+  virtual bool isEventReceiverEnabled(void) const { return true; }
+
+protected:
+  bool LMouseKey;
+  irr::scene::ICameraSceneNode *camera;
+  irr::core::position2df MousePos;
+  float currentZoom;
+  std::string name;
+};
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // VISUALIZATIONCAMERA_H
Index: tags/latest/lib/FlairSimulator/src/X4.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/X4.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/X4.cpp	(revision 209)
@@ -0,0 +1,334 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/21
+//  filename:   X4.cpp
+//
+//  author:     Osamah Saif, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un x4
+//
+/*********************************************************************/
+
+#include "X4.h"
+#include <SimuBldc.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <math.h>
+#ifdef GL
+#include <ISceneManager.h>
+#include "Blade.h"
+#include "MeshSceneNode.h"
+#include "Gui.h"
+#include <Mutex.h>
+#endif
+
+#define K_MOT 0.4f    // blade animation
+#define G (float)9.81 // gravity ( N/(m/s²) )
+
+#ifdef GL
+using namespace irr::video;
+using namespace irr::scene;
+using namespace irr::core;
+#endif
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::actuator;
+
+namespace flair {
+namespace simulator {
+
+X4::X4(std::string name, uint32_t modelId)
+    : Model(name,modelId) {
+  Tab *setup_tab = new Tab(GetTabWidget(), "model");
+  m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1);
+  arm_length = new DoubleSpinBox(setup_tab->LastRowLastCol(), "arm length (m):",
+                                 0, 2, 0.1);
+  // l_cg=new DoubleSpinBox(setup_tab,"position G
+  // (m):",0,2,-0.5,0.5,0.02);//position du centre de gravité/centre de poussé
+  k_mot =
+      new DoubleSpinBox(setup_tab->NewRow(), "k_mot:", 0, 1, 0.001,
+                        3); // vitesse rotation² (unité arbitraire) -> force (N)
+  c_mot = new DoubleSpinBox(
+      setup_tab->LastRowLastCol(), "c_mot:", 0, 1, 0.001,
+      3); // vitesse rotation moteur -> couple (N.m/unité arbitraire)
+  f_air_vert = new DoubleSpinBox(setup_tab->NewRow(), "f_air_vert:", 0, 10,
+                                 1); // frottements air depl. vertical, aussi
+                                     // utilisé pour les rotations ( N/(m/s) )
+                                     // (du aux helices en rotation)
+  f_air_lat =
+      new DoubleSpinBox(setup_tab->LastRowLastCol(), "f_air_lat:", 0, 10,
+                        1); // frottements air deplacements lateraux ( N/(m/s) )
+  j_roll = new DoubleSpinBox(setup_tab->NewRow(), "j_roll:", 0, 1, 0.001,
+                             5); // moment d'inertie d'un axe (N.m.s²/rad)
+  j_pitch =
+      new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_pitch:", 0, 1, 0.001,
+                        5); // moment d'inertie d'un axe (N.m.s²/rad)
+  j_yaw = new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_yaw:", 0, 1, 0.001,
+                            5); // moment d'inertie d'un axe (N.m.s²/rad)
+
+  motors = new SimuBldc(this, name, 4, modelId,0);
+  
+  SetIsReady(true);
+}
+
+X4::~X4() {
+  // les objets irrlicht seront automatiquement detruits (moteurs, helices,
+  // pales) par parenté
+}
+
+#ifdef GL
+
+void X4::Draw(void) {
+  // create unite (1m=100cm) UAV; scale will be adapted according to arm_length
+  // parameter
+  // note that the frame used is irrlicht one:
+  // left handed, North East Up
+  const IGeometryCreator *geo;
+  geo = getGui()->getSceneManager()->getGeometryCreator();
+
+  // cylinders are aligned with y axis
+  IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
+  IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
+  IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
+  // geo->drop();
+
+  ITexture *texture = getGui()->getTexture("carbone.jpg");
+  MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, -135));
+  MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, -45));
+  MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, 135), texture);
+  MeshSceneNode *rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, 45), texture);
+
+  texture = getGui()->getTexture("metal047.jpg");
+  MeshSceneNode *fl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
+                               vector3df(90, 0, 0), texture);
+  MeshSceneNode *fr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
+                               vector3df(90, 0, 0), texture);
+  MeshSceneNode *rl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
+                               vector3df(90, 0, 0), texture);
+  MeshSceneNode *rr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
+                               vector3df(90, 0, 0), texture);
+
+  fl_blade = new Blade(this, vector3df(70.71, -70.71, 17.5));
+  fr_blade = new Blade(this, vector3df(70.71, 70.71, 17.5), true);
+  rl_blade = new Blade(this, vector3df(-70.71, -70.71, 17.5), true);
+  rr_blade = new Blade(this, vector3df(-70.71, 70.71, 17.5));
+
+  motor_speed_mutex = new Mutex(this);
+  for (int i = 0; i < 4; i++)
+    motor_speed[i] = 0;
+  ExtraDraw();
+}
+
+void X4::AnimateModel(void) {
+  motor_speed_mutex->GetMutex();
+  fl_blade->SetRotationSpeed(K_MOT * motor_speed[0]);
+  fr_blade->SetRotationSpeed(-K_MOT * motor_speed[1]);
+  rl_blade->SetRotationSpeed(-K_MOT * motor_speed[2]);
+  rr_blade->SetRotationSpeed(K_MOT * motor_speed[3]);
+  motor_speed_mutex->ReleaseMutex();
+
+  // adapt UAV size
+  if (arm_length->ValueChanged() == true) {
+    setScale(arm_length->Value());
+  }
+}
+
+size_t X4::dbtSize(void) const {
+  return 6 * sizeof(float) + 4 * sizeof(float); // 6ddl+4helices
+}
+
+void X4::WritedbtBuf(
+    char *dbtbuf) { /*
+                       float *buf=(float*)dbtbuf;
+                       vector3df vect=getPosition();
+                       memcpy(buf,&vect.X,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Y,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Z,sizeof(float));
+                       buf++;
+                       vect=getRotation();
+                       memcpy(buf,&vect.X,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Y,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Z,sizeof(float));
+                       buf++;
+                       memcpy(buf,&motors,sizeof(rtsimu_motors));*/
+}
+
+void X4::ReaddbtBuf(
+    char *dbtbuf) { /*
+                       float *buf=(float*)dbtbuf;
+                       vector3df vect;
+                       memcpy(&vect.X,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Y,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Z,buf,sizeof(float));
+                       buf++;
+                       setPosition(vect);
+                       memcpy(&vect.X,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Y,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Z,buf,sizeof(float));
+                       buf++;
+                       ((ISceneNode*)(this))->setRotation(vect);
+                       memcpy(&motors,buf,sizeof(rtsimu_motors));
+                       AnimateModele();*/
+}
+#endif // GL
+
+// states are computed on fixed frame NED
+// x north
+// y east
+// z down
+void X4::CalcModel(void) {
+  float fl_speed, fr_speed, rl_speed, rr_speed;
+  float u_roll, u_pitch, u_yaw, u_thrust;
+#ifdef GL
+  motor_speed_mutex->GetMutex();
+#endif // GL
+  motors->GetSpeeds(motor_speed);
+#ifdef GL
+  motor_speed_mutex->ReleaseMutex();
+#endif // GL
+  fl_speed = motor_speed[0];
+  fr_speed = motor_speed[1];
+  rl_speed = motor_speed[2];
+  rr_speed = motor_speed[3];
+
+  /*
+      ** ===================================================================
+      **    u roll: roll torque
+      **
+      ** ===================================================================
+      */
+  u_roll = arm_length->Value() * k_mot->Value() *
+           (fl_speed * fl_speed + rl_speed * rl_speed - fr_speed * fr_speed -
+            rr_speed * rr_speed) *
+           sqrtf(2) / 2;
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_x angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  state[0].W.x =
+      (dT() / j_roll->Value()) *
+          ((j_yaw->Value() - j_pitch->Value()) * state[-1].W.y * state[-1].W.z +
+           u_roll) +
+      state[-1].W.x;
+
+  // u_roll=arm_length->Value()*k_mot->Value()*(fl_speed*fl_speed+rl_speed*rl_speed-fr_speed*fr_speed-rr_speed*rr_speed)*sqrtf(2)/2;
+  // state[0].W.x=(dT()/j_roll->Value())*(u_roll-m->Value()*G*l_cg->Value()*sinf(state[-2].W.x)-f_air_vert->Value()*arm_length->Value()*arm_length->Value()*state[-1].W.x)+state[-1].W.x;
+
+  /*
+  ** ===================================================================
+  **   u pitch : pitch torque
+  **
+  ** ===================================================================
+  */
+  u_pitch = arm_length->Value() * k_mot->Value() *
+            (fl_speed * fl_speed + fr_speed * fr_speed - rl_speed * rl_speed -
+             rr_speed * rr_speed) *
+            sqrtf(2) / 2;
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_y angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  state[0].W.y =
+      (dT() / j_pitch->Value()) *
+          ((j_roll->Value() - j_yaw->Value()) * state[-1].W.x * state[-1].W.z +
+           u_pitch) +
+      state[-1].W.y;
+
+  // u_pitch=arm_length->Value()*k_mot->Value()*(fl_speed*fl_speed+fr_speed*fr_speed-rl_speed*rl_speed-rr_speed*rr_speed)*sqrtf(2)/2;
+  // state[0].W.y=(dT()/j_pitch->Value())*(u_pitch-m->Value()*G*l_cg->Value()*sinf(state[-2].W.y)-f_air_vert->Value()*arm_length->Value()*arm_length->Value()*state[-1].W.y)+state[-1].W.y;
+
+  /*
+  ** ===================================================================
+  **    u yaw : yaw torque
+  **
+  ** ===================================================================
+  */
+  u_yaw = c_mot->Value() * (fl_speed * fl_speed + rr_speed * rr_speed -
+                            fr_speed * fr_speed - rl_speed * rl_speed);
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_z angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  state[0].W.z = (dT() / j_yaw->Value()) * u_yaw + state[-1].W.z;
+
+  // u_yaw=c_mot->Value()*(fl_speed*fl_speed+rr_speed*rr_speed-fr_speed*fr_speed-rl_speed*rl_speed);
+  // state[0].W.z=(dT()/j_yaw->Value())*(u_yaw-f_air_lat->Value()*state[-1].W.z)+state[-1].W.z;
+
+  // compute quaternion from W
+  // Quaternion derivative: dQ = 0.5*(Q*Qw)
+  Quaternion dQ = state[-1].Quat.GetDerivative(state[0].W);
+
+  // Quaternion integration
+  state[0].Quat = state[-1].Quat + dQ * dT();
+  state[0].Quat.Normalize();
+
+  // Calculation of the thrust from the reference speed of motors
+  u_thrust = k_mot->Value() * (fl_speed * fl_speed + fr_speed * fr_speed +
+                               rl_speed * rl_speed + rr_speed * rr_speed);
+  Vector3D<double> vect(0, 0, -u_thrust);
+  vect.Rotate(state[0].Quat);
+
+  /*
+      ** ===================================================================
+      **     x double integrator
+      **
+      ** ===================================================================
+      */
+      
+  state[0].Pos.x =
+      (dT() * dT() / m->Value()) *
+          (vect.x - f_air_lat->Value() * (state[-1].Pos.x - state[-2].Pos.x) / dT()) +
+      2 * state[-1].Pos.x - state[-2].Pos.x;
+  state[0].Vel.x = (state[0].Pos.x - state[-1].Pos.x) / dT();
+ 
+  /*
+  ** ===================================================================
+  **     y double integrator
+  **
+  ** ===================================================================
+  */
+  state[0].Pos.y =
+      (dT() * dT() / m->Value()) *
+          (vect.y -
+           f_air_lat->Value() * (state[-1].Pos.y - state[-2].Pos.y) / dT()) +
+      2 * state[-1].Pos.y - state[-2].Pos.y;
+  state[0].Vel.y = (state[0].Pos.y - state[-1].Pos.y) / dT();
+
+  /*
+  ** ===================================================================
+  **     z double integrator
+  **
+  ** ===================================================================
+  */
+  state[0].Pos.z =
+      (dT() * dT() / m->Value()) *
+          (vect.z +
+           f_air_vert->Value() * (state[-1].Pos.z - state[-2].Pos.z) / dT() +
+           m->Value() * G) +
+      2 * state[-1].Pos.z - state[-2].Pos.z;
+  state[0].Vel.z = (state[0].Pos.z - state[-1].Pos.z) / dT();
+
+#ifndef GL
+  if (state[0].Pos.z < 0)
+    state[0].Pos.z = 0;
+#endif
+}
+
+} // end namespace simulator
+} // end namespace flair
Index: tags/latest/lib/FlairSimulator/src/X4.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/X4.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/X4.h	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/21
+//  filename:   X4.h
+//
+//  author:     Osamah Saif, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un x4
+//
+/*********************************************************************/
+
+#ifndef X4_H
+#define X4_H
+
+#include <Model.h>
+
+namespace flair {
+namespace core {
+class Mutex;
+}
+namespace gui {
+class DoubleSpinBox;
+}
+namespace actuator {
+class SimuBldc;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Blade;
+
+class X4 : public Model {
+public:
+  X4(std::string name, uint32_t modelId);
+  ~X4();
+#ifdef GL
+  virtual void Draw(void);
+  virtual void ExtraDraw(void){};
+
+protected:
+  Blade *fl_blade, *fr_blade, *rl_blade, *rr_blade;
+  core::Mutex *motor_speed_mutex;
+#endif
+private:
+  void CalcModel(void);
+#ifdef GL
+  void AnimateModel(void);
+  size_t dbtSize(void) const;
+  void WritedbtBuf(char *dbtbuf);
+  void ReaddbtBuf(char *dbtbuf);
+#endif
+
+  actuator::SimuBldc *motors;
+  float motor_speed[4];
+  gui::DoubleSpinBox *m, *arm_length, *l_cg;
+  gui::DoubleSpinBox *k_mot, *c_mot;
+  gui::DoubleSpinBox *f_air_vert, *f_air_lat;
+  gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // X4_H
Index: tags/latest/lib/FlairSimulator/src/X8.cpp
===================================================================
--- tags/latest/lib/FlairSimulator/src/X8.cpp	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/X8.cpp	(revision 209)
@@ -0,0 +1,391 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/03
+//  filename:   X8.cpp
+//
+//  author:     Majd Saied, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un X8
+//
+/*********************************************************************/
+
+#include "X8.h"
+#include <SimuBldc.h>
+#include <TabWidget.h>
+#include <Tab.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <math.h>
+#ifdef GL
+#include <ISceneManager.h>
+#include "Blade.h"
+#include "MeshSceneNode.h"
+#include "Gui.h"
+#include <Mutex.h>
+#endif
+
+#define K_MOT 0.4f    // blade animation
+#define G (float)9.81 // gravity ( N/(m/s²) )
+
+#ifdef GL
+using namespace irr::video;
+using namespace irr::scene;
+using namespace irr::core;
+#endif
+using namespace flair::core;
+using namespace flair::gui;
+using namespace flair::actuator;
+
+namespace flair {
+namespace simulator {
+
+X8::X8(std::string name, uint32_t modelId): Model( name,modelId) {
+  Tab *setup_tab = new Tab(GetTabWidget(), "model");
+  m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1);
+  arm_length = new DoubleSpinBox(setup_tab->LastRowLastCol(), "arm length (m):",
+                                 0, 2, 0.1);
+  l_cg = new DoubleSpinBox(
+      setup_tab->LastRowLastCol(), "position G (m):", -0.5, 0.5,
+      0.02); // position du centre de gravité/centre de poussé
+  k_mot =
+      new DoubleSpinBox(setup_tab->NewRow(), "k_mot:", 0, 1, 0.001,
+                        3); // vitesse rotation² (unité arbitraire) -> force (N)
+  c_mot = new DoubleSpinBox(
+      setup_tab->LastRowLastCol(), "c_mot:", 0, 1, 0.001,
+      3); // vitesse rotation moteur -> couple (N.m/unité arbitraire)
+  f_air_vert = new DoubleSpinBox(setup_tab->NewRow(), "f_air_vert:", 0, 10,
+                                 1); // frottements air depl. vertical, aussi
+                                     // utilisé pour les rotations ( N/(m/s) )
+                                     // (du aux helices en rotation)
+  f_air_lat =
+      new DoubleSpinBox(setup_tab->LastRowLastCol(), "f_air_lat:", 0, 10,
+                        1); // frottements air deplacements lateraux ( N/(m/s) )
+  j_roll = new DoubleSpinBox(setup_tab->NewRow(), "j_roll:", 0, 1, 0.001,
+                             5); // moment d'inertie d'un axe (N.m.s²/rad)
+  j_pitch =
+      new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_pitch:", 0, 1, 0.001,
+                        5); // moment d'inertie d'un axe (N.m.s²/rad)
+  j_yaw = new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_yaw:", 0, 1, 0.001,
+                            5); // moment d'inertie d'un axe (N.m.s²/rad)
+  j_r = new DoubleSpinBox(setup_tab->NewRow(), "j_r:", 0, 1,
+                          0.001); // moment des helices (N.m.s²/rad)
+  sigma = new DoubleSpinBox(
+      setup_tab->LastRowLastCol(), "sigma:", 0, 1,
+      0.1); // coefficient de perte d efficacite aerodynamique (sans unite)
+  S = new DoubleSpinBox(
+      setup_tab->LastRowLastCol(), "S:", 1, 2,
+      0.1); // coefficient de forme des helices 1<S=1+Ss/Sprop<2 (sans unite)
+
+  motors = new SimuBldc(this, name, 8, modelId,0);
+  
+  SetIsReady(true);
+}
+
+void X8::Draw() {
+#ifdef GL
+
+  // create unite (1m=100cm) UAV; scale will be adapted according to arm_length
+  // parameter
+  // note that the frame used is irrlicht one:
+  // left handed, North East Up
+
+  const IGeometryCreator *geo;
+  geo = getGui()->getSceneManager()->getGeometryCreator();
+
+  // cylinders are aligned with y axis
+  IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
+  IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
+  IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
+  // geo->drop();
+
+  ITexture *texture = getGui()->getTexture("carbone.jpg");
+  MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, -135));
+  MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, -45));
+  MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, 135), texture);
+  MeshSceneNode *rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
+                             vector3df(0, 0, 45), texture);
+
+  texture = getGui()->getTexture("metal047.jpg");
+  MeshSceneNode *tfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *tfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *trl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *trr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
+                                vector3df(90, 0, 0), texture);
+
+  MeshSceneNode *bfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, -17.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *bfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, -17.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *brl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, -17.5),
+                                vector3df(90, 0, 0), texture);
+  MeshSceneNode *brr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, -17.5),
+                                vector3df(90, 0, 0), texture);
+
+  tfl_blade = new Blade(this, vector3df(70.71, -70.71, 17.5));
+  tfr_blade = new Blade(this, vector3df(70.71, 70.71, 17.5), true);
+  trl_blade = new Blade(this, vector3df(-70.71, -70.71, 17.5), true);
+  trr_blade = new Blade(this, vector3df(-70.71, 70.71, 17.5));
+
+  bfl_blade = new Blade(this, vector3df(70.71, -70.71, -17.5));
+  bfr_blade = new Blade(this, vector3df(70.71, 70.71, -17.5), true);
+  brl_blade = new Blade(this, vector3df(-70.71, -70.71, -17.5), true);
+  brr_blade = new Blade(this, vector3df(-70.71, 70.71, -17.5));
+
+  motor_speed_mutex = new Mutex(this);
+  for (int i = 0; i < 8; i++)
+    motor_speed[i] = 0;
+  ExtraDraw();
+#endif
+}
+
+X8::~X8() {
+  // les objets irrlicht seront automatiquement detruits (moteurs, helices,
+  // pales) par parenté
+}
+
+#ifdef GL
+void X8::AnimateModel(void) {
+  motor_speed_mutex->GetMutex();
+  tfl_blade->SetRotationSpeed(K_MOT * motor_speed[0]);
+  tfr_blade->SetRotationSpeed(-K_MOT * motor_speed[1]);
+  trl_blade->SetRotationSpeed(-K_MOT * motor_speed[2]);
+  trr_blade->SetRotationSpeed(K_MOT * motor_speed[3]);
+
+  bfl_blade->SetRotationSpeed(-K_MOT * motor_speed[4]);
+  bfr_blade->SetRotationSpeed(K_MOT * motor_speed[5]);
+  brl_blade->SetRotationSpeed(K_MOT * motor_speed[6]);
+  brr_blade->SetRotationSpeed(-K_MOT * motor_speed[7]);
+  motor_speed_mutex->ReleaseMutex();
+
+  // adapt UAV size
+  if (arm_length->ValueChanged() == true) {
+    setScale(arm_length->Value());
+  }
+}
+
+size_t X8::dbtSize(void) const {
+  return 6 * sizeof(float) + 4 * sizeof(float); // 6ddl+4helices
+}
+
+void X8::WritedbtBuf(
+    char *dbtbuf) { /*
+                       float *buf=(float*)dbtbuf;
+                       vector3df vect=getPosition();
+                       memcpy(buf,&vect.X,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Y,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Z,sizeof(float));
+                       buf++;
+                       vect=getRotation();
+                       memcpy(buf,&vect.X,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Y,sizeof(float));
+                       buf++;
+                       memcpy(buf,&vect.Z,sizeof(float));
+                       buf++;
+                       memcpy(buf,&motors,sizeof(rtsimu_motors));*/
+}
+
+void X8::ReaddbtBuf(
+    char *dbtbuf) { /*
+                       float *buf=(float*)dbtbuf;
+                       vector3df vect;
+                       memcpy(&vect.X,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Y,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Z,buf,sizeof(float));
+                       buf++;
+                       setPosition(vect);
+                       memcpy(&vect.X,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Y,buf,sizeof(float));
+                       buf++;
+                       memcpy(&vect.Z,buf,sizeof(float));
+                       buf++;
+                       ((ISceneNode*)(this))->setRotation(vect);
+                       memcpy(&motors,buf,sizeof(rtsimu_motors));
+                       AnimateModele();*/
+}
+#endif // GL
+
+// states are computed on fixed frame NED
+// x north
+// y east
+// z down
+void X8::CalcModel(void) {
+  float tfl_speed, tfr_speed, trl_speed, trr_speed;
+  float bfl_speed, bfr_speed, brl_speed, brr_speed;
+  float u_roll, u_pitch, u_yaw, u_thrust;
+  float omega;
+#ifdef GL
+  motor_speed_mutex->GetMutex();
+#endif // GL
+  motors->GetSpeeds(motor_speed);
+#ifdef GL
+  motor_speed_mutex->ReleaseMutex();
+#endif // GL
+  tfl_speed = motor_speed[0];
+  tfr_speed = motor_speed[1];
+  trl_speed = motor_speed[2];
+  trr_speed = motor_speed[3];
+  bfl_speed = motor_speed[4];
+  bfr_speed = motor_speed[5];
+  brl_speed = motor_speed[6];
+  brr_speed = motor_speed[7];
+
+  omega = tfl_speed + brl_speed + trr_speed + bfr_speed - bfl_speed -
+          trl_speed - brr_speed - tfr_speed;
+
+  /*
+      ** ===================================================================
+      **    u roll: roll torque
+      **
+      ** ===================================================================
+      */
+
+  u_roll = arm_length->Value() * k_mot->Value() *
+           (sigma->Value() * tfl_speed * tfl_speed + bfl_speed * bfl_speed +
+            sigma->Value() * trl_speed * trl_speed + brl_speed * brl_speed -
+            sigma->Value() * tfr_speed * tfr_speed - bfr_speed * bfr_speed -
+            sigma->Value() * trr_speed * trr_speed - brr_speed * brr_speed) *
+           sqrtf(2) / 2;
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_x angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  // state[0].W.x=(dT()/j_roll->Value())*((j_yaw->Value()-j_pitch->Value())*state[-1].W.y*state[-1].W.z-j_r->Value()*state[-1].W.y*omega
+  // + u_roll) +state[-1].W.x;//Osamah
+  state[0].W.x =
+      (dT() / j_roll->Value()) *
+          ((j_pitch->Value() - j_yaw->Value()) * state[-1].W.y * state[-1].W.z -
+           j_r->Value() * state[-1].W.y * omega + u_roll) +
+      state[-1].W.x; // Majd
+
+  // state[0].W.x=(dT()/j_roll->Value())*(u_roll-m->Value()*G*l_cg->Value()*sinf(state[-2].W.x)-f_air_vert->Value()*arm_length->Value()*arm_length->Value()*state[-1].W.x)+state[-1].W.x;
+
+  /*
+  ** ===================================================================
+  **   u pitch : pitch torque
+  **
+  ** ===================================================================
+  */
+  u_pitch = arm_length->Value() * k_mot->Value() *
+            (sigma->Value() * tfl_speed * tfl_speed + bfl_speed * bfl_speed +
+             sigma->Value() * tfr_speed * tfr_speed + bfr_speed * bfr_speed -
+             sigma->Value() * trl_speed * trl_speed - brl_speed * brl_speed -
+             sigma->Value() * trr_speed * trr_speed - brr_speed * brr_speed) *
+            sqrtf(2) / 2;
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_y angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  // state[0].W.y=(dT()/j_pitch->Value())*((j_roll->Value()-j_yaw->Value())*state[-1].W.x*state[-1].W.z-j_r->Value()*state[-1].W.x*omega
+  // + u_pitch)+state[-1].W.y;//Osamah
+  state[0].W.y =
+      (dT() / j_pitch->Value()) *
+          ((j_yaw->Value() - j_roll->Value()) * state[-1].W.x * state[-1].W.z -
+           j_r->Value() * state[-1].W.x * omega + u_pitch) +
+      state[-1].W.y; // Majd
+
+  // state[0].W.y=(dT()/j_pitch->Value())*(u_pitch-m->Value()*G*l_cg->Value()*sinf(state[-2].W.y)-f_air_vert->Value()*arm_length->Value()*arm_length->Value()*state[-1].W.y)+state[-1].W.y;
+
+  /*
+  ** ===================================================================
+  **    u yaw : yaw torque
+  **
+  ** ===================================================================
+  */
+  u_yaw = c_mot->Value() * (tfl_speed * tfl_speed - bfl_speed * bfl_speed +
+                            trr_speed * trr_speed - brr_speed * brr_speed -
+                            tfr_speed * tfr_speed + bfr_speed * bfr_speed -
+                            trl_speed * trl_speed + brl_speed * brl_speed);
+
+  /// Classical Nonlinear model of a quadrotor ( This is the w_z angular speed
+  /// of the quadri in the body frame). It is a discrete integrator
+  // state[0].W.z=(dT()/j_yaw->Value())* u_yaw +state[-1].W.z;//Osamah
+  state[0].W.z =
+      (dT() / j_yaw->Value()) * ((j_roll->Value() - j_pitch->Value()) *
+                                     state[-1].W.x * state[-1].W.y +
+                                 u_yaw) +
+      state[-1].W.z; // Majd
+
+  // state[0].W.z=(dT()/j_yaw->Value())*(u_yaw-f_air_lat->Value()*state[-1].W.z)+state[-1].W.z;
+
+  // compute quaternion from W
+  // Quaternion derivative: dQ = 0.5*(Q*Qw)
+  Quaternion dQ = state[-1].Quat.GetDerivative(state[0].W);
+
+  // Quaternion integration
+  state[0].Quat = state[-1].Quat + dQ * dT();
+  state[0].Quat.Normalize();
+
+  // Calculation of the thrust from the reference speed of motors
+  u_thrust =
+      k_mot->Value() * S->Value() *
+      (sigma->Value() * tfl_speed * tfl_speed +
+       sigma->Value() * tfr_speed * tfr_speed +
+       sigma->Value() * trl_speed * trl_speed +
+       sigma->Value() * trr_speed * trr_speed + bfl_speed * bfl_speed +
+       bfr_speed * bfr_speed + brl_speed * brl_speed + brr_speed * brr_speed);
+  Vector3D<double> vect(0, 0, -u_thrust);
+  vect.Rotate(state[0].Quat);
+
+  /*
+      ** ===================================================================
+      **     x double integrator
+      **
+      ** ===================================================================
+      */
+  state[0].Pos.x =
+      (dT() * dT() / m->Value()) *
+          (vect.x -
+           f_air_lat->Value() * (state[-1].Pos.x - state[-2].Pos.x) / dT()) +
+      2 * state[-1].Pos.x - state[-2].Pos.x;
+  state[0].Vel.x = (state[0].Pos.x - state[-1].Pos.x) / dT();
+
+  /*
+      ** ===================================================================
+      **     y double integrator
+      **
+      ** ===================================================================
+      */
+  state[0].Pos.y =
+      (dT() * dT() / m->Value()) *
+          (vect.y -
+           f_air_lat->Value() * (state[-1].Pos.y - state[-2].Pos.y) / dT()) +
+      2 * state[-1].Pos.y - state[-2].Pos.y;
+  state[0].Vel.y = (state[0].Pos.y - state[-1].Pos.y) / dT();
+
+  /*
+  ** ===================================================================
+  **     z double integrator
+  **
+  ** ===================================================================
+  */
+  state[0].Pos.z =
+      (dT() * dT() / m->Value()) *
+          (vect.z +
+           f_air_vert->Value() * (state[-1].Pos.z - state[-2].Pos.z) / dT() +
+           m->Value() * G) +
+      2 * state[-1].Pos.z - state[-2].Pos.z;
+  state[0].Vel.z = (state[0].Pos.z - state[-1].Pos.z) / dT();
+
+#ifndef GL
+  if (state[0].Pos.z < 0)
+    state[0].Pos.z = 0;
+#endif
+}
+
+} // end namespace simulator
+} // end namespace flair
Index: tags/latest/lib/FlairSimulator/src/X8.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/X8.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/X8.h	(revision 209)
@@ -0,0 +1,70 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/03
+//  filename:   X8.h
+//
+//  author:     Majd Saied, Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un X8
+//
+/*********************************************************************/
+
+#ifndef X8_H
+#define X8_H
+
+#include <Model.h>
+
+namespace flair {
+namespace core {
+class Mutex;
+}
+namespace gui {
+class DoubleSpinBox;
+}
+namespace actuator {
+class SimuBldc;
+}
+}
+
+namespace flair {
+namespace simulator {
+class Blade;
+
+class X8 : public Model {
+public:
+  X8(std::string name, uint32_t modelId);
+  ~X8();
+  virtual void Draw(void);
+  virtual void ExtraDraw(void){};
+
+protected:
+#ifdef GL
+  Blade *tfl_blade, *tfr_blade, *trl_blade, *trr_blade;
+  Blade *bfl_blade, *bfr_blade, *brl_blade, *brr_blade;
+#endif
+private:
+  void CalcModel(void);
+#ifdef GL
+  void AnimateModel(void);
+  size_t dbtSize(void) const;
+  void WritedbtBuf(char *dbtbuf);
+  void ReaddbtBuf(char *dbtbuf);
+  core::Mutex *motor_speed_mutex;
+#endif
+
+  actuator::SimuBldc *motors;
+  float motor_speed[8];
+  gui::DoubleSpinBox *m, *arm_length, *l_cg;
+  gui::DoubleSpinBox *k_mot, *c_mot;
+  gui::DoubleSpinBox *f_air_vert, *f_air_lat;
+  gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
+  gui::DoubleSpinBox *j_r, *sigma, *S;
+};
+} // end namespace simulator
+} // end namespace flair
+#endif // X8_H
Index: tags/latest/lib/FlairSimulator/src/groups.dox
===================================================================
--- tags/latest/lib/FlairSimulator/src/groups.dox	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/groups.dox	(revision 209)
@@ -0,0 +1,9 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+/*! \namespace flair::simulator
+ * 
+ * \brief %Simulator classes
+ */
Index: tags/latest/lib/FlairSimulator/src/unexported/FollowMeCamera.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/unexported/FollowMeCamera.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/unexported/FollowMeCamera.h	(revision 209)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/21
+//  filename:   FollowMeCamera.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une animation poursuite pour camera
+//
+/*********************************************************************/
+
+#ifndef FOLLOWMECAMERA_H
+#define FOLLOWMECAMERA_H
+
+#include "VisualizationCamera.h"
+
+
+namespace flair {
+namespace simulator {
+
+class FollowMeCamera : public VisualizationCamera {
+public:
+  FollowMeCamera(const irr::scene::ISceneNode *parent,std::string name,
+                float rotateSpeed = -500.0f, float zoomSpeed = 4.0f);
+  ~FollowMeCamera();
+
+  void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
+  void setPositionOffset(irr::core::vector3df newpos);
+  void setTargetOffset(irr::core::vector3df newpos);
+
+private:
+  irr::core::vector3df pos_offset, target_offset;
+  irr::core::position2df RotateStart;
+  const irr::scene::ISceneNode *parent;
+  bool Rotating;
+  float RotY, RotZ;
+  float sat(float value);
+  float rotateSpeed;
+  float zoomSpeed;
+};
+
+} // end namespace simulator
+} // end namespace flair
+
+#endif // FOLLOWMECAMERA_H
Index: tags/latest/lib/FlairSimulator/src/unexported/GenericObject.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/unexported/GenericObject.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/unexported/GenericObject.h	(revision 209)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   GenericObject.h
+//
+//  author:     Cesar Richard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#ifndef GENERICOBJECT_H
+#define GENERICOBJECT_H
+#ifdef GL
+
+#include <vector3d.h>
+
+namespace irr {
+	namespace scene {
+		class IMesh;
+		class IMeshSceneNode;
+		class ITriangleSelector;
+		class ISceneNode;
+	}
+}
+
+class Simulator_impl;
+
+namespace flair {
+namespace simulator {
+
+class GenericObject {
+  friend class ::Simulator_impl;
+
+public:
+  GenericObject(irr::scene::IMesh *mesh);
+  virtual ~GenericObject();
+
+  irr::scene::ITriangleSelector *TriangleSelector(void);
+  void setScale(float value);
+  void setScale(const irr::core::vector3df& scale);
+	void setPosition(const irr::core::vector3df& position);
+  void setRotation(const irr::core::vector3df& rotation);
+ 
+private:
+  irr::scene::ITriangleSelector *selector;
+	irr::scene::IMeshSceneNode *meshSceneNode;
+}; 
+} // end namespace simulator
+} // end namespace flair
+#endif // GL
+#endif // GENERICOBJECT_H
Index: tags/latest/lib/FlairSimulator/src/unexported/Gui_impl.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/unexported/Gui_impl.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/unexported/Gui_impl.h	(revision 209)
@@ -0,0 +1,92 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/27
+//  filename:   Gui_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant une Gui
+//
+/*********************************************************************/
+
+#ifndef GUI_IMPL_H
+#define GUI_IMPL_H
+
+#include <string>
+#include <vector>
+#include <io_hdfile.h>
+#include <EDriverTypes.h>
+#include <vector3d.h>
+
+namespace irr {
+  class IrrlichtDevice;
+  namespace scene {
+    class ISceneManager;
+    class IMeshSceneNode;
+    class ITriangleSelector;
+  }
+  namespace video {
+    class IVideoDriver;
+  }
+  namespace gui {
+    class IGUIFont;
+    class IGUIEnvironment;
+  }
+}
+
+namespace flair {
+  namespace core {
+    class Object;
+  }
+  namespace simulator {
+    class Model;
+    class GenericObject;
+    class Gui;
+    class VisualizationCamera;
+  }
+}
+
+class MyEventReceiver;
+
+class Gui_impl {
+public:
+  Gui_impl(flair::simulator::Gui *self, int app_width, int app_height,
+           int scene_width, int scene_height, std::string media_path,
+           irr::video::E_DRIVER_TYPE driver_type = irr::video::EDT_OPENGL);
+  ~Gui_impl();
+  void RunGui(std::vector<flair::simulator::Model *> models,
+              std::vector<flair::simulator::GenericObject *> objects);
+  void setMesh(std::string file,
+               irr::core::vector3df position = irr::core::vector3df(0, 0, 0),
+               irr::core::vector3df rotation = irr::core::vector3df(0, 0, 0),
+               irr::core::vector3df scale = irr::core::vector3df(1, 1, 1));
+
+  irr::scene::IMeshSceneNode *node;
+  irr::IrrlichtDevice *device;
+  std::string media_path;
+  irr::video::IVideoDriver *driver;
+  irr::scene::ISceneManager *smgr;
+  int scene_width, scene_height;
+  void AddVisualizationCamera(flair::simulator::VisualizationCamera* camera);
+
+private:
+  MyEventReceiver *receiver;
+  irr::scene::ITriangleSelector *selector;
+  irr::gui::IGUIFont *font;
+  irr::gui::IGUIEnvironment *env;
+  void setWindowCaption(int cam_id, int fps);
+  void takeScreenshot(void);
+  hdfile_t *dbtFile_r, *dbtFile_w;
+  size_t dbtSize(std::vector<flair::simulator::Model *> modeles);
+  char *dbtbuf;
+  flair::simulator::Gui *self;
+  std::vector<flair::simulator::VisualizationCamera *> cameras;
+  flair::simulator::Model *getModelFromVisualizationCamera(std::vector<flair::simulator::Model *> models,flair::simulator::VisualizationCamera *camera);
+};
+
+#endif // GUI_IMPL_H
Index: tags/latest/lib/FlairSimulator/src/unexported/Model_impl.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 209)
@@ -0,0 +1,126 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Model_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant un modele a simuler
+//
+/*********************************************************************/
+
+#ifndef MODEL_IMPL_H
+#define MODEL_IMPL_H
+
+#include <Thread.h>
+#include <vrpn_Tracker.h>
+#include "Model.h"
+#include "Quaternion.h"
+
+namespace flair {
+namespace core {
+class cvmatrix;
+class Mutex;
+class ConditionVariable;
+}
+namespace gui {
+class TabWidget;
+class CheckBox;
+class DoubleSpinBox;
+class SpinBox;
+class Vector3DSpinBox;
+}
+namespace simulator {
+class Simulator;
+class FollowMeCamera;
+}
+}
+
+#ifdef GL
+#include <Vector3D.h>
+#include <IMeshSceneNode.h>
+
+namespace irr {
+namespace scene {
+class ISceneManager;
+class ITriangleSelector;
+class IMetaTriangleSelector;
+class ISceneNodeAnimatorCollisionResponse;
+}
+}
+#endif
+
+#ifdef GL
+class Model_impl : public irr::scene::ISceneNode,
+                   public flair::core::Thread,
+                   private vrpn_Tracker
+#else
+class Model_impl : public flair::core::Thread,
+                   private vrpn_Tracker
+#endif
+                   {
+public:
+  Model_impl(flair::simulator::Model *self, std::string name,uint32_t modelId);
+  ~Model_impl();
+
+#ifdef GL
+  void OnRegisterSceneNode(void);
+  void render(void);
+  void Draw(void) {
+    printf("CA MARCHE PAS PUNAISE\r\n");
+    ExtraDraw();
+  };
+  void ExtraDraw(void) { printf("nope\r\n"); };
+
+  const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const {
+    return box;
+  }
+  void UpdatePos(void);
+  void CheckCollision(void);
+  irr::scene::ITriangleSelector *TriangleSelector(void);
+  irr::scene::IMetaTriangleSelector *MetaTriangleSelector(void);
+  irr::core::aabbox3d<irr::f32> box;
+  void SynchronizationPoint();
+  flair::simulator::FollowMeCamera *camera;
+  irr::scene::ITriangleSelector *selector;
+#endif
+  void mainloop(void);
+
+  flair::gui::TabWidget *tabwidget;
+  flair::gui::DoubleSpinBox *dT;
+  int modelId;
+
+private:
+  flair::gui::Vector3DSpinBox *pos_init;
+  flair::gui::SpinBox *yaw_init;
+  flair::gui::CheckBox *enable_opti;
+  flair::simulator::Model *self;
+  flair::core::cvmatrix *output;
+  flair::core::Mutex *states_mutex;
+
+  struct timeval _timestamp;
+  void Run(void);
+  flair::core::Quaternion ComputeInitRotation(flair::core::Quaternion quat_in);
+#ifdef GL
+  void CollisionHandler(void);
+
+  irr::scene::IMetaTriangleSelector *meta_selector;
+  irr::scene::ISceneNodeAnimatorCollisionResponse *anim;
+
+  bool position_init;
+
+  flair::core::ConditionVariable *cond;
+  int sync_count;
+
+  flair::core::Mutex *collision_mutex;
+  bool collision_occured;
+  flair::core::Vector3D<double> collision_point;
+#endif
+};
+
+#endif // MODEL_IMPL_H
Index: tags/latest/lib/FlairSimulator/src/unexported/Simulator_impl.h
===================================================================
--- tags/latest/lib/FlairSimulator/src/unexported/Simulator_impl.h	(revision 209)
+++ tags/latest/lib/FlairSimulator/src/unexported/Simulator_impl.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/03/25
+//  filename:   Simulator_impl.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base du simulateur
+//
+/*********************************************************************/
+
+#ifndef SIMULATOR_IMPL_H
+#define SIMULATOR_IMPL_H
+
+#include <vrpn_Connection.h>
+#include <Thread.h>
+
+namespace flair {
+namespace simulator {
+class Simulator;
+class Model;
+class GenericObject;
+}
+}
+
+class Model_impl;
+
+class Simulator_impl : public vrpn_Connection_IP, private flair::core::Thread {
+  friend class ::Model_impl;
+  friend class flair::simulator::GenericObject;
+
+public:
+  Simulator_impl(flair::simulator::Simulator *self, int optitrack_mstime = 10,
+                 float yaw_deg = 30);
+  ~Simulator_impl();
+
+  void RunSimu(void);
+  float yaw_rad;
+
+private:
+  void Run(void);
+  flair::simulator::Simulator *self;
+  std::vector<flair::simulator::Model *> models;
+  std::vector<flair::simulator::GenericObject *> objects;
+  int optitrack_mstime;
+};
+
+#endif // SIMULATOR_IMPL_H
Index: tags/latest/lib/FlairVisionFilter/CMakeLists.txt
===================================================================
--- tags/latest/lib/FlairVisionFilter/CMakeLists.txt	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/CMakeLists.txt	(revision 209)
@@ -0,0 +1,49 @@
+PROJECT(FlairVisionFilter)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+	$ENV{FLAIR_ROOT}/flair-src/lib/FlairCore/src
+	${CMAKE_SYSROOT}/usr/include/opencv
+)
+
+FILE(GLOB SRC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${SRC_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+FILE(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
+INSTALL(FILES ${HEADER_FILES} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
Index: tags/latest/lib/FlairVisionFilter/src/CvtColor.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/CvtColor.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/CvtColor.cpp	(revision 209)
@@ -0,0 +1,92 @@
+//  created:    2014/07/17
+//  filename:   CvtColor.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Image color conversion
+//
+//
+/*********************************************************************/
+
+#include "CvtColor.h"
+#include <cvimage.h>
+#include <typeinfo>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair { namespace filter {
+
+CvtColor::CvtColor(const core::IODevice* parent,std::string name,Conversion_t conversion) : IODevice(parent,name),output(0) {
+    this->conversion=conversion;
+
+    switch(conversion) {
+    case Conversion_t::ToGray:
+        try{
+            cvimage::Type const &imageType=dynamic_cast<cvimage::Type const &>(parent->GetOutputDataType());
+            output=new cvimage(this,imageType.GetWidth(),imageType.GetHeight(),cvimage::Type::Format::Gray,"conversion",true,2);
+
+        } catch(std::bad_cast& bc) {
+            Err("io type mismatch\n");
+        }
+        break;
+    default:
+        Err("conversion not supported\n");
+    }
+    
+    SetIsReady(true);
+}
+
+CvtColor::~CvtColor(void) {}
+
+cvimage* CvtColor::Output(void) {
+    return output;
+
+}
+
+DataType const &CvtColor::GetOutputDataType() const {
+    if(output!=NULL) {
+        return output->GetDataType();
+    } else {
+        return dummyType;
+    }
+}
+
+void CvtColor::UpdateFrom(const io_data *data) {
+    IplImage *img=((cvimage*)data)->img;
+
+    data->GetMutex();
+    output->GetMutex();
+
+    switch(conversion) {
+    case Conversion_t::ToGray:
+        switch(((cvimage*)data)->GetDataType().GetFormat()) {
+        case cvimage::Type::Format::YUYV:
+            //dspCvtColor(img,output->img,DSP_YUYV2GRAY);
+            break;
+        case cvimage::Type::Format::UYVY:
+            //dspCvtColor(img,output->img,DSP_UYVY2GRAY);
+            break;
+        case cvimage::Type::Format::BGR:
+            //dspCvtColor(img,output->img,DSP_BGR2GRAY);
+            break;
+        default:
+            Err("input format not supported\n");
+        }
+        break;
+    default:
+        Err("conversion not supported\n");
+    }
+
+    output->ReleaseMutex();
+    data->ReleaseMutex();
+
+    output->SetDataTime(data->DataTime());
+    ProcessUpdate(output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/CvtColor.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/CvtColor.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/CvtColor.h	(revision 209)
@@ -0,0 +1,89 @@
+/*!
+ * \file CvtColor.h
+ * \brief Image color conversion
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/17
+ * \version 4.0
+ */
+
+
+#ifndef CVTCOLOR_H
+#define CVTCOLOR_H
+
+#include <IODevice.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class cvimage;
+    }
+}
+
+namespace flair
+{
+namespace filter
+{
+    /*! \class CvtColor
+    *
+    * \brief Image color conversion
+    *
+    * The conversion is done using the DSP of the DM3730.
+    */
+    class CvtColor : public core::IODevice
+    {
+        public:
+            /*!
+            \enum Conversion_t
+            \brief Conversion formats
+            */
+            enum class Conversion_t {
+                ToBGR,/*!< BGR 24 bits */
+                ToGray,/*!< gray 8 bits */
+                } ;
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct an Ahrs.
+            *
+            * \param parent parent
+            * \param name name
+            * \param conversion conversion format
+            */
+            CvtColor(const core::IODevice* parent,std::string name,Conversion_t conversion);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~CvtColor();
+
+            /*!
+            * \brief Output image
+            *
+            * Output matrix is of the same size as declared in constructor. \n
+            * Its type depends of the conversion type.
+            *
+            * \return the output image
+            */
+            core::cvimage* Output(void);
+
+            core::DataType const &GetOutputDataType() const;
+
+        private:
+            /*!
+            * \brief Update using provided datas
+            *
+            * Reimplemented from IODevice.
+            *
+            * \param data data from the parent to process
+            */
+            void UpdateFrom(const core::io_data *data);
+
+            core::cvimage *output;
+            Conversion_t conversion;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // CVTCOLOR_H
Index: tags/latest/lib/FlairVisionFilter/src/HoughLines.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/HoughLines.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/HoughLines.cpp	(revision 209)
@@ -0,0 +1,97 @@
+//  created:    2015/10/07
+//  filename:   HoughLines.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    HoughLines
+//
+//
+/*********************************************************************/
+
+#include "HoughLines.h"
+#include <cvimage.h>
+#include <cvmatrix.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+#include <typeinfo>
+
+#define MAX_LINES 100
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair { namespace filter {
+
+HoughLines::HoughLines(const IODevice* parent,const LayoutPosition* position,string name) : IODevice(parent,name) {
+    GroupBox* reglages_groupbox=new GroupBox(position,name);
+    fullRhoStep=new SpinBox(reglages_groupbox->NewRow(),"full rho step:","pixels",0,255,1,1);
+    fullThetaStep=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"full theta step:","degrees",0,90,1,1);
+    trackingRhoStep=new SpinBox(reglages_groupbox->NewRow(),"tracking rho step:","pixels",0,255,1,1);
+    trackingThetaStep=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"tracking theta step:","degrees",0,90,1,1);
+    trackingDeltaTheta=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"tracking delta theta:","degrees",0,90,1,1);
+    nbPoints=new SpinBox(reglages_groupbox->NewRow(),"nb points:",0,10000,10,100);
+
+    isTracking=false;
+    lostLine=false;
+    initLine=false;
+    linesStorage = cvCreateMat(MAX_LINES, 1, CV_32FC2);
+
+    //init output matrix of same size as init
+    cvmatrix_descriptor* desc=new cvmatrix_descriptor(4,1);
+    desc->SetElementName(0,0,"distance");
+    desc->SetElementName(1,0,"orientation rad");
+    desc->SetElementName(2,0,"orientation deg");
+    desc->SetElementName(3,0,"line_detected");
+    output=new cvmatrix(this,desc,floatType,name);
+    delete desc;
+
+    try{
+        cvimage::Type const &imageType=dynamic_cast<cvimage::Type const &>(parent->GetOutputDataType());
+        if(imageType.GetFormat()!=cvimage::Type::Format::Gray) {
+            Err("input image is not gray\n");
+            return;
+        }
+    } catch(std::bad_cast& bc) {
+        Err("io type mismatch\n");
+        return;
+    }
+    
+    SetIsReady(true);
+}
+
+HoughLines::~HoughLines(void) {
+    cvReleaseMat(&linesStorage);
+}
+
+void HoughLines::UpdateFrom(const io_data *data) {
+ 
+}
+
+bool HoughLines::isLineDetected() const {
+    if(output->Value(3,0)==1) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+float HoughLines::GetOrientation(void) const {
+    return output->Value(1,0);
+}
+
+float HoughLines::GetDistance(void) const {
+    return output->Value(0,0);
+}
+
+cvmatrix *HoughLines::Output(void) const {
+    return output;
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/HoughLines.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/HoughLines.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/HoughLines.h	(revision 209)
@@ -0,0 +1,75 @@
+/*!
+ * \file HoughLines.h
+ * \brief HoughLines algorithm
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/10/07
+ * \version 4.0
+ */
+
+
+#ifndef HOUGHLINES_H
+#define HOUGHLINES_H
+
+#include <IODevice.h>
+#include <cv.h>
+
+namespace flair {
+    namespace core {
+        class cvimage;
+        class cvmatrix;
+    }
+    namespace gui {
+        class LayoutPosition;
+        class SpinBox;
+        class DoubleSpinBox;
+    }
+}
+
+namespace flair { namespace filter {
+    /*! \class HoughLines
+    *
+    * \brief HoughLines algorithm
+    *
+    * HoughLines is done using the DSP of the DM3730.
+    */
+    class HoughLines : public core::IODevice {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an OpticalFlow filter at given position. \n
+            * After calling this function, position will be deleted as it is no longer usefull. \n
+            *
+            * \param parent parent
+            * \param position position
+            * \param name name
+            */
+            HoughLines(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~HoughLines();
+
+            bool isLineDetected(void) const;
+            float GetOrientation(void) const;
+            float GetDistance(void) const;
+            core::cvmatrix *Output(void) const;
+
+        private:
+            void UpdateFrom(const core::io_data *data);
+            gui::SpinBox *fullRhoStep,*trackingRhoStep,*nbPoints;
+            gui::DoubleSpinBox *fullThetaStep,*trackingThetaStep,*trackingDeltaTheta;
+            bool isTracking,lostLine,initLine,noLine;
+            int nbLines;
+            float yawMean,prevYawMean;
+            float prevRhoMean,rhoMean;
+            float prevThetaMean,thetaMean;
+            float distance,orientation;
+            CvMat* linesStorage;
+            core::cvmatrix *output;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // HOUGHLINES_H
Index: tags/latest/lib/FlairVisionFilter/src/ImgThreshold.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/ImgThreshold.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/ImgThreshold.cpp	(revision 209)
@@ -0,0 +1,77 @@
+//  created:    2015/10/07
+//  filename:   ImgThreshold.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    ImgThreshold
+//
+//
+/*********************************************************************/
+
+#include "ImgThreshold.h"
+#include <cvimage.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <typeinfo>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair { namespace filter {
+
+ImgThreshold::ImgThreshold(const IODevice* parent,const LayoutPosition* position,string name) : IODevice(parent,name),output(0) {
+    GroupBox* reglages_groupbox=new GroupBox(position,name);
+    threshold=new SpinBox(reglages_groupbox->NewRow(),"threshold:",0,255,1,127);
+
+    Printf("todo: pouvoir reutiliser la meme image en sortie\n");
+    try{
+        cvimage::Type const &imageType=dynamic_cast<cvimage::Type const &>(parent->GetOutputDataType());
+        if(imageType.GetFormat()==cvimage::Type::Format::Gray) {
+            output=new cvimage(this,imageType.GetWidth(),imageType.GetHeight(),imageType.GetFormat(),"threshold");
+        } else {
+            Err("input image is not gray\n");
+            return;
+        }
+    } catch(std::bad_cast& bc) {
+        Err("io type mismatch\n");
+        return;
+    }
+    SetIsReady(true);
+}
+
+ImgThreshold::~ImgThreshold(void) {
+}
+
+cvimage* ImgThreshold::Output(void) {
+    return output;
+}
+
+void ImgThreshold::UpdateFrom(const io_data *data) {
+    cvimage *cvImage=(cvimage*)data;
+    IplImage *gimg=cvImage->img;
+/*
+    data->GetMutex();
+    output->GetMutex();
+    dspThreshold(gimg, output->img, threshold->Value(), 255, CV_THRESH_BINARY);
+    output->ReleaseMutex();
+    data->ReleaseMutex();
+*/
+    output->SetDataTime(data->DataTime());
+    ProcessUpdate(output);
+}
+
+DataType const &ImgThreshold::GetOutputDataType() const {
+    if(output!=NULL) {
+        return output->GetDataType();
+    } else {
+        return dummyType;
+    }
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/ImgThreshold.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/ImgThreshold.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/ImgThreshold.h	(revision 209)
@@ -0,0 +1,71 @@
+/*!
+ * \file ImgThreshold.h
+ * \brief ImgThreshold algorithm
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/10/07
+ * \version 4.0
+ */
+
+
+#ifndef IMGTHRESHOLD_H
+#define IMGTHRESHOLD_H
+
+#include <IODevice.h>
+#include <cv.h>
+
+namespace flair {
+    namespace core {
+        class cvimage;
+    }
+    namespace gui {
+        class LayoutPosition;
+        class SpinBox;
+    }
+}
+
+namespace flair { namespace filter {
+    /*! \class ImgThreshold
+    *
+    * \brief ImgThreshold algorithm
+    *
+    * ImgThreshold is done using the DSP of the DM3730.
+    */
+    class ImgThreshold : public core::IODevice {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an OpticalFlow filter at given position. \n
+            * After calling this function, position will be deleted as it is no longer usefull. \n
+            *
+            * \param parent parent
+            * \param position position
+            * \param name name
+            */
+            ImgThreshold(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~ImgThreshold();
+
+            /*!
+            * \brief Output image
+            *
+            * Output matrix is of the same size as the input image. \n
+            *
+            * \return the output image
+            */
+            core::cvimage* Output(void);
+
+            core::DataType const &GetOutputDataType() const;
+
+        private:
+            void UpdateFrom(const core::io_data *data);
+            core::cvimage *output;
+            gui::SpinBox *threshold;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // IMGTHRESHOLD_H
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlow.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 209)
@@ -0,0 +1,168 @@
+//  created:    2012/04/12
+//  filename:   OpticalFlow.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    calcul flux optique lk
+//
+//
+/*********************************************************************/
+
+#include "OpticalFlow.h"
+#include "OpticalFlowData.h"
+#include <cvimage.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+//#include <algorithm>
+#include <OneAxisRotation.h>
+#include <Vector3D.h>
+#include <typeinfo>
+
+#define LEVEL_PYR 2
+
+using std::string;
+using std::swap;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair
+{
+namespace filter
+{
+
+OpticalFlow::OpticalFlow(const IODevice* parent,const LayoutPosition* position,string name) : IODevice(parent,name)
+{
+    Printf("optical flow: voir pour faire du multiple output\n");//pour pts A et B, found et error
+
+    try{
+        cvimage::Type const &imageType=dynamic_cast<cvimage::Type const &>(parent->GetOutputDataType());
+        pyr=cvCreateImage(cvSize(imageType.GetWidth(),imageType.GetHeight()),IPL_DEPTH_8U,1);
+        pyr_old=cvCreateImage(cvSize(imageType.GetWidth(),imageType.GetHeight()),IPL_DEPTH_8U,1);
+
+    } catch(std::bad_cast& bc) {
+        Err("io type mismatch\n");
+        pyr=NULL;
+        pyr_old=NULL;
+        return;
+    }
+
+    is_init=false;
+
+    GroupBox* reglages_groupbox=new GroupBox(position,name);
+    rotation=new OneAxisRotation(reglages_groupbox->NewRow(),"post rotation",OneAxisRotation::PostRotation);
+    max_features=new SpinBox(reglages_groupbox->NewRow(),"max features:",1,65535,1,1);
+
+    output=new OpticalFlowData(parent,max_features->Value());
+
+    pointsA=(CvPoint *)cvAlloc(max_features->Value()*sizeof(CvPoint));
+    pointsB=(CvPoint *)cvAlloc(max_features->Value()*sizeof(CvPoint));
+
+    found_feature=(char *)cvAlloc(max_features->Value()*sizeof(char));
+    feature_error=(unsigned int *)cvAlloc(max_features->Value()*sizeof(unsigned int));
+    
+    SetIsReady(true);
+}
+
+OpticalFlow::~OpticalFlow(void)
+{
+    cvReleaseImage(&pyr);
+    cvReleaseImage(&pyr_old);
+    cvFree(&pointsA);
+    cvFree(&pointsB);
+    cvFree(&found_feature);
+    cvFree(&feature_error);
+}
+
+void OpticalFlow::UpdateFrom(const io_data *data)
+{
+    IplImage *gimg=((cvimage*)data)->img;
+    IplImage *gimg_old=((cvimage*)data->Prev(1))->img;
+
+    unsigned int count;
+    CvSize window = cvSize(3,3);
+    CvTermCriteria termination_criteria = cvTermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 20, .3 );
+    unsigned int i;
+
+    if(max_features->ValueChanged()==true) {
+        cvFree(&pointsA);
+        cvFree(&pointsB);
+        cvFree(&found_feature);
+        cvFree(&feature_error);
+        pointsA=(CvPoint *)cvAlloc(max_features->Value()*sizeof(CvPoint));
+        pointsB=(CvPoint *)cvAlloc(max_features->Value()*sizeof(CvPoint));
+        found_feature=(char *)cvAlloc(max_features->Value()*sizeof(char));
+        feature_error=(unsigned int *)cvAlloc(max_features->Value()*sizeof(unsigned int));
+
+        output->Resize(max_features->Value());
+    }
+/*
+    if(is_init==false)
+    {
+        data->GetMutex();
+        //init image old
+        dspPyrDown(gimg,pyr_old,LEVEL_PYR);
+        data->ReleaseMutex();
+        is_init=true;
+        printf("ajouter mise a 0 des points\n");
+        return;
+    }
+
+    data->GetMutex();
+    data->Prev(1)->GetMutex();
+
+    //select good features
+    count=max_features->Value();
+    dspGoodFeaturesToTrack(gimg_old,pointsA,&count,0.08,5);
+    //pyramide
+    dspPyrDown(gimg,pyr,LEVEL_PYR);
+    //lk
+    dspCalcOpticalFlowPyrLK(gimg_old,gimg,pyr_old,pyr,pointsA,pointsB,count,window,LEVEL_PYR,found_feature,feature_error,termination_criteria,0) ;
+
+    data->Prev(1)->ReleaseMutex();
+    data->ReleaseMutex();
+*/
+    //apply rotation
+    for(i=0;i<count;i++) {
+        Vector3Df tmp;
+        tmp.x=pointsA[i].x;
+        tmp.y=pointsA[i].y;
+        tmp.z=0;
+        rotation->ComputeRotation(tmp);
+        pointsA[i].x=tmp.x;
+        pointsA[i].y=tmp.y;
+
+        tmp.x=pointsB[i].x;
+        tmp.y=pointsB[i].y;
+        tmp.z=0;
+        rotation->ComputeRotation(tmp);
+        pointsB[i].x=tmp.x;
+        pointsB[i].y=tmp.y;
+    }
+
+    output->GetMutex();
+    CvPoint2D32f* pointsBf= output->PointsB();
+    for(i=0;i<count;i++)
+    {
+        pointsBf[i].x=pointsA[i].x+((float)pointsB[i].x)/256;
+        pointsBf[i].y=pointsA[i].y+((float)pointsB[i].y)/256;
+    }
+    output->ReleaseMutex();
+
+    output->SetPointsA(pointsA);
+    output->SetFoundFeature(found_feature);
+    output->SetFeatureError(feature_error);
+    output->SetNbFeatures(count);
+
+    //rotation
+    swap(pyr,pyr_old);
+
+    output->SetDataTime(data->DataTime());
+    ProcessUpdate(output);
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlow.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlow.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlow.h	(revision 209)
@@ -0,0 +1,82 @@
+/*!
+ * \file OpticalFlow.h
+ * \brief Lucas and Kanade optical flow algorithm
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/04/12
+ * \version 4.0
+ */
+
+
+#ifndef OPTICALFLOW_H
+#define OPTICALFLOW_H
+
+#include <IODevice.h>
+#include <cv.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class cvimage;
+        class OneAxisRotation;
+    }
+    namespace gui
+    {
+        class LayoutPosition;
+        class SpinBox;
+    }
+    namespace filter
+    {
+        class OpticalFlowData;
+    }
+}
+
+namespace flair
+{
+namespace filter
+{
+    /*! \class OpticalFlow
+    *
+    * \brief Lucas and Kanade optical flow algorithm
+    *
+    * Optical flow is done using the DSP of the DM3730.
+    */
+    class OpticalFlow : public core::IODevice
+    {
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an OpticalFlow filter at given position. \n
+            * After calling this function, position will be deleted as it is no longer usefull. \n
+            *
+            * \param parent parent
+            * \param position position
+            * \param name name
+            */
+            OpticalFlow(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~OpticalFlow();
+
+        private:
+            void UpdateFrom(const core::io_data *data);
+            OpticalFlowData *output;
+            gui::SpinBox *max_features;
+            core::OneAxisRotation* rotation;
+
+            CvPoint* pointsA;
+            CvPoint* pointsB;
+            char *found_feature;
+            unsigned int *feature_error;
+            IplImage *pyr,*pyr_old;
+
+            bool is_init;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // OPTICALFLOW_H
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.cpp	(revision 209)
@@ -0,0 +1,156 @@
+//  created:    2012/04/12
+//  filename:   OpticalFlowData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour les données du flux optique
+//
+/*********************************************************************/
+
+#include "OpticalFlowData.h"
+
+using std::string;
+
+namespace flair
+{
+namespace filter
+{
+
+OpticalFlowData::OpticalFlowData(const Object* parent,uint32_t max_features,string name,uint32_t n): io_data(parent,name,n)
+{
+    this->max_features=max_features;
+    nb_features=0;
+
+    pointsA=(CvPoint *)cvAlloc(max_features*sizeof(CvPoint));
+    pointsB=(CvPoint2D32f *)cvAlloc(max_features*sizeof(CvPoint2D32f));
+
+    found_features=(char *)cvAlloc(max_features*sizeof(char));
+    features_error=(uint32_t*)cvAlloc(max_features*sizeof(uint32_t));
+}
+
+OpticalFlowData::~OpticalFlowData()
+{
+    cvFree(&pointsA);
+    cvFree(&pointsB);
+
+    cvFree(&found_features);
+    cvFree(&features_error);
+}
+
+CvPoint* OpticalFlowData::PointsA(void) const
+{
+    return pointsA;
+}
+
+CvPoint2D32f* OpticalFlowData::PointsB(void) const
+{
+    return pointsB;
+}
+
+char *OpticalFlowData::FoundFeature(void) const
+{
+    return found_features;
+}
+
+uint32_t *OpticalFlowData::FeatureError(void) const
+{
+    return features_error;
+}
+
+// value is new max_features value
+void OpticalFlowData::Resize(uint32_t value) {
+    CvPoint *new_pointsA;
+    CvPoint2D32f *new_pointsB;
+    char *new_found_features;
+    uint32_t *new_features_error;
+
+    new_pointsA=(CvPoint *)cvAlloc(value*sizeof(CvPoint));
+    new_pointsB=(CvPoint2D32f *)cvAlloc(value*sizeof(CvPoint2D32f));
+    new_found_features=(char *)cvAlloc(value*sizeof(char));
+    new_features_error=(uint32_t *)cvAlloc(value*sizeof(uint32_t));
+
+    GetMutex();
+    if(value>max_features)
+    {
+        memcpy(new_pointsA,pointsA,max_features*sizeof(CvPoint));
+        memcpy(new_pointsB,pointsB,max_features*sizeof(CvPoint2D32f));
+        memcpy(new_found_features,found_features,max_features*sizeof(char));
+        memcpy(new_features_error,features_error,max_features*sizeof(uint32_t));
+    }
+    else
+    {
+        memcpy(new_pointsA,pointsA,value*sizeof(CvPoint));
+        memcpy(new_pointsB,pointsB,value*sizeof(CvPoint2D32f));
+        memcpy(new_found_features,found_features,value*sizeof(char));
+        memcpy(new_features_error,features_error,value*sizeof(uint32_t));
+        if(nb_features>value) nb_features=value; //si nb_features est le nombre de point qui ont effectivement une correspondande, ça me parait louche. Sauf si les points sont classés et que ceux qui ont une correpondance sont toujours au début
+    }
+    max_features=value;
+    ReleaseMutex();
+
+    cvFree(&pointsA);
+    cvFree(&pointsB);
+    cvFree(&found_features);
+    cvFree(&features_error);
+
+    pointsA=new_pointsA;
+    pointsB=new_pointsB;
+    found_features=new_found_features;
+    features_error=new_features_error;
+}
+
+void OpticalFlowData::CopyDatas(char* dst) const
+{
+    Warn("non implementé\n");
+}
+
+void OpticalFlowData::SetPointsA(const CvPoint* points)
+{
+    GetMutex();
+    memcpy(pointsA,points,max_features*sizeof(CvPoint));
+    ReleaseMutex();
+}
+
+void OpticalFlowData::SetPointsB(const CvPoint2D32f* points)
+{
+    GetMutex();
+    memcpy(pointsB,points,max_features*sizeof(CvPoint2D32f));
+    ReleaseMutex();
+}
+
+void OpticalFlowData::SetFoundFeature(const char *found_features)
+{
+    GetMutex();
+    memcpy(this->found_features,found_features,max_features*sizeof(char));
+    ReleaseMutex();
+}
+
+void OpticalFlowData::SetFeatureError(const uint32_t *features_error)
+{
+    GetMutex();
+    memcpy(this->features_error,features_error,max_features*sizeof(uint32_t));
+    ReleaseMutex();
+}
+
+uint32_t OpticalFlowData::MaxFeatures(void) const
+{
+    return max_features;
+}
+
+uint32_t OpticalFlowData::NbFeatures(void) const
+{
+    return nb_features;
+}
+
+void OpticalFlowData::SetNbFeatures(uint32_t value)
+{
+    GetMutex();
+    nb_features=value;
+    ReleaseMutex();
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlowData.h	(revision 209)
@@ -0,0 +1,144 @@
+/*!
+ * \file OpticalFlowData.h
+ * \brief Class defining pptical flow datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/04/12
+ * \version 4.0
+ */
+
+#ifndef OPTICALFLOWDATA_H
+#define OPTICALFLOWDATA_H
+
+#include <cxcore.h>
+#include <io_data.h>
+
+namespace flair { namespace filter {
+    /*! \class OpticalFlowData
+    *
+    * \brief Class defining optical flow datas
+    *
+    * Optical flow datas are composed of the following: \n
+    * PointsA: tracked points on first image
+    * PointsB: tracked points on second image
+    * FoundFeature: array representing if a point on first image is found on second image
+    * FeatureError: array representing correlation error for each point (confidence)
+    */
+    class OpticalFlowData: public core::io_data {
+    public:
+        class Type: public core::DataType {
+            size_t GetSize() const {return 0;} //TODO
+            std::string GetDescription() const {return "optical flow";}
+        };
+
+        /*!
+        * \brief Constructor
+        *
+        * Construct OpticalFlowData.
+        *
+        * \param parent parent
+        * \param max_features maximum number of features to track
+        * \param name name
+        * \param n number of samples for the io_data
+        */
+        OpticalFlowData(const core::Object* parent,uint32_t max_features,std::string name="",uint32_t n=1);
+
+        /*!
+        * \brief Destructor
+        *
+        */
+        ~OpticalFlowData();
+
+        /*!
+        * \brief Points on first image
+        *
+    */
+        CvPoint* PointsA(void) const;
+
+        /*!
+        * \brief Points on second image
+        *
+        */
+        CvPoint2D32f* PointsB(void) const;
+
+        /*!
+        * \brief Features found
+        *
+        * value of the array is one if feature is found
+        */
+        char *FoundFeature(void) const;
+
+        /*!
+        * \brief Correlation error
+        *
+        */
+        uint32_t *FeatureError(void) const;
+
+        /*!
+        * \brief Set points of interest of frst image
+        *
+        * \param points points
+        */
+        void SetPointsA(const CvPoint *points);
+
+        /*!
+        * \brief Set points of interest of second image
+        *
+        * \param points points
+        */
+        void SetPointsB(const CvPoint2D32f *points);
+
+        /*!
+        * \brief Set found features
+        *
+        * \param found_features found features
+        */
+        void SetFoundFeature(const char *found_features);
+
+        /*!
+        * \brief Set features error
+        *
+        * \param features_error features error
+        */
+        void SetFeatureError(const unsigned int *features_error);
+
+        /*!
+        * \brief Number of maximum features
+        *
+        */
+        uint32_t MaxFeatures(void) const;
+
+        /*!
+        * \brief Number of tracked features
+        *
+        */
+        uint32_t NbFeatures(void) const;
+
+        /*!
+        * \brief Set number of tracked features
+        *
+        * \param value number of tracked features
+        */
+        void SetNbFeatures(uint32_t value);
+
+        /*!
+        * \brief Change number of maximum features
+        *
+        * \param value new number of maximum tracked features
+        */
+        void Resize(uint32_t value);
+
+        OpticalFlowData::Type const &GetDataType() const {return dataType;}
+
+    private:
+        uint32_t max_features;
+        uint32_t nb_features;
+        CvPoint* pointsA;
+        CvPoint2D32f* pointsB;
+        char *found_features;
+        uint32_t *features_error;
+        void CopyDatas(char* dst) const;
+        Type dataType;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // OPTICALFLOWDATA_H
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp	(revision 209)
@@ -0,0 +1,88 @@
+//  created:    2012/04/12
+//  filename:   OpticalFlowSpeed.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    calcul de la vitesse à partir du flux optique
+//
+//
+/*********************************************************************/
+
+#include "OpticalFlowSpeed.h"
+#include "OpticalFlowData.h"
+#include <cvmatrix.h>
+#include <Object.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair
+{
+namespace filter
+{
+
+OpticalFlowSpeed::OpticalFlowSpeed(const IODevice* parent,string name) : IODevice(parent,name)
+{
+  cvmatrix_descriptor* desc=new cvmatrix_descriptor(2,1);
+  desc->SetElementName(0,0,"vx");
+  desc->SetElementName(1,0,"vy");
+  output=new cvmatrix(this,desc,floatType,name);
+  delete desc;
+
+	AddDataToLog(output);
+  
+  SetIsReady(true);
+}
+
+OpticalFlowSpeed::~OpticalFlowSpeed(void)
+{
+}
+
+void OpticalFlowSpeed::UpdateFrom(const io_data *data)
+{
+    OpticalFlowData *input=(OpticalFlowData*)data;
+    float deplx,deply;
+    int nb_depl=0;
+
+    deplx=0;
+    deply=0;
+
+    input->GetMutex();
+    for(int i=0;i<input->NbFeatures();i++) {
+        if(input->FoundFeature()[i]!=0) {
+            deplx+=input->PointsB()[i].x-input->PointsA()[i].x;
+            deply+=input->PointsB()[i].y-input->PointsA()[i].y;
+            nb_depl++;
+        }
+    }
+    input->ReleaseMutex();
+    Time deltaT=data->DataTime()-output->DataTime();
+    output->SetDataTime(data->DataTime());
+
+    if(nb_depl!=0) {
+        output->SetValue(0,0,deplx/(nb_depl*deltaT)*1000*1000*1000);
+        output->SetValue(1,0,deply/(nb_depl*deltaT)*1000*1000*1000);
+    }
+
+    ProcessUpdate(output);
+}
+
+float OpticalFlowSpeed::Vx(void) const
+{
+    return output->Value(0,0);
+}
+
+float OpticalFlowSpeed::Vy(void) const
+{
+    return output->Value(1,0);
+}
+
+core::cvmatrix *OpticalFlowSpeed::Output() const
+{
+    return output;
+}
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/OpticalFlowSpeed.h	(revision 209)
@@ -0,0 +1,89 @@
+/*!
+ * \file OpticalFlowSpeed.h
+ * \brief Optical flow speed calculation
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/04/12
+ * \version 4.0
+ */
+
+
+#ifndef OPTICALFLOWSPEED_H
+#define OPTICALFLOWSPEED_H
+
+#include <IODevice.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class cvmatrix;
+    }
+}
+
+namespace flair
+{
+namespace filter
+{
+    class OpticalFlow;
+
+    /*! \class OpticalFlowSpeed
+    *
+    * \brief Optical flow speed calculation
+    *
+    * Speed is the mean of all optical flow values divided by the delta time between images.
+    */
+    class OpticalFlowSpeed : public core::IODevice
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct OpticalFlowSpeed.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            OpticalFlowSpeed(const core::IODevice* parent,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~OpticalFlowSpeed();
+
+            /*!
+            * \brief Speed along x axis
+            *
+            */
+            float Vx(void) const;
+
+            /*!
+            * \brief Speed along y axis
+            *
+            */
+            float Vy(void) const;
+
+            /*!
+            * \brief Output matrix
+            *
+            * Matrix is of size (2,1). \n
+            * First line is speed along x axis. \n
+            * Second line is speed along y axis. \n
+            */
+            core::cvmatrix *Output() const;
+
+        private:
+            /*!
+            * \brief Update using provided datas
+            *
+            * Reimplemented from IODevice.
+            *
+            * \param data data from the parent to process
+            */
+            void UpdateFrom(const core::io_data *data);
+
+            core::cvmatrix *output;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // OPTICALFLOWSPEED_H
Index: tags/latest/lib/FlairVisionFilter/src/Sobel.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/Sobel.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/Sobel.cpp	(revision 209)
@@ -0,0 +1,80 @@
+//  created:    2015/10/07
+//  filename:   Sobel.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Sobel
+//
+//
+/*********************************************************************/
+
+#include "Sobel.h"
+#include <cvimage.h>
+#include <Layout.h>
+#include <GroupBox.h>
+#include <SpinBox.h>
+#include <typeinfo>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair { namespace filter {
+
+Sobel::Sobel(const IODevice* parent,const LayoutPosition* position,string name) : IODevice(parent,name),output(0) {
+    GroupBox* reglages_groupbox=new GroupBox(position,name);
+    dx=new SpinBox(reglages_groupbox->NewRow(),"dx:",0,1,1,1);
+    dy=new SpinBox(reglages_groupbox->NewRow(),"dy:",0,1,1,1);
+
+    Printf("TODO: IODevice doit faire un check de GetInputDataType et GetOutputDataType\n");
+    //cvimage devrait accepter un type dans son constructeur pour construire un type identique
+    try{
+        cvimage::Type const &imageType=dynamic_cast<cvimage::Type const &>(parent->GetOutputDataType());
+        if(imageType.GetFormat()==cvimage::Type::Format::Gray) {
+            output=new cvimage(this,imageType.GetWidth(),imageType.GetHeight(),imageType.GetFormat(),"sobel");
+        } else {
+            Err("input image is not gray\n");
+            return;
+        }
+
+    } catch(std::bad_cast& bc) {
+        Err("io type mismatch\n");
+        return;
+    }
+    SetIsReady(true);
+}
+
+Sobel::~Sobel(void) {
+}
+
+cvimage* Sobel::Output(void) {
+    return output;
+}
+
+void Sobel::UpdateFrom(const io_data *data) {
+    cvimage *cvImage=(cvimage*)data;
+    IplImage *gimg=cvImage->img;
+/*
+    data->GetMutex();
+    output->GetMutex();
+    dspSobel(gimg,output->img,dx->Value(),dy->Value());
+    output->ReleaseMutex();
+    data->ReleaseMutex();
+*/
+    output->SetDataTime(data->DataTime());
+    ProcessUpdate(output);
+}
+
+DataType const &Sobel::GetOutputDataType() const {
+    if(output!=NULL) {
+        return output->GetDataType();
+    } else {
+        return dummyType;
+    }
+}
+
+} // end namespace filter
+} // end namespace flair
Index: tags/latest/lib/FlairVisionFilter/src/Sobel.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/Sobel.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/Sobel.h	(revision 209)
@@ -0,0 +1,72 @@
+/*!
+ * \file Sobel.h
+ * \brief Sobel algorithm
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/10/07
+ * \version 4.0
+ */
+
+
+#ifndef SOBEL_H
+#define SOBEL_H
+
+#include <IODevice.h>
+#include <cv.h>
+
+namespace flair {
+    namespace core {
+        class cvimage;
+    }
+    namespace gui {
+        class LayoutPosition;
+        class SpinBox;
+    }
+}
+
+namespace flair { namespace filter {
+    /*! \class Sobel
+    *
+    * \brief Sobel algorithm
+    *
+    * Sobel is done using the DSP of the DM3730.
+    */
+    class Sobel : public core::IODevice {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an OpticalFlow filter at given position. \n
+            * After calling this function, position will be deleted as it is no longer usefull. \n
+            *
+            * \param parent parent
+            * \param position position
+            * \param name name
+            */
+            Sobel(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Sobel();
+
+            /*!
+            * \brief Output image
+            *
+            * Output matrix is of the same size as the input image. \n
+            *
+            * \return the output image
+            */
+            core::cvimage* Output(void);
+
+            core::DataType const &GetOutputDataType() const;
+
+        private:
+            void UpdateFrom(const core::io_data *data);
+            core::cvimage *output;
+            gui::SpinBox *dx;
+            gui::SpinBox *dy;
+    };
+} // end namespace filter
+} // end namespace flair
+#endif // SOBEL_H
Index: tags/latest/lib/FlairVisionFilter/src/VisionFilter.cpp
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/VisionFilter.cpp	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/VisionFilter.cpp	(revision 209)
@@ -0,0 +1,22 @@
+#include "VisionFilter.h"
+#include "compile_info.h"
+#include <highgui.h>
+
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairVisionFilter");
+}
+
+void saveToJpeg(IplImage* src_img,std::string filename,PictureFormat_t input_format,PictureFormat_t output_format,unsigned char compression_level) {
+	if(!cvSaveImage(filename.c_str(),src_img)) printf("Could not save.\n");
+}
+
+bool InitVisionFilter(std::string args) {
+  printf("Using default vision lib filter, all functions are not ready!\n");
+	return true;
+}
+
+void CloseVisionFilter(void) {
+  
+}
Index: tags/latest/lib/FlairVisionFilter/src/VisionFilter.h
===================================================================
--- tags/latest/lib/FlairVisionFilter/src/VisionFilter.h	(revision 209)
+++ tags/latest/lib/FlairVisionFilter/src/VisionFilter.h	(revision 209)
@@ -0,0 +1,21 @@
+#include <string>
+#include <cxtypes.h>
+
+/*!
+* \brief InitVisionFilter
+*
+* \return true
+*/
+
+bool InitVisionFilter(std::string args);
+
+void CloseVisionFilter(void);
+
+enum class PictureFormat_t {
+                Gray,/*!< gray 8 bits */
+                RGB,/*!< rgb 24 bits */
+                YUV_422ile,/*!< YUV 4:2:2 interleaved */
+                YUV_422p,/*!< YUV 4:2:2 planer */
+                } ;
+								
+void saveToJpeg(IplImage* src_img,std::string filename,PictureFormat_t input_format,PictureFormat_t output_format,unsigned char compression_level=95);
Index: tags/latest/tools/Controller/DualShock3/CMakeLists.txt
===================================================================
--- tags/latest/tools/Controller/DualShock3/CMakeLists.txt	(revision 209)
+++ tags/latest/tools/Controller/DualShock3/CMakeLists.txt	(revision 209)
@@ -0,0 +1,37 @@
+PROJECT(dualshock3)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+include(${FLAIR_USE_FILE})
+
+ADD_DEFINITIONS(-fpermissive)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+	${CMAKE_SOURCE_DIR}/src
+)
+
+LINK_DIRECTORIES (
+	${FLAIR_LIBRARY_DIR}
+)
+
+ADD_EXECUTABLE(${PROJECT_NAME}
+	src/DualShock3.cpp
+	src/main.cpp
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${FLAIR_LIBRARIES_NRT} bluetooth usb)
+
+INSTALL(
+	TARGETS ${PROJECT_NAME}
+	RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
+)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+else()
+warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
+endif()
Index: tags/latest/tools/Controller/DualShock3/src/DualShock3.cpp
===================================================================
--- tags/latest/tools/Controller/DualShock3/src/DualShock3.cpp	(revision 209)
+++ tags/latest/tools/Controller/DualShock3/src/DualShock3.cpp	(revision 209)
@@ -0,0 +1,768 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/30
+//  filename:   DualShock3.h
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for host side remote controls that talks to target
+//  side through ethernet connection
+//
+//
+/*********************************************************************/
+#include "DualShock3.h"
+#include <Controller.h>
+#include <cvmatrix.h>
+#include <Tab.h>
+#include <TabWidget.h>
+#include <CheckBox.h>
+#include <Label.h>
+#include <DataPlot1D.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <FrameworkManager.h>
+#include <Socket.h>
+#include <sstream>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sstream>
+#include <linux/input.h>
+#include <linux/hidraw.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+
+#define USB_DIR_IN 0x80
+#define USB_DIR_OUT 0
+#define USB_GET_REPORT 0x01
+#define USB_SET_REPORT 0x09
+#define VENDOR_SONY 0x054c
+#define PRODUCT_SIXAXIS_DS3 0x0268
+
+#define L2CAP_PSM_HIDP_CTRL 0x11
+#define L2CAP_PSM_HIDP_INTR 0x13
+
+#define HIDP_TRANS_GET_REPORT 0x40
+#define HIDP_TRANS_SET_REPORT 0x50
+#define HIDP_DATA_RTYPE_OUTPUT 0x02
+#define HIDP_DATA_RTYPE_FEATURE 0x03
+
+#define SIXAXIS 1
+#define DUALSHOCK3 2
+
+#define X_AXIS_RANGE 127
+#define Y_AXIS_RANGE 127
+
+using namespace flair::core;
+using namespace flair::gui;
+using namespace std;
+
+typedef struct motion_dev {
+  int index;
+  bdaddr_t addr;
+  char type;
+  int csk;
+  int isk;
+  struct motion_dev *next;
+} motion_dev_t;
+
+bdaddr_t bdaddr_any = {{0, 0, 0, 0, 0, 0}};
+
+namespace flair {
+namespace sensor {
+
+DualShock3::DualShock3(string name,
+                       string receiverAddress, int receiverPort,
+                       ConnectionType_t _connectionType, uint32_t period,
+                       uint32_t bitsPerAxis, uint8_t priority)
+    : HostEthController(name, receiverAddress, receiverPort, period,
+                        bitsPerAxis, priority),
+      connectionType(_connectionType) {
+  controllerName = "DualShock3";
+  last_voltage_time = 0;
+
+  // axis stuff
+  axisNumber = 4;
+  nativeBitsPerAxis = 8;
+  cvmatrix_descriptor *axisDescriptor = new cvmatrix_descriptor(axisNumber, 1);
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    axisDescriptor->SetElementName(i, 0, GetAxisDescription(i));
+  }
+  axis = new cvmatrix((IODevice *)this, axisDescriptor, Int16Type);
+  delete axisDescriptor;
+  AddDataToLog(axis);
+
+  // buttons stuff
+  buttonNumber = 16;
+  cvmatrix_descriptor *buttonDescriptor =
+      new cvmatrix_descriptor(buttonNumber, 1);
+  for (unsigned int i = 0; i < buttonNumber; i++) {
+    buttonDescriptor->SetElementName(i, 0, GetButtonDescription(i));
+  }
+  button = new cvmatrix((IODevice *)this, buttonDescriptor, Int8Type);
+  AddDataToLog(button);
+
+  Tab *settingsTab = new Tab(tabWidget, "Settings");
+  dataSize = 6;
+  datas = new int8_t[dataSize];
+
+  GroupBox *settingsGroupBox =
+      new GroupBox(settingsTab->NewRow(), controllerName);
+  deadZone =
+      new SpinBox(settingsGroupBox->NewRow(), "dead zone:", -130, 130, 1);
+  batteryChargeLevel =
+      new Label(settingsGroupBox->LastRowLastCol(), "battery charge level");
+  enabled = new CheckBox(settingsGroupBox->LastRowLastCol(), "enabled");
+
+  if (connectionType == Bluetooth) {
+    // init DS3
+    usb_scan();
+
+    int csk = l2cap_listen(&bdaddr_any, L2CAP_PSM_HIDP_CTRL);
+    isk = l2cap_listen(&bdaddr_any, L2CAP_PSM_HIDP_INTR);
+
+    if (csk >= 0 && isk >= 0)
+      Printf("Waiting for Bluetooth connections.\n");
+    else
+      Thread::Err("Unable to listen on HID PSMs.\n");
+
+    fd_set fds;
+    FD_ZERO(&fds);
+
+    if (csk >= 0)
+      FD_SET(csk, &fds);
+    if (select(csk + 1, &fds, NULL, NULL, NULL) < 0)
+      Thread::Err("select\n");
+    // Incoming connection ?
+
+    if (csk >= 0 && FD_ISSET(csk, &fds)) {
+      // printf("accept\n");
+      dev = accept_device(csk, isk);
+      setup_device(dev);
+    }
+  } else if (connectionType == Usb) {
+    int nr, i;
+    unsigned char buf[128];
+
+    for (i = 0; i < 255; i++) {
+      ostringstream dev_name;
+      dev_name << "/dev/hidraw" << i;
+      if ((usb_fd = open(dev_name.str().c_str(), O_RDONLY)) >= 0) {
+        int res = 0;
+        struct hidraw_devinfo info;
+
+        res = ioctl(usb_fd, HIDIOCGRAWINFO, &info);
+        if (res < 0) {
+          Thread::Err("ioctl error (HIDIOCGRAWINFO) on %s\n",
+                      dev_name.str().c_str());
+        } else {
+          // Printf("%x %x\n", info.vendor, info.product);
+          if (info.vendor == 0x054c && info.product == 0x0268) {
+            Printf("successfully opened %s\n", dev_name.str().c_str());
+            Printf("Press PS button to turn the controller on\n");
+            break;
+          }
+        }
+        close(usb_fd);
+      }
+    }
+    if (i == 255) {
+      Thread::Err("sixad-raw::open(hidrawX) - failed to open hidraw device\n");
+      return;
+    }
+
+    // block until PS button is pressed
+    if ((nr = read(usb_fd, buf, sizeof(buf))) < 0) {
+      Thread::Err("sixad-raw::read(fd) - failed to read from device\n");
+    }
+
+    if (nr < 49 || nr > 50) {
+      Thread::Err("sixad-raw::read(fd) - not a sixaxis (nr = %i )\n", nr);
+    }
+  }
+  ledmask = 0;
+}
+
+DualShock3::~DualShock3() {
+  if (connectionType == Usb) {
+    close(usb_fd);
+  }
+  if (connectionType == Bluetooth) {
+    if (!popen("/etc/init.d/bluetooth restart", "r"))
+      Thread::Warn("Could not restart bluetooth service\n");
+  }
+}
+
+string DualShock3::GetAxisDescription(unsigned int axis) {
+  string description;
+
+  switch (axis) {
+  case 0:
+    description = "left stick x-axis";
+    break;
+  case 1:
+    description = "left stick y-axis";
+    break;
+  case 2:
+    description = "right stick x-axis";
+    break;
+  case 3:
+    description = "right stick y-axis";
+    break;
+  }
+  return description;
+}
+
+string DualShock3::GetButtonDescription(unsigned int button) {
+  switch (button) {
+  case 0:
+    return "start";
+    break;
+  case 1:
+    return "select";
+    break;
+  case 2:
+    return "square";
+    break;
+  case 3:
+    return "triangle";
+    break;
+  case 4:
+    return "circle";
+    break;
+  case 5:
+    return "cross";
+    break;
+  case 6:
+    return "left 1";
+    break;
+  case 7:
+    return "left 2";
+    break;
+  case 8:
+    return "left 3";
+    break;
+  case 9:
+    return "right 1";
+    break;
+  case 10:
+    return "right 2";
+    break;
+  case 11:
+    return "right 3";
+    break;
+  case 12:
+    return "up";
+    break;
+  case 13:
+    return "down";
+    break;
+  case 14:
+    return "left";
+    break;
+  case 15:
+    return "right";
+    break;
+  }
+}
+
+bool DualShock3::IsDataFrameReady() {
+  unsigned char report[256];
+  unsigned char tmp_report[256];
+
+  if (!enabled->IsChecked()) {
+    meaningfulDataAvailable = false;
+    usleep(100000);
+    return false;
+  }
+  now = GetTime();
+  if (connectionType == Bluetooth) {
+    fd_set fds;
+    FD_ZERO(&fds);
+    int fdmax = 0; /*
+     if ( isk >= 0 ) FD_SET(isk, &fds);
+     if ( isk > fdmax ) fdmax = isk;
+*/
+    FD_SET(dev->isk, &fds);
+    if (dev->isk > fdmax)
+      fdmax = dev->isk;
+
+    if (select(fdmax + 1, &fds, NULL, NULL, NULL) < 0)
+      fatal("select");
+
+    // Incoming input report ?
+    if (FD_ISSET(dev->isk, &fds)) {
+      int nr;
+      int recv_result;
+      bool flushed = false;
+      while (!flushed) {
+        recv_result = recv(dev->isk, tmp_report, sizeof(report), MSG_DONTWAIT);
+        if (recv_result <= 0) {
+          if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
+            fprintf(stderr, "%d disconnected\n", dev->index);
+            close(dev->csk);
+            close(dev->isk);
+            free(dev);
+            return false;
+          } else {
+            flushed = true;
+            // fprintf(stderr, "\n");
+            continue;
+          }
+        } else {
+          // fprintf(stderr, ".");
+          nr = recv_result;
+          memcpy(report, tmp_report, nr);
+        }
+      }
+      if (report[0] == 0xa1) {
+        return parse_report_sixaxis_ds3(report + 1, nr - 1);
+      }
+    }
+    return false;
+
+  } else if (connectionType == Usb) {
+    int nr = read(usb_fd, report, sizeof(report));
+    return parse_report_sixaxis_ds3(report, nr);
+  }
+  return false;
+}
+
+bool DualShock3::parse_report_sixaxis_ds3(unsigned char *r, int len) {
+  if (r[0] == 0x01 && r[1] == 0 && len >= 49) {
+    datas[0] = r[2];
+    datas[1] = r[3];
+    datas[2] = compute_dead_zone(0, r[6]);
+    datas[3] = compute_dead_zone(1, r[7]);
+    datas[4] = compute_dead_zone(2, r[8]);
+    datas[5] = compute_dead_zone(3, r[9]);
+
+    if (GetTime() > (last_voltage_time + 5 * (Time)1000000000)) {
+      // toute les 5 secondes
+      // report battery charge level
+      if (connectionType == Bluetooth) {
+        batteryChargeLevel->SetText("battery: %i/5", r[30]);
+      }
+      if (connectionType == Usb) {
+        batteryChargeLevel->SetText("battery: usb connected");
+      }
+      last_voltage_time = GetTime();
+    }
+
+    return true;
+  }
+  return false;
+}
+
+void DualShock3::GetAxisData() {
+
+  axis->GetMutex();
+  //    axis->SetValueNoMutex(0, 0,datas[2]/(float)X_AXIS_RANGE); //left stick
+  //    x-axis
+  //    axis->SetValueNoMutex(1, 0,datas[3]/(float)Y_AXIS_RANGE); //left stick
+  //    y-axis
+  //    axis->SetValueNoMutex(2, 0,datas[4]/(float)X_AXIS_RANGE); //right stick
+  //    x-axis
+  //    axis->SetValueNoMutex(3, 0,datas[5]/(float)Y_AXIS_RANGE); //right stick
+  //    y-axis
+  axis->SetValueNoMutex(0, 0, datas[2]); // left stick x-axis
+  axis->SetValueNoMutex(1, 0, datas[3]); // left stick y-axis
+  axis->SetValueNoMutex(2, 0, datas[4]); // right stick x-axis
+  axis->SetValueNoMutex(3, 0, datas[5]); // right stick y-axis
+  axis->ReleaseMutex();
+  axis->SetDataTime(now);
+}
+
+void DualShock3::GetButtonData() {
+  // static uint8_t old_start_button=0;
+  button->GetMutex();
+  button->SetValueNoMutex(0, 0, (datas[0] & 0x08) == 0 ? 0 : 1); // start
+  /*
+      uint8_t start_button=datas[0]&0x08;
+      if (start_button!=old_start_button) {
+          if (start_button==0) {
+              Thread::Info("Debug: start button released\n");
+          } else {
+              Thread::Info("Debug: start button pressed\n");
+          }
+          old_start_button=start_button;
+      }
+  */
+  button->SetValueNoMutex(1, 0, (datas[0] & 0x01) == 0 ? 0 : 1); // select
+  button->SetValueNoMutex(2, 0, (datas[1] & 0x80) == 0 ? 0 : 1); // square
+  button->SetValueNoMutex(3, 0, (datas[1] & 0x10) == 0 ? 0 : 1); // triangle
+  button->SetValueNoMutex(4, 0, (datas[1] & 0x20) == 0 ? 0 : 1); // circle
+  button->SetValueNoMutex(5, 0, (datas[1] & 0x40) == 0 ? 0 : 1); // cross
+  button->SetValueNoMutex(6, 0, (datas[1] & 0x04) == 0 ? 0 : 1); // left 1
+  button->SetValueNoMutex(7, 0, (datas[1] & 0x01) == 0 ? 0 : 1); // left 2
+  button->SetValueNoMutex(8, 0, (datas[0] & 0x02) == 0 ? 0 : 1); // left 3
+  button->SetValueNoMutex(9, 0, (datas[1] & 0x08) == 0 ? 0 : 1); // right 1
+  button->SetValueNoMutex(10, 0, (datas[1] & 0x02) == 0 ? 0 : 1); // right 2
+  button->SetValueNoMutex(11, 0, (datas[0] & 0x04) == 0 ? 0 : 1); // right 3
+  button->SetValueNoMutex(12, 0, (datas[0] & 0x10) == 0 ? 0 : 1); // up
+  button->SetValueNoMutex(13, 0, (datas[0] & 0x40) == 0 ? 0 : 1); // down
+  button->SetValueNoMutex(14, 0, (datas[0] & 0x80) == 0 ? 0 : 1); // left
+  button->SetValueNoMutex(15, 0, (datas[0] & 0x20) == 0 ? 0 : 1); // right
+  button->ReleaseMutex();
+  button->SetDataTime(now);
+}
+
+void DualShock3::ProcessMessage(core::Message *controllerAction) {
+  ControllerAction action;
+  memcpy(&action, controllerAction->buffer, sizeof(ControllerAction));
+  if (action == ControllerAction::SetLedOn) {
+    Thread::Info("LedOn action request\n");
+  } else if (action == ControllerAction::SetLedOff) {
+    Thread::Info("LedOff action request\n");
+  } else if (action == ControllerAction::Rumble) {
+    Thread::Info("Rumble action request\n");
+  } else if (action == ControllerAction::FlashLed) {
+    Thread::Info("FlashLed action request\n");
+  }
+  // (char *msg, int msgSize)
+  /*    for (unsigned int i=0; i<4; i++) {
+          if(msg[4+2*i]!=0 || msg[5+2*i]!=0) set_led(i+1,msg[4+2*i],msg[5+2*i]);
+
+      }
+      if(msg[0]!=0 || msg[2]!=0) rumble(msg[0],msg[1],msg[2],msg[3]);
+          */
+}
+
+// ----------------------------------------------------------------------
+// Replacement for libbluetooth
+
+int DualShock3::mystr2ba(const char *s, bdaddr_t *ba) {
+  if (strlen(s) != 17)
+    return 1;
+  for (int i = 0; i < 6; ++i) {
+    int d = strtol(s + 15 - 3 * i, NULL, 16);
+    if (d < 0 || d > 255)
+      return 1;
+    ba->b[i] = d;
+  }
+  return 0;
+}
+
+char *DualShock3::myba2str(const bdaddr_t *ba) {
+  static char buf[2][18]; // Static buffer valid for two invocations.
+  static int index = 0;
+  index = (index + 1) % 2;
+  sprintf(buf[index], "%02x:%02x:%02x:%02x:%02x:%02x", ba->b[5], ba->b[4],
+          ba->b[3], ba->b[2], ba->b[1], ba->b[0]);
+  return buf[index];
+}
+
+void DualShock3::fatal(const char *msg) {
+  if (errno)
+    perror(msg);
+  else
+    fprintf(stderr, "%s\n", msg);
+  exit(1);
+}
+
+/**********************************************************************/
+// Bluetooth HID devices
+// Incoming connections.
+
+int DualShock3::l2cap_listen(const bdaddr_t *bdaddr, unsigned short psm) {
+  int sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
+  if (sk < 0)
+    fatal("socket");
+
+  struct sockaddr_l2 addr;
+  addr.l2_family = AF_BLUETOOTH;
+  addr.l2_bdaddr = *BDADDR_ANY;
+  addr.l2_psm = htobs(psm);
+  addr.l2_cid = 0;
+
+  if (bind(sk, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+    close(sk);
+    fatal("bind");
+  }
+
+  if (listen(sk, 5) < 0)
+    fatal("listen");
+  return sk;
+}
+
+struct motion_dev *DualShock3::accept_device(int csk, int isk) {
+  Printf("Incoming connection...\n");
+  struct motion_dev *dev = (motion_dev *)malloc(sizeof(struct motion_dev));
+  if (!dev)
+    fatal("malloc");
+
+  dev->csk = accept(csk, NULL, NULL);
+  if (dev->csk < 0)
+    fatal("accept(CTRL)");
+  dev->isk = accept(isk, NULL, NULL);
+  if (dev->isk < 0)
+    fatal("accept(INTR)");
+
+  struct sockaddr_l2 addr;
+  socklen_t addrlen = sizeof(addr);
+  if (getpeername(dev->isk, (struct sockaddr *)&addr, &addrlen) < 0)
+    fatal("getpeername");
+  dev->addr = addr.l2_bdaddr;
+
+  // Distinguish SIXAXIS / DS3
+  unsigned char resp[64];
+  char get03f2[] = {HIDP_TRANS_GET_REPORT | HIDP_DATA_RTYPE_FEATURE | 8,
+                    (char)0xf2, sizeof(resp), sizeof(resp) >> 8};
+  send(dev->csk, get03f2, sizeof(get03f2), 0); // 0301 is interesting too.
+  int nr = recv(dev->csk, resp, sizeof(resp), 0);
+
+  dev->type = (resp[13] == 0x40) ? SIXAXIS : DUALSHOCK3; // My guess.
+
+  return dev;
+}
+
+/**********************************************************************/
+// Device setup
+
+#define IR0 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00, 0x41
+#define IR1 0x40, 0x00
+
+#define BIT1 2
+
+void DualShock3::hidp_trans(int csk, char *buf, int len) {
+  if (send(csk, buf, len, 0) != len)
+    fatal("send(CTRL)");
+  char ack;
+  int nr = recv(csk, &ack, sizeof(ack), 0);
+  if (nr != 1 || ack != 0)
+    fatal("ack");
+}
+
+void DualShock3::setup_device(struct motion_dev *dev) {
+
+  switch (dev->type) {
+  case SIXAXIS:
+  case DUALSHOCK3:
+    // Enable reporting
+    char set03f4[] = {HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE,
+                      (char)0xf4, 0x42, 0x03, 0x00, 0x00};
+    hidp_trans(dev->csk, set03f4, sizeof(set03f4));
+
+    break;
+  }
+}
+
+/**********************************************************************/
+// Reports
+
+// faire un reglage station sol pour dead zone
+int8_t DualShock3::compute_dead_zone(int axis, unsigned char value) {
+  float tmp;
+
+  if (value > 128 + deadZone->Value()) {
+    tmp =
+        (value - deadZone->Value() - 128.) * 128. / (128. - deadZone->Value());
+  } else if (value < 128 - deadZone->Value()) {
+    // return value+DEAD_ZONE-128;
+    tmp =
+        (value + deadZone->Value() - 128.) * 127. / (128. - deadZone->Value());
+  } else {
+    return 0;
+  }
+
+  if (tmp > 127)
+    return 127;
+  if (tmp < -127)
+    return -127;
+  if (tmp > ((int8_t)tmp + .5) && tmp > 0)
+    return (int8_t)(tmp + 1);
+  if (tmp < ((int8_t)tmp - .5) && tmp < 0)
+    return (int8_t)(tmp - 1);
+
+  return (int8_t)tmp;
+}
+
+/**********************************************************************/
+// USB functions
+
+void DualShock3::usb_pair_device(struct usb_device *dev, int itfnum) {
+
+  usb_dev_handle *devh = usb_open(dev);
+  if (!devh)
+    fatal("usb_open");
+  usb_detach_kernel_driver_np(devh, itfnum);
+  int res = usb_claim_interface(devh, itfnum);
+  if (res < 0)
+    fatal("usb_claim_interface");
+
+  bdaddr_t current_ba; // Current pairing address.
+
+  switch (dev->descriptor.idProduct) {
+  case PRODUCT_SIXAXIS_DS3: {
+    // remote_printf("USB: SIXAXIS/DS3\n");
+    char msg[8];
+    res =
+        usb_control_msg(devh, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+                        USB_GET_REPORT, 0x03f5, itfnum, msg, sizeof(msg), 5000);
+    /*
+            unsigned char msg[8];
+            res = usb_control_msg
+                  (devh, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+                   USB_GET_REPORT, 0x03f5, itfnum, (void*)msg, sizeof(msg),
+       5000);*/
+    if (res < 0)
+      fatal("usb_control_msg(read master)");
+    for (int i = 0; i < 6; ++i)
+      current_ba.b[i] = (uint8_t)msg[7 - i];
+    break;
+  }
+  }
+
+  // New pairing address
+  int dev_id;
+  dev_id = hci_get_route(NULL);
+  struct hci_dev_info di;
+  hci_devinfo(dev_id, &di);
+
+  // Perform pairing.
+  if (!bacmp(&current_ba, &di.bdaddr)) {
+    printf("  Already paired to %s\n", myba2str(&di.bdaddr));
+  } else {
+    printf("  Changing master from %s to %s\n", myba2str(&current_ba),
+           myba2str(&di.bdaddr));
+    switch (dev->descriptor.idProduct) {
+    case PRODUCT_SIXAXIS_DS3: {
+      char msg[8] = {0x01, 0x00, (char)di.bdaddr.b[5], (char)di.bdaddr.b[4],
+                     (char)di.bdaddr.b[3], (char)di.bdaddr.b[2],
+                     (char)di.bdaddr.b[1], (char)di.bdaddr.b[0]};
+      res = usb_control_msg(
+          devh, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+          USB_SET_REPORT, 0x03f5, itfnum, msg, sizeof(msg), 5000);
+      if (res < 0)
+        fatal("usb_control_msg(write master)");
+      break;
+    }
+    }
+  }
+
+  if (dev->descriptor.idProduct == PRODUCT_SIXAXIS_DS3)
+    printf("  Now unplug the USB cable and press the PS button.\n");
+  else
+    printf("  Now press the PS button.\n");
+}
+
+void DualShock3::usb_scan() {
+  usb_init();
+  if (usb_find_busses() < 0)
+    fatal("usb_find_busses");
+  if (usb_find_devices() < 0)
+    fatal("usb_find_devices");
+  struct usb_bus *busses = usb_get_busses();
+  if (!busses)
+    fatal("usb_get_busses");
+
+  struct usb_bus *bus;
+  for (bus = busses; bus; bus = bus->next) {
+    struct usb_device *dev;
+    for (dev = bus->devices; dev; dev = dev->next) {
+      struct usb_config_descriptor *cfg;
+      for (cfg = dev->config;
+           cfg < dev->config + dev->descriptor.bNumConfigurations; ++cfg) {
+        int itfnum;
+        for (itfnum = 0; itfnum < cfg->bNumInterfaces; ++itfnum) {
+          struct usb_interface *itf = &cfg->interface[itfnum];
+          struct usb_interface_descriptor *alt;
+          for (alt = itf->altsetting;
+               alt < itf->altsetting + itf->num_altsetting; ++alt) {
+            if (dev->descriptor.idVendor == VENDOR_SONY &&
+                (dev->descriptor.idProduct == PRODUCT_SIXAXIS_DS3) &&
+                alt->bInterfaceClass == 3)
+              usb_pair_device(dev, itfnum);
+          }
+        }
+      }
+    }
+  }
+}
+
+void DualShock3::rumble(uint8_t left_force, uint8_t left_timeout,
+                        uint8_t right_force, uint8_t right_timeout) {
+  // printf("rumble\n");
+
+  unsigned char datas[] = {
+      0x52 /* HIDP_TRANS_SET_REPORT|HIDP_DATA_RTYPE_OUPUT */, 0x01, 0x00, 0x00,
+      0x00, 0x00, 0x00, // rumble values
+      0x00, 0x00, 0x00, 0x00, (unsigned char)ledmask, // 0x10=LED1 .. 0x02=LED4
+
+      0xff, 0x27, led4_on, led4_off, 0x32, 0xff, 0x27, led3_on, led3_off, 0x32,
+      0xff, 0x27, led2_on, led2_off, 0x32, 0xff, 0x27, led1_on, led1_off, 0x32,
+      0x00, 0x00, 0x00, 0x00, 0x00,
+  };
+
+  datas[5] = left_timeout;  // left timeout
+  datas[6] = left_force;    // left force
+  datas[3] = right_timeout; // right timeout
+  datas[4] = right_force;   // right force
+
+  if (connectionType == Bluetooth) {
+    hidp_trans(dev->csk, (char *)datas, sizeof(datas));
+  }
+}
+
+void DualShock3::set_led(uint8_t led, uint8_t on_timeout, uint8_t off_timeout) {
+  uint8_t mask;
+
+  switch (led) {
+  case 1:
+    led1_on = on_timeout;
+    led1_off = off_timeout;
+    mask = 2;
+    break;
+  case 2:
+    led2_on = on_timeout;
+    led2_off = off_timeout;
+    mask = 4;
+    break;
+  case 3:
+    led3_on = on_timeout;
+    led3_off = off_timeout;
+    mask = 8;
+    break;
+  case 4:
+    led4_on = on_timeout;
+    led4_off = off_timeout;
+    mask = 16;
+    break;
+  }
+
+  if (on_timeout != 0) {
+    ledmask |= mask;
+  } else {
+    ledmask &= ~mask;
+  }
+  /*
+      printf("led %x\n",ledmask);
+      printf("1:%i %i\n",led1_on,led1_off);
+      printf("2:%i %i\n",led2_on,led2_off);
+      printf("3:%i %i\n",led3_on,led3_off);
+      printf("4:%i %i\n",led4_on,led4_off);*/
+
+  unsigned char datas[] = {
+      0x52 /* HIDP_TRANS_SET_REPORT|HIDP_DATA_RTYPE_OUPUT */, 0x01, 0x00, 0x00,
+      0x00, 0x00, 0x00, // rumble values
+      0x00, 0x00, 0x00, 0x00, (unsigned char)ledmask, // 0x10=LED1 .. 0x02=LED4
+
+      0xff, 0x27, led4_on, led4_off, 0x32, 0xff, 0x27, led3_on, led3_off, 0x32,
+      0xff, 0x27, led2_on, led2_off, 0x32, 0xff, 0x27, led1_on, led1_off, 0x32,
+      0x00, 0x00, 0x00, 0x00, 0x00,
+  };
+
+  if (connectionType == Bluetooth) {
+    hidp_trans(dev->csk, (char *)datas, sizeof(datas));
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
Index: tags/latest/tools/Controller/DualShock3/src/DualShock3.h
===================================================================
--- tags/latest/tools/Controller/DualShock3/src/DualShock3.h	(revision 209)
+++ tags/latest/tools/Controller/DualShock3/src/DualShock3.h	(revision 209)
@@ -0,0 +1,105 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/03/31
+//  filename:   DualShock3.h
+//
+//  authors:    pabr.org, Gildas Bayard
+//              Copyright (c) 2010 pabr@pabr.org
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Sony DualShock3 host side driver class. Talks to target side
+//  through ethernet.
+//
+//
+/*********************************************************************/
+
+#ifndef DUALSHOCK3_H
+#define DUALSHOCK3_H
+
+#include <HostEthController.h>
+
+#include <stdint.h>
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/l2cap.h>
+#include <usb.h>
+
+namespace flair {
+namespace core {
+class FrameworkManager;
+}
+namespace gui {
+class SpinBox;
+class Label;
+class CheckBox;
+}
+}
+
+struct motion_dev;
+
+namespace flair {
+namespace sensor {
+/*! \class DualShock3
+*
+* \brief Sony DualShock3 host side driver class. Talks to target side through
+*ethernet.
+*/
+class DualShock3 : public HostEthController {
+public:
+  typedef enum { Usb, Bluetooth } ConnectionType_t;
+
+  DualShock3(std::string name,
+             std::string receiverAddress, int receiverPort,
+             ConnectionType_t connectionType, uint32_t period = 10,
+             uint32_t bitsPerAxis = 7, uint8_t priority = 0);
+  ~DualShock3();
+
+private:
+  gui::SpinBox *deadZone;
+  gui::CheckBox *enabled;
+  gui::Label *batteryChargeLevel;
+  ConnectionType_t connectionType;
+  core::Time now;
+
+  std::string GetAxisDescription(unsigned int axis);
+  std::string GetButtonDescription(unsigned int button);
+  void GetAxisData();
+  void GetButtonData();
+  bool IsDataFrameReady();
+  void ProcessMessage(core::Message *controllerAction);
+
+  void UpdateFrom(const core::io_data *data){};
+  void fatal(const char *msg);
+  int l2cap_listen(const bdaddr_t *bdaddr, unsigned short psm);
+  struct motion_dev *accept_device(int csk, int isk);
+  void hidp_trans(int csk, char *buf, int len);
+  void setup_device(struct motion_dev *dev);
+  bool parse_report_sixaxis_ds3(unsigned char *r, int len);
+  int mystr2ba(const char *s, bdaddr_t *ba);
+  char *myba2str(const bdaddr_t *ba);
+  int8_t compute_dead_zone(int axis, unsigned char value);
+  struct motion_dev *dev;
+  int usb_fd;
+  int isk;
+  core::Time last_voltage_time;
+
+  int8_t *datas;
+  uint8_t dataSize;
+
+  void usb_scan();
+  void usb_pair_device(struct usb_device *dev, int itfnum);
+
+  void rumble(uint8_t left_force, uint8_t left_timeout, uint8_t right_force,
+              uint8_t right_timeout);
+  void set_led(uint8_t led, uint8_t on_timeout, uint8_t off_timeout);
+  char ledmask;
+  uint8_t led1_on, led1_off, led2_on, led2_off, led3_on, led3_off, led4_on,
+      led4_off;
+};
+}
+}
+
+#endif // DUALSHOCK3_H
Index: tags/latest/tools/Controller/DualShock3/src/main.cpp
===================================================================
--- tags/latest/tools/Controller/DualShock3/src/main.cpp	(revision 209)
+++ tags/latest/tools/Controller/DualShock3/src/main.cpp	(revision 209)
@@ -0,0 +1,109 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/20
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 6599
+//
+//  version:    $Id: $
+//
+//  purpose:    main dual shock 3
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager.h"
+#include "DualShock3.h"
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+using namespace flair::sensor;
+
+string receiverAddress;
+int receiverPort;
+string connection;
+int port;
+uint32_t period;
+string xml_file;
+
+void parseOptions(int argc, char **argv);
+
+int main(int argc, char *argv[]) {
+  parseOptions(argc, argv);
+
+  DualShock3 *joystick;
+  FrameworkManager *manager;
+
+  manager = new FrameworkManager("dualshock3");
+  manager->SetupConnection("127.0.0.1", port);
+  manager->SetupUserInterface(xml_file);
+
+  if (connection == "usb") {
+    //        manager->Warn("!! adresse = %s !!\n", address.c_str());
+    joystick = new DualShock3("dualshock3", receiverAddress,
+                              receiverPort, DualShock3::Usb, period, 6);
+  } else {
+    joystick = new DualShock3("dualshock3", receiverAddress,
+                              receiverPort, DualShock3::Bluetooth, period, 6);
+  }
+
+  joystick->DrawUserInterface();
+
+  if (!manager->ErrorOccured()) {
+    joystick->Start();
+    joystick->Join();
+  }
+
+  delete manager;
+}
+
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> addressArg("a", "address",
+                                "data receiver address (ex: uav)", true,
+                                "127.0.0.1:20000", "string");
+    cmd.add(addressArg);
+
+    ValueArg<string> connectionArg("c", "connection",
+                                   "connection type (usb or bluetooth)", false,
+                                   "bluetooth", "string");
+    cmd.add(connectionArg);
+
+    ValueArg<int> portArg("p", "port",
+                          "local port used to connect to the ground station",
+                          false, 9000, "int");
+    cmd.add(portArg);
+
+    ValueArg<int> periodArg("t", "period", "sending data period", false, 10,
+                            "int");
+    cmd.add(periodArg);
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml",
+                            "string");
+    cmd.add(xmlArg);
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    string receiverAddressWithPort = addressArg.getValue();
+    int semiColonPosition = receiverAddressWithPort.find(":");
+    receiverAddress = receiverAddressWithPort.substr(0, semiColonPosition);
+    receiverPort =
+        atoi(receiverAddressWithPort.substr(semiColonPosition + 1).c_str());
+    connection = connectionArg.getValue();
+    port = portArg.getValue();
+    period = periodArg.getValue();
+    xml_file = xmlArg.getValue();
+
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
Index: tags/latest/tools/Controller/Mavlink/CMakeLists.txt
===================================================================
--- tags/latest/tools/Controller/Mavlink/CMakeLists.txt	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/CMakeLists.txt	(revision 209)
@@ -0,0 +1,34 @@
+PROJECT(MavPlanner)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+
+include(${FLAIR_USE_FILE})
+
+ADD_DEFINITIONS(-fpermissive)
+
+INCLUDE_DIRECTORIES(
+	${FLAIR_INCLUDE_DIR}
+	${CMAKE_SOURCE_DIR}/src
+	${CMAKE_SOURCE_DIR}/src/mavlink_generated_messages/common
+)
+
+FILE(GLOB MAVPLANNER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+ADD_EXECUTABLE(${PROJECT_NAME}
+	${MAVPLANNER_SRC}
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${FLAIR_LIBRARIES_NRT})
+
+INSTALL(
+	TARGETS ${PROJECT_NAME}
+	RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
+)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+else()
+warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
+endif()
Index: tags/latest/tools/Controller/Mavlink/src/CallbackTimer.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/CallbackTimer.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/CallbackTimer.h	(revision 209)
@@ -0,0 +1,60 @@
+//  created:    17/12/2015
+//  updated:    25/07/2016
+//  filename:   CallbackTimer.h
+//
+//  author:     Milan Erdelj
+//
+//  version:    $Id: $
+//
+//  purpose:    Callback timer class (executing functions periodically)
+//
+//
+/*********************************************************************/
+
+#ifndef CALLBACKTIMER_H
+#define CALLBACKTIMER_H
+
+#include <functional>
+#include <chrono>
+#include <future>
+#include <cstdio>
+#include <iostream>
+
+class CallbackTimer {
+public:
+    CallbackTimer() :_execute(false) {}
+
+    ~CallbackTimer() {
+        if(_execute.load(std::memory_order_acquire)) {
+            stop();
+        }
+    }
+
+    void stop() {
+        _execute.store(false, std::memory_order_release);
+        if(_thd.joinable()) _thd.join();
+    }
+
+    void start(uint64_t interval, std::function<void(void)> callback) {
+        if(_execute.load(std::memory_order_acquire)) {
+            stop();
+        }
+        _execute.store(true, std::memory_order_release);
+        _thd = std::thread([this, interval, callback]() {
+            while (_execute.load(std::memory_order_acquire)) {
+                callback();
+                std::this_thread::sleep_for(std::chrono::microseconds(interval));
+            }
+        });
+    }
+
+    bool is_running() const noexcept {
+        return ( _execute.load(std::memory_order_acquire) && _thd.joinable() );
+    }
+
+private:
+    std::atomic<bool> _execute;
+    std::thread _thd;
+};
+
+#endif // CALLBACKTIMER_H
Index: tags/latest/tools/Controller/Mavlink/src/Config.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/Config.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/Config.h	(revision 209)
@@ -0,0 +1,21 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Config.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Globals for configuration of MavPlanner
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_CONFIG_H
+#define MAVPLANNER_CONFIG_H
+
+#endif // MAVPLANNER_CONFIG_H
Index: tags/latest/tools/Controller/Mavlink/src/Forwarder.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/Forwarder.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/Forwarder.cpp	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Forwarder.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Forward input data to output data, using sockets
+//
+//
+/*********************************************************************/
+
+#include "Forwarder.h"
+
+#include <UdpSocket.h>
+#include <Thread.h>
+#include <FrameworkManager.h>
+
+//todo remove for tests
+#include <iostream>
+
+using namespace std;
+using namespace flair::core;
+
+Forwarder::Forwarder(string name, string &inputAddress,
+					 int inputPort, string &outputAddress, int outputPort):
+					 Thread(getFrameworkManager(), name, 6), inputAddress(inputAddress), 
+					 inputPort(inputPort), outputAddress(outputAddress),
+					 outputPort(outputPort) {
+  cout << "MavPlanner Forwarder constructor" << endl;
+
+  // string tmpOutput = outputAddress + ":" + to_string(outputPort);
+  // cout << "MavPlanner Forwarder output address : " << tmpOutput << endl;
+
+  // cout << "input socket : " << inputAddress + ":" + to_string(inputPort) << endl;
+  // cout << "output socket : " << outputAddress + ":" + to_string(outputPort) << endl;
+
+  inputSocket = new UdpSocket((Thread *)this, "input socket", inputPort);
+  outputSocket = new UdpSocket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
+}
+
+Forwarder::~Forwarder() {
+
+}
+
+void Forwarder::Run() {
+  if (getFrameworkManager()->ErrorOccured()) {
+    SafeStop();
+    Thread::Err("An error occurred, we don't launch the Run loop.\n");
+  }
+  int recvDataSize = 0;
+  char inputBuffer[200];
+  while (!ToBeStopped()) {
+    recvDataSize = inputSocket->RecvMessage(inputBuffer, 200, 1000000000);
+	  outputSocket->SendMessage(inputBuffer, recvDataSize);
+  }
+}
Index: tags/latest/tools/Controller/Mavlink/src/Forwarder.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/Forwarder.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/Forwarder.h	(revision 209)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Forwarder.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Forward input data to output data, using sockets
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_FORWARDER_H
+#define MAVPLANNER_FORWARDER_H
+
+#include <string>
+
+#include <Thread.h>
+
+namespace flair { namespace core {
+  class UdpSocket;
+} }
+
+class Forwarder : public flair::core::Thread {
+public:
+
+  Forwarder(std::string name,
+  			std::string &inputAddress, int inputPort,
+  			std::string &outputAddress, int outputPort);
+  ~Forwarder();
+
+private:
+  // reimplement the run of the Thread class
+  void Run();
+
+  flair::core::UdpSocket *inputSocket;
+  std::string inputAddress;
+  int inputPort;
+  char *inputBuffer;
+  const int inputBufferSize = 200;
+
+  flair::core::UdpSocket *outputSocket;
+  std::string outputAddress;
+  int outputPort;
+
+};
+
+#endif // MAVPLANNER_FORWARDER_H
Index: tags/latest/tools/Controller/Mavlink/src/GuiFlair.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiFlair.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiFlair.cpp	(revision 209)
@@ -0,0 +1,78 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiFlair.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface using Flair
+//  			communication mechanism
+//
+//
+/*********************************************************************/
+
+#include "GuiFlair.h"
+#include "GuiInterface.h"
+
+#include <UdpSocket.h>
+
+//todo remove for tests
+#include <iostream>
+
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+GuiFlair::GuiFlair(string name):
+				   GuiInterface(name) {
+	cout << "MavPlanner GuiFlair constructor" << endl;
+
+	outputSocket = new UdpSocket((Thread *)this, "output socket", "127.0.0.1:5036");
+
+	// outputSocket = new Socket(parent, "output socket", "127.255.255.255:9001", true);
+	inputSocket = new UdpSocket((Thread *)this, "input socket", 9001);
+}
+
+GuiFlair::~GuiFlair() {
+
+}
+
+void GuiFlair::MissionStart() {
+	cout << "MavPlanner GuiFlair MissionStart" << endl;
+
+	int received = 0;
+	char receiveFrameBuffer[200];
+
+	std::string message_to_send("Test of sending a message");
+
+	//fonctionne en récéption si on prend un broadcast pour la création du socket
+	// outputSocket->SendMessage(message_to_send);
+
+	do {
+		// cout << "." << endl;
+		received=inputSocket->RecvMessage(receiveFrameBuffer,200, TIME_NONBLOCK);
+		// cout << "." << endl;
+		if (received > 0) {
+		   cout << "MavPlanner GuiFlair MissionStart data received : " << receiveFrameBuffer << endl;
+		   outputSocket->SendMessage(receiveFrameBuffer, received);
+		}
+	} while (received != 0);
+}
+
+void GuiFlair::MissionStop() {
+	cout << "MavPlanner GuiFlair MissionStop" << endl;
+}
+
+void GuiFlair::MissionPause() {
+	cout << "MavPlanner GuiFlair MissionResume" << endl;
+}
+
+void GuiFlair::MissionSend() {
+	cout << "MavPlanner GuiFlair MissionSend" << endl;
+}
Index: tags/latest/tools/Controller/Mavlink/src/GuiFlair.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiFlair.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiFlair.h	(revision 209)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiFlair.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface using Flair
+//  			communication mechanism
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_FLAIR_H
+#define MAVPLANNER_GUI_FLAIR_H
+
+#include <string>
+
+#include "GuiInterface.h"
+
+namespace flair { namespace core {
+  class UdpSocket;
+} }
+
+class GuiFlair : public GuiInterface {
+public:
+
+  GuiFlair(std::string name);
+  ~GuiFlair();
+
+protected:
+
+  virtual void MissionStart();
+  virtual void MissionStop();
+  virtual void MissionPause();
+  virtual void MissionSend();
+
+private:
+  flair::core::UdpSocket *inputSocket;
+  flair::core::UdpSocket *outputSocket;
+  std::string outputAddress;
+  int outputPort;	
+};
+
+#endif // MAVPLANNER_GUI_FLAIR_H
Index: tags/latest/tools/Controller/Mavlink/src/GuiGcs.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiGcs.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiGcs.cpp	(revision 209)
@@ -0,0 +1,215 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiGcs.h
+//
+//  authors:    Thomas Fuhrmann
+//              Milan Erdelj
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface, using sockets
+//
+//
+/*********************************************************************/
+
+#include "GuiGcs.h"
+#include "GuiInterface.h"
+
+#include <Socket.h>
+
+#include "MavlinkUDP.h"
+
+#include <ListWidget.h>
+
+#include <iostream>
+#include <array>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+const std::string delimiter = "|";
+
+GuiGcs::GuiGcs(string name,
+  		 	   std::string &outputAddress, int outputPort):
+			   GuiInterface(name) {
+  cout << "MavPlanner GuiGcs constructor" << endl;
+  //outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
+
+  missionPauseEnabled = false;
+
+  mavCom = new MavlinkUDP(outputAddress, outputPort);
+}
+
+GuiGcs::~GuiGcs() {
+  if (mavCom) {
+    mavCom->stopThreads();
+    delete mavCom;
+  }
+}
+
+void GuiGcs::MissionStart() {
+  cout << "MavPlanner GuiGcs MissionStart" << endl;
+
+  Initialize();
+
+    cout << "--------------------\n";
+    cout << "   MISSION START\n";
+    cout << "--------------------\n";
+
+    // set auto armed mode
+    mavCom->cmdDoSetMode(mavCom->target.getSysID(), mavCom->target.getCompID(), MAV_MODE_AUTO_ARMED);
+    mavCom->waitCommandAck(ACK_TIMEOUT);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // mission start message
+    mavCom->cmdMissionStart(mavCom->target.getSysID(), mavCom->target.getCompID(), mavCom->missionFirst, mavCom->missionLast);
+    mavCom->waitCommandAck(ACK_TIMEOUT);
+
+    mavCom->missionStarted();
+}
+
+void GuiGcs::MissionStop() {
+  cout << "MavPlanner GuiGcs MissionStop" << endl;
+}
+
+void GuiGcs::MissionPause() {
+  cout << "MavPlanner GuiGcs MissionPause" << endl;
+  // send pause/continue depending on the state of the button
+  if(missionPauseEnabled) {
+      missionPauseEnabled = false;
+      cout << "Sent pause command.\n";
+      mavCom->cmdDoPauseContinue(mavCom->target.getSysID(), mavCom->target.getCompID(), 0);
+  } else {
+      missionPauseEnabled = true;
+      cout << "Sent continue command.\n";
+      mavCom->cmdDoPauseContinue(mavCom->target.getSysID(), mavCom->target.getCompID(), 1);
+  }
+  mavCom->waitCommandAck(ACK_TIMEOUT);
+}
+
+void GuiGcs::MissionSend() {
+  cout << "MavPlanner GuiGcs MissionSend" << endl;
+
+  // upload a flight plan
+  cout << "---------------\n";
+  cout << "Flight planning \n";
+  cout << "---------------\n";
+
+  // get the list of commands to send
+  std::vector<std::string> missionCommandList = listMissionItems->GetItemList();
+
+  // reset all the previous waypoints
+  mavCom->sendMissionClearAll(mavCom->target.getSysID(), mavCom->target.getCompID());
+
+  cout << "[INFO] Mission write partial list.\n";
+  // write partial list, takeoff + 4 waypoints + land
+  mavCom->sendMissionWritePartialList(mavCom->target.getSysID(),mavCom->target.getCompID(), 0, missionCommandList.size());
+  mavCom->waitMissionAck(ACK_TIMEOUT);
+
+  // sending mission items
+  cout << "[INFO] Mission items.\n";
+  for (auto &missionCommand : missionCommandList) {
+    cout << "[INFO] Mission item : " << missionCommand << "\n";
+    // Parse command
+    std::string command = missionCommand.substr(0, missionCommand.find(delimiter));
+    missionCommand.erase(0, missionCommand.find(delimiter) + delimiter.length());
+    std::array<float, 6> missionParameters;
+    ParametersParse(missionCommand, missionParameters);
+
+    mavCom->sendMissionItem(mavCom->target.getSysID(), mavCom->target.getCompID(), 0, MAV_FRAME_GLOBAL_RELATIVE_ALT, MavCommandGet(command), 0, 1,
+            missionParameters[0], missionParameters[1], missionParameters[2], 0, missionParameters[3], missionParameters[4], missionParameters[5]);
+    mavCom->waitMissionAck(ACK_TIMEOUT);
+  }
+
+  cout << "[INFO] Check mission item list.\n";
+  // mission request list (to check)
+  mavCom->sendMissionRequestList(mavCom->target.getSysID(), mavCom->target.getCompID());
+  //mavCom.waitMissionCount(ACK_TIMEOUT);
+
+  cout << "----------------\n";
+  cout << "Flight plan sent \n";
+  cout << "----------------\n";
+}
+
+void GuiGcs::ParametersParse(const std::string& parametersString, std::array<float, 6>& parametersFloat) {
+  std::string parametersBuffer = parametersString;
+  for (int count = 0; count < parametersFloat.size(); count++) {
+    parametersFloat[count] = std::stof(parametersBuffer.substr(0, parametersBuffer.find(delimiter)));
+    parametersBuffer.erase(0, parametersBuffer.find(delimiter) + delimiter.length());
+  }
+}
+
+uint16_t GuiGcs::MavCommandGet(const std::string& command) const {
+  uint16_t returnValue = -1;
+  if (command == "WAYPOINT") {
+    returnValue = MAV_CMD_NAV_WAYPOINT;
+  }
+  if (command == "TAKEOFF") {
+    returnValue = MAV_CMD_NAV_TAKEOFF;
+  }
+  if (command == "LAND") {
+    returnValue = MAV_CMD_NAV_LAND;
+  }
+  if (command == "RETURN") {
+    returnValue = MAV_CMD_NAV_RETURN_TO_LAUNCH;
+  }
+  if (command == "JUMP") {
+    returnValue = MAV_CMD_DO_JUMP;
+  }
+  return returnValue;
+}
+
+void GuiGcs::Initialize() {
+    cout << "--------------------\n";
+    cout << "Initialization START\n";
+    cout << "--------------------\n";
+
+    // UAV start heartbeat, message ID=0, interval 1000 ms
+    mavCom->cmdSetMessageInterval(mavCom->target.getSysID(), mavCom->target.getCompID(), MAVLINK_MSG_ID_HEARTBEAT, PERIOD_SECOND);
+    mavCom->waitCommandAck(ACK_TIMEOUT);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // ask for the autopilot capabilities
+    mavCom->cmdRequestAutopilotCapabilities(mavCom->target.getSysID(), mavCom->target.getCompID());
+    // TODO wait for autopilot version
+    //
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // initiate system status callback on the UAV, message ID=1, interval 1000 ms
+    mavCom->cmdSetMessageInterval(mavCom->target.getSysID(), mavCom->target.getCompID(), MAVLINK_MSG_ID_SYS_STATUS, PERIOD_SECOND);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // initiate system time callback on the UAV
+    mavCom->cmdSetMessageInterval(mavCom->target.getSysID(), mavCom->target.getCompID(), MAVLINK_MSG_ID_SYSTEM_TIME, PERIOD_SECOND);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // set preflight mode
+    mavCom->cmdDoSetMode(mavCom->target.getSysID(), mavCom->target.getCompID(), MAV_MODE_PREFLIGHT);
+    mavCom->waitCommandAck(ACK_TIMEOUT);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // set home position
+    mavCom->cmdDoSetHome(mavCom->target.getSysID(), mavCom->target.getCompID(), 0);
+    mavCom->waitCommandAck(ACK_TIMEOUT);
+
+    usleep(INTER_COMMAND_PAUSE);
+
+    // clear all mission waypoints
+    mavCom->sendMissionClearAll(mavCom->target.getSysID(), mavCom->target.getCompID());
+    usleep(INTER_COMMAND_PAUSE);
+    mavCom->waitMissionAck(ACK_TIMEOUT);
+    cout << "--------------------\n";
+    cout << "Initialization END\n";
+    cout << "--------------------\n";
+}
Index: tags/latest/tools/Controller/Mavlink/src/GuiGcs.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiGcs.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiGcs.h	(revision 209)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiGcs.h
+//
+//  authors:    Thomas Fuhrmann
+//              Milan Erdelj
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface, using sockets
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_GCS_H
+#define MAVPLANNER_GUI_GCS_H
+
+#include <string>
+#include <array>
+
+#include "GuiInterface.h"
+
+#include "MavlinkUDP.h"
+
+#define INTER_COMMAND_PAUSE 10000 // us
+#define PERIOD_SECOND 1000000 // us
+
+namespace flair {
+namespace core {
+  class Socket;
+}
+}
+
+class GuiGcs : public GuiInterface {
+public:
+
+  GuiGcs(std::string name,
+  		 std::string &outputAddress, int outputPort);
+  ~GuiGcs();
+
+protected:
+
+  virtual void MissionStart();
+  virtual void MissionStop();
+  virtual void MissionPause();
+  virtual void MissionSend();
+
+  uint16_t MavCommandGet(const std::string& command) const;
+
+private:
+  std::string outputAddress;
+  int outputPort;
+
+  MavlinkUDP* mavCom;
+
+  bool missionPauseEnabled;
+
+  void Initialize();
+  void ParametersParse(const std::string& parametersString, std::array<float, 6>& parametersFloat);
+};
+
+#endif // MAVPLANNER_GUI_GCS_H
Index: tags/latest/tools/Controller/Mavlink/src/GuiInterface.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiInterface.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiInterface.cpp	(revision 209)
@@ -0,0 +1,150 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiInterface.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Create the GUI and give an abstract interface to it
+//
+//
+/*********************************************************************/
+
+#include "GuiInterface.h"
+
+#include <cvmatrix.h>
+#include <FrameworkManager.h>
+#include <Socket.h>
+#include <Thread.h>
+
+#include <Tab.h>
+#include <TabWidget.h>
+#include <DoubleSpinBox.h>
+#include <PushButton.h>
+#include <GroupBox.h>
+#include <ListWidget.h>
+#include <Label.h>
+#include <ComboBox.h>
+
+#include <string>
+#include <sstream>
+
+using namespace flair::core;
+using namespace flair::gui;
+using namespace std;
+
+GuiInterface::GuiInterface(string name)
+                  : Thread(getFrameworkManager(), name, 6),
+                  mainTab(new Tab(getFrameworkManager()->GetTabWidget(), name)) {
+
+  tabWidget = new TabWidget(mainTab->NewRow(), name);
+
+  // Main tab
+  Tab* settingsTab = new Tab(tabWidget, "Settings");
+  
+  // Controls group
+  controlsGroupBox = new GroupBox(settingsTab->NewRow(), "Controls");
+  btnStartMission = new PushButton(controlsGroupBox->LastRowLastCol(), "Start mission");
+  btnStopMission = new PushButton(controlsGroupBox->LastRowLastCol(), "Stop mission");
+  btnPauseMission = new PushButton(controlsGroupBox->LastRowLastCol(), "Pause mission");
+
+  // Add cmd group
+  addCmdGroupBox = new GroupBox(settingsTab->NewRow(), "Add mission command");
+  // commandLabel = new Label(addCmdGroupBox->NewRow(), "Command label");
+  // commandLabel->SetText("Command");
+  // param1Label = new Label(addCmdGroupBox->LastRowLastCol(), "Param1 label");
+  // commandLabel->SetText("Param1");
+  // param2Label = new Label(addCmdGroupBox->LastRowLastCol(), "Param2 label");
+  // commandLabel->SetText("Param2");
+  // param3Label = new Label(addCmdGroupBox->LastRowLastCol(), "Param3 label");
+  // commandLabel->SetText("Param3");
+  comboCmd = new ComboBox(addCmdGroupBox->NewRow(), "Select command");
+  // Fill the ComboBox
+  for (auto &command : commandsAvailable) {
+    comboCmd->AddItem(command);    
+  }
+  // comboCmd->AddItem("WAYPOINT");
+  // comboCmd->AddItem("TAKEOFF");
+  // comboCmd->AddItem("LAND");
+  // comboCmd->AddItem("RETURN");
+  // comboCmd->AddItem("JUMP");
+  param1Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param1", -90, 90, 0.5, 1, 0);
+  latitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Longitude", -90, 90, 0.5, 1, 1.5);
+  param2Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param2", -90, 90, 0.5, 1, 0);
+  longitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Latitude", -90, 90, 0.5, 1, -1.5);
+  param3Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param3", -90, 90, 0.5, 1, 0);
+  altitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Altitude", -90, 90, 0.5, 1, 2);
+  btnAddMissionCmd = new PushButton(addCmdGroupBox->NewRow(), "Add mission cmd");
+  btnDelMissionCmd = new PushButton(addCmdGroupBox->LastRowLastCol(), "Del mission cmd");
+  btnSendMission = new PushButton(addCmdGroupBox->LastRowLastCol(), "Send mission");
+
+  // Show wpt group
+  showItemsGroupBox = new GroupBox(settingsTab->NewRow(), "Show mission items");
+  listMissionItems = new ListWidget(showItemsGroupBox->NewRow(), "Mission cmd list");
+
+  // listEntranceWpt = new ListWidget(showWptGroupBox->LastRowLastCol(), "Entrance wpt");
+  // listExitWpt = new ListWidget(showWptGroupBox->LastRowLastCol(), "Exit wpt");
+  // btnRemoveMissionWpt = new PushButton(showWptGroupBox->NewRow(), "Remove mission wpt");
+  // btnRemoveEntranceWpt = new PushButton(showWptGroupBox->LastRowLastCol(), "Remove entrance wpt");
+  // btnRemoveExitWpt = new PushButton(showWptGroupBox->LastRowLastCol(), "Remove exit wpt");
+
+  // // Action wpt group
+  // actionWptGroupBox = new GroupBox(settingsTab->NewRow(), "Action");
+  // btnSendWpt = new PushButton(actionWptGroupBox->NewRow(), "Send wpt");
+  // btnClearWpt = new PushButton(actionWptGroupBox->LastRowLastCol(), "Clear wpt");
+  // btnLoop = new PushButton(actionWptGroupBox->LastRowLastCol(), "Loop");
+
+  //TODO IP & PORT from config.h file
+  // sendSocket = new Socket((Thread *)this, "send socket", "127.0.0.1:5000");
+}
+
+GuiInterface::~GuiInterface() {
+}
+
+void GuiInterface::Run() {
+  Thread::Info("Debug: enter MavPlanner acquisition loop\n");
+
+  if (getFrameworkManager()->ErrorOccured()) {
+    SafeStop();
+    Thread::Err("An error occurred, we don't launch the Run loop.\n");
+  }
+
+  while (!ToBeStopped()) {
+    // TODO : time from config.h
+    Thread::SleepMS(500);
+    // Buttons to control GUI
+  	if (btnAddMissionCmd->Clicked()) {
+      listMissionItems->AddItem(MissionCmdGet());
+    }
+    if (btnDelMissionCmd->Clicked()) {
+      listMissionItems->RemoveItem();
+    }
+    // Buttons to send commands
+  	if (btnStartMission->Clicked()) {
+  		MissionStart();
+    }
+  	if (btnStopMission->Clicked()) {
+  		MissionStop();
+    }
+  	if (btnPauseMission->Clicked()) {
+  		MissionPause();
+    }
+    if (btnSendMission->Clicked()) {
+  		MissionSend();
+    }
+  }
+}
+
+std::string GuiInterface::MissionCmdGet() {
+  std::ostringstream stringStream;
+  stringStream.precision(1);
+  stringStream << fixed;
+  stringStream << commandsAvailable[comboCmd->CurrentIndex()] << "|" << param1Field->Value() << "|" << param2Field->Value() \
+               << "|" << param3Field->Value() << "|" << latitudeField->Value() << "|" << longitudeField->Value() << "|" << altitudeField->Value();
+  return stringStream.str();
+}
Index: tags/latest/tools/Controller/Mavlink/src/GuiInterface.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/GuiInterface.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/GuiInterface.h	(revision 209)
@@ -0,0 +1,110 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiInterface.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Create the GUI and give an abstract interface to it
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_INTERFACE_H
+#define MAVPLANNER_GUI_INTERFACE_H
+
+#include <string>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+  class Socket;
+}
+namespace gui {
+  class Tab;
+  class TabWidget;
+  class DoubleSpinBox;
+  class PushButton;
+  class ComboBox;
+  class GroupBox;
+  class ListWidget;
+  class Label;
+}
+}
+
+class GuiInterface : public flair::core::Thread {
+public:
+
+  GuiInterface(std::string name);
+  ~GuiInterface();
+
+protected:
+  // reimplement the run of the Thread class
+  void Run();
+  
+  // First tab callbacks
+  virtual void MissionStart() = 0;
+  virtual void MissionStop() = 0;
+  virtual void MissionPause() = 0;
+  virtual void MissionSend() = 0;
+
+  std::string MissionCmdGet();
+
+  // Main GUI
+  flair::gui::TabWidget* tabWidget;
+  flair::gui::Tab* mainTab;
+  flair::gui::Tab* settingsTab;
+
+  // Controls groupbox
+  flair::gui::GroupBox* controlsGroupBox;
+  flair::gui::PushButton* btnStartMission;
+  flair::gui::PushButton* btnStopMission;
+  flair::gui::PushButton* btnPauseMission;
+  
+  // Add cmd groupbox
+  flair::gui::GroupBox* addCmdGroupBox;
+  // flair::gui::Label* commandLabel;
+  // flair::gui::Label* param1Label;
+  // flair::gui::Label* param2Label;
+  // flair::gui::Label* param3Label;
+  flair::gui::ComboBox* comboCmd; 
+  flair::gui::DoubleSpinBox* param1Field;
+  flair::gui::DoubleSpinBox* param2Field;
+  flair::gui::DoubleSpinBox* param3Field;
+  flair::gui::DoubleSpinBox* latitudeField;
+  flair::gui::DoubleSpinBox* longitudeField;
+  flair::gui::DoubleSpinBox* altitudeField;
+  flair::gui::PushButton* btnAddMissionCmd;
+  flair::gui::PushButton* btnDelMissionCmd;
+  flair::gui::PushButton* btnSendMission;
+
+  // Show wpt groupbox
+  flair::gui::GroupBox* showItemsGroupBox;
+  flair::gui::ListWidget* listMissionItems;
+  // flair::gui::ListWidget* listEntranceWpt;
+  // flair::gui::ListWidget* listExitWpt;
+  // flair::gui::PushButton* btnRemoveMissionWpt;
+  // flair::gui::PushButton* btnRemoveEntranceWpt;
+  // flair::gui::PushButton* btnRemoveExitWpt;  
+
+  // Action wpt groupbox
+  // flair::gui::GroupBox* actionWptGroupBox;
+  // flair::gui::PushButton* btnSendWpt;
+  // flair::gui::PushButton* btnClearWpt;
+  // flair::gui::PushButton* btnLoop;
+
+  // Socket to send commands
+  flair::core::Socket* sendSocket;
+
+  //TODO : think if useful to have private members
+  
+private:
+  const std::vector<std::string> commandsAvailable = {"WAYPOINT", "TAKEOFF", "LAND", "RETURN", "JUMP"};
+};
+
+#endif // MAVPLANNER_GUI_INTERFACE_H
Index: tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.cpp	(revision 209)
@@ -0,0 +1,1261 @@
+//  created:    20/04/2016
+//  updated:    20/09/2016
+//  filename:   MavlinkUDP.cpp
+//
+//  author:     Milan Erdelj, <milan.erdelj@hds.utc.fr>
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//              Current_messages and Time_Stamps:
+//              Copyright (c) 2014 MAVlink Development Team. All rights reserved.
+//              Trent Lukaczyk, <aerialhedgehog@gmail.com>
+//              Jaycee Lock,    <jaycee.lock@gmail.com>
+//              Lorenz Meier,   <lm@inf.ethz.ch>
+//
+//  version:    $Id: $
+//
+//  purpose:    MAVLink communication block class that used UDP sockets
+//
+//
+/*********************************************************************/
+
+#include "MavlinkUDP.h"
+#include <sstream>
+#include <iostream>
+
+using namespace std;
+
+MavlinkUDP::MavlinkUDP(const std::string& addr, int port) : m_port(port), m_addr(addr), me(addr), target(GCS_ADDR) {
+    // initialize attributes
+    write_count = 0;
+    home_position_set=false;
+    ack=false;
+    request=false;
+    seq=-1;
+    seqr=-1;
+    seqold=-1;
+    waypoint=false;
+    Waycount=0;
+    Wayseq=-1;
+    message_interval = 1000; // ms
+    state=-1;
+    control_status = 0;      // whether the autopilot is in offboard control mode
+    arming_status = 0;      // whether the autopilot is in arming control mode
+    debug_messages = true;
+
+    heartbeat_period = HEARTBEAT_DEFAULT_PERIOD;
+
+    resetCommandAck();
+    resetMissionAck();
+
+    // period function flags
+    sendingAttitude = false;
+    sendingPosition = false;
+    sendingSystemStatus = false;
+    sendingAttitudeInterval = ATTITUDE_DEFAULT_PERIOD;
+    sendingPositionInterval = POSITION_DEFAULT_PERIOD;
+    sendingSystemStatusInterval = STATUS_DEFAULT_PERIOD;
+
+    // mission items
+    missionFirst = 0;
+    missionLast = 0;
+    //mission_items_loop = false;
+    missionActive = false; // if the mission is launched
+
+    shutdown_flag = false;
+
+    // TODO read the system ID from the file based on the IP address
+    system_id    = 0; // system id
+    autopilot_id = 0; // autopilot component id
+    component_id = 0; // companion computer component id
+
+    // setpoint
+    recvSetpointX = 0;
+    recvSetpointY = 0;
+
+   // mavlink_command_long_t com = { 0 };
+    compt=0;
+    current_messages.sysid  = system_id;
+    current_messages.compid = autopilot_id;
+    Xtimes=0;
+    Xtimesync=false;
+
+    something_to_send = false; // check if something needs to be sent
+    stop_recv = false;
+    stop_send = false;
+    startThreads(); // start both sending and receiving thread
+}
+
+MavlinkUDP::~MavlinkUDP() {
+    try {
+        stopThreads();
+    } catch (int error) {
+        fprintf(stderr,"MavlinkUDP: Warning! Could not stop threads!\n");
+    }
+}
+
+// starting send and receive threads
+void MavlinkUDP::startThreads() {
+    // start receive thread
+    recv_th = std::thread(&MavlinkUDP::recv_thread, this);
+    printf("MavlinkUDP: Receiver thread created.\n");
+    // start sending thread
+    send_th = std::thread(&MavlinkUDP::send_thread, this);
+    printf("MavlinkUDP: Sender thread created.\n");
+}
+
+void MavlinkUDP::stopThreads() {
+    stop_recv = true;
+    stop_send = true;
+    usleep(100);
+    if(recv_th.joinable()) recv_th.join();
+    if(send_th.joinable()) send_th.join();
+    printf("MavlinkUDP: Threads stopped.\n");
+    // close the sockets
+    close(m_socket_in);
+    close(m_socket_out);
+    printf("MavlinkUDP: Sockets closed.\n");
+}
+
+// quit handler
+void MavlinkUDP::handleQuit(int sig) {
+    try {
+        stopThreads();
+    } catch (int error) {
+        fprintf(stderr,"MavlinkUDP: Warning, could not stop communication block!\n");
+    }
+}
+
+inline void MavlinkUDP::clearBuffer(uint8_t *buffer, int len) {
+    memset(buffer, 0, len);
+}
+
+void MavlinkUDP::clearData() {
+    clearBuffer(buff_in, BUFF_IN_LEN);
+}
+
+void MavlinkUDP::recv_thread() {
+    // UDP socket setup
+    socklen_t clilen=sizeof(client_in);
+    if((m_socket_in=socket(AF_INET,SOCK_DGRAM,0))<0)
+    {
+        throw SocketRuntimeError("[ERRR] RECV socket error!\n");
+    }
+    memset((char *)&myaddr_in, 0, sizeof(myaddr_in));
+    myaddr_in.sin_family=AF_INET;
+    // receiving messages from all addresses
+    myaddr_in.sin_addr.s_addr=htonl(INADDR_ANY);
+    myaddr_in.sin_port=htons(m_port);
+    if(bind(m_socket_in,(struct sockaddr *)&myaddr_in,sizeof(myaddr_in))<0)
+    {
+        throw SocketRuntimeError("[ERRR] UDP in bind error!\n");
+    }
+    //std::cout << "MavlinkUDP: RECV socket bind OK.\n";
+    std::cout << "MavlinkUDP: RECV thread launched.\n";
+    clearBuffer(buff_in, BUFF_IN_LEN);
+    // receive data
+    while(!stop_recv) {
+        recsize = recvfrom(m_socket_in, (void *)buff_in, BUFF_IN_LEN, 0, (struct sockaddr *)&client_in, &clilen);
+        if(recsize > 0) {
+            // parse the received data
+            //print_message(sockUDP.buff_in, sockUDP.recsize);
+            decode_message(buff_in, recsize);
+            clearBuffer(buff_in, BUFF_IN_LEN);
+        }
+        //usleep(10000);
+        std::this_thread::sleep_for(std::chrono::milliseconds(THREAD_MS_IN));
+    }
+}
+
+void MavlinkUDP::send_thread() {
+    // socket setup
+    int broadcast = 1;
+    // socket for broadcast
+    if((m_socket_out=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP))<0) {
+        throw SocketRuntimeError("[ERRR] udp out socket error\n");
+    }
+    if((setsockopt(m_socket_out,SOL_SOCKET,SO_BROADCAST,&broadcast,sizeof broadcast)) == -1) {
+        throw SocketRuntimeError("[ERRR] udp out setsockopt error\n");
+    }
+    cout << "MavlinkUDP: SEND thread launched.\n";
+    memset((char *) &myaddr_out, 0, sizeof(myaddr_out));
+    myaddr_out.sin_family=AF_INET;
+    myaddr_out.sin_port=htons(m_port);
+    myaddr_out.sin_addr.s_addr=inet_addr(m_addr.c_str());
+    clearBuffer(buff_out, BUFF_OUT_LEN);
+    // send data to the socket
+    while(!stop_send) {
+        if(something_to_send) {
+            // send quickly and reset the flag
+            sendto(m_socket_out, buff_out, length_to_send, 0, (struct sockaddr *) &myaddr_out, sizeof(myaddr_out));
+            clearBuffer(buff_out,BUFF_OUT_LEN);
+            something_to_send = false;
+        }
+        //clearBuffer(buff_out, BUFF_OUT_LEN);
+        std::this_thread::sleep_for(std::chrono::milliseconds(THREAD_MS_OUT));
+        //usleep(10000);
+    }
+}
+
+// read mission configuration file
+// TODO use the Qt XML library
+//
+//
+
+void MavlinkUDP::updateSetpoint(mavlink_set_position_target_local_ned_t setpoint) {
+    current_setpoint = setpoint;
+}
+
+//
+// MESSAGES
+//
+
+// send Heartbeat message
+void MavlinkUDP::sendHeartbeat() {
+    mavlink_message_t message;
+    mavlink_msg_heartbeat_pack(me.getSysID(), me.getCompID(), &message, MAV_TYPE_QUADROTOR, MAV_AUTOPILOT_GENERIC, MAV_MODE_AUTO_ARMED, 0, MAV_STATE_ACTIVE);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out, &message);
+    something_to_send = true;
+    //printf("[SENT] Heartbeat\n");
+}
+
+// send SystemStatus message
+void MavlinkUDP::sendSystemStatus(uint32_t onboardSensorsPresent, uint32_t onboardSensorsEnabled, uint32_t onboardSensorsHealth, uint16_t load, uint16_t voltage, int16_t current, int8_t batteryRemaining, uint16_t dropRateComm, uint16_t errorsComm, uint16_t errors1, uint16_t errors2, uint16_t errors3, uint16_t errors4) {
+    mavlink_message_t message;
+    mavlink_msg_sys_status_pack(me.getSysID(), me.getCompID(), &message, onboardSensorsPresent, onboardSensorsEnabled, onboardSensorsHealth, load, voltage, current, batteryRemaining, dropRateComm, errorsComm, errors1, errors2, errors3, errors4);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    //printf("[SENT] System status\n");
+}
+
+// send BatteryStatus message
+void MavlinkUDP::sendBatteryStatus(uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, uint16_t *voltages, int16_t current, int32_t currentConsumed, int32_t energyConsumed, int8_t batteryRemaining) {
+    mavlink_message_t message;
+    mavlink_msg_battery_status_pack(me.getSysID(), me.getCompID(), &message, id, battery_function, type, temperature, voltages, current, currentConsumed, energyConsumed, batteryRemaining);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send SystemTime message
+void MavlinkUDP::sendSystemTime() {
+    mavlink_system_time_t sys_time;
+    sys_time.time_unix_usec = get_time_usec();
+    mavlink_message_t message;
+    mavlink_msg_system_time_pack(me.getSysID(), me.getCompID(), &message, sys_time.time_unix_usec, sys_time.time_boot_ms);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] System time\n");
+}
+
+// send LocalPostiionNED message
+void MavlinkUDP::sendLocalPositionNED(float x, float y, float z, float vx, float vy, float vz) {
+    mavlink_message_t message;
+    mavlink_msg_local_position_ned_pack(me.getSysID(), me.getCompID(), &message, get_time_usec(), x, y, z, vx, vy, vz);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send Attitude message
+void MavlinkUDP::sendAttitude(float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) {
+    mavlink_message_t message;
+    mavlink_msg_attitude_pack(me.getSysID(), me.getCompID(), &message, get_time_usec(), roll, pitch, yaw, rollspeed, pitchspeed, yawspeed);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionAck message
+void MavlinkUDP::sendMissionAck(uint8_t targetSystem, uint8_t targetComponent, uint8_t type) {
+    mavlink_message_t message;
+    mavlink_msg_mission_ack_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, type);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] Mission ACK\n");
+}
+
+// send commandAck message
+void MavlinkUDP::sendCommandAck(uint16_t command, uint8_t result) {
+    mavlink_message_t message;
+    mavlink_msg_command_ack_pack(me.getSysID(), me.getCompID(), &message, command, result);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] Command ACK: %d\n", command);
+}
+
+// send autopilot version
+void MavlinkUDP::sendAutopilotVersion(uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, uint8_t *flight_custom_version, uint8_t *middleware_custom_version, uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid) {
+    mavlink_message_t message;
+    // TODO get these values from autopilot
+    mavlink_msg_autopilot_version_pack(me.getSysID(), me.getCompID(), &message, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] Autopilot vesrion\n");
+}
+
+// send MissionCount message
+void MavlinkUDP::sendMissionCount(uint8_t targetSystem, uint8_t targetComponent, uint16_t count) {
+    mavlink_message_t message;
+    mavlink_msg_mission_count_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, count);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send CommandLong message
+void MavlinkUDP::sendCommandLong(uint8_t targetSystem, uint8_t targetComponent, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) {
+    mavlink_message_t message;
+    //    uint8_t confirmation;
+    //    float param1, param2, param3, param4, param5, param6, param7;
+    mavlink_msg_command_long_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, command, confirmation, param1, param2, param3, param4, param5, param6, param7);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] Command long: %d\n", command);
+}
+
+// send MissionWritePartialList message
+void MavlinkUDP::sendMissionWritePartialList(uint8_t targetSystem, uint8_t targetComponent, uint16_t startIndex, uint16_t endIndex) {
+    mavlink_message_t message;
+    mavlink_msg_mission_write_partial_list_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, startIndex, endIndex);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionItem message
+void MavlinkUDP::sendMissionItem(uint8_t targetSystem, uint8_t targetComponent, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) {
+    mavlink_message_t message;
+    mavlink_msg_mission_item_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionRequestList message
+void MavlinkUDP::sendMissionRequestList(uint8_t targetSystem, uint8_t targetComponent) {
+    mavlink_message_t message;
+    mavlink_msg_mission_request_list_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionItemReached message
+void MavlinkUDP::sendMissionItemReached(uint16_t seq) {
+    mavlink_message_t message;
+    mavlink_msg_mission_item_reached_pack(me.getSysID(), me.getCompID(), &message, seq);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionSetCurrent message
+void MavlinkUDP::sendMissionSetCurrent(uint8_t targetSystem, uint8_t targetComponent, uint16_t seq) {
+    mavlink_message_t message;
+    mavlink_msg_mission_set_current_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent, seq);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send MissionClearAll message
+void MavlinkUDP::sendMissionClearAll(uint8_t targetSystem, uint8_t targetComponent) {
+    mavlink_message_t message;
+    mavlink_msg_mission_clear_all_pack(me.getSysID(), me.getCompID(), &message, targetSystem, targetComponent);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+    printf("[SENT] Mission clear all\n");
+}
+
+// send SetPositionTargetLocalNED message
+void MavlinkUDP::sendSetPositionTargetLocalNED(uint32_t time_boot_ms, uint8_t targetSystem, uint8_t targetComponent, uint8_t coordinateFrame, uint16_t typeMask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) {
+    mavlink_message_t message;
+    mavlink_msg_set_position_target_local_ned_pack(me.getSysID(), me.getCompID(), &message, time_boot_ms, targetSystem, targetComponent, coordinateFrame, typeMask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    printf("[SENT] SET_POSITION_TARGET_LOCAL_NED x = %.2f y = %.2f\n", x, y);
+    something_to_send = true;
+}
+
+// send PositionTargetLocalNED message
+void MavlinkUDP::sendPositionTargetLocalNED(uint32_t time_boot_ms, uint8_t coordinateFrame, uint16_t typeMask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) {
+    mavlink_message_t message;
+    mavlink_msg_position_target_local_ned_pack(me.getSysID(), me.getCompID(), &message, time_boot_ms, coordinateFrame, typeMask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send SetPositionTargetGlobalInt message
+void MavlinkUDP::sendSetPositionTargetGlobalInt(uint32_t time_boot_ms, uint8_t targetSystem, uint8_t targetComponent, uint8_t coordinateFrame, uint16_t typeMask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) {
+    mavlink_message_t message;
+    mavlink_msg_set_position_target_global_int_pack(me.getSysID(), me.getCompID(), &message, time_boot_ms, targetSystem, targetComponent, coordinateFrame, typeMask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+// send PositionTargetGlobalInt message
+void MavlinkUDP::sendPositionTargetGlobalInt(uint32_t time_boot_ms, uint8_t coordinateFrame, uint16_t typeMask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) {
+    mavlink_message_t message;
+    mavlink_msg_position_target_global_int_pack(me.getSysID(), me.getCompID(), &message, time_boot_ms, coordinateFrame, typeMask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate);
+    length_to_send = mavlink_msg_to_send_buffer(buff_out,&message);
+    something_to_send = true;
+}
+
+//
+// COMMANDS
+//
+
+// command Waypoint
+void MavlinkUDP::cmdNavWaypoint(uint8_t targetSystem, uint8_t targetComponent, float holdTime, float proximityRadius, float passRadius, float desiredYaw, float latitude, float longitude, float altitude) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_NAV_WAYPOINT, 0, holdTime, proximityRadius, passRadius, desiredYaw, latitude, longitude, altitude);
+}
+
+// command SetMessageInterval
+void MavlinkUDP::cmdSetMessageInterval(uint8_t targetSystem, uint8_t targetComponent, uint8_t messageID, int64_t interval_usec) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_SET_MESSAGE_INTERVAL, 0, (float)messageID, (float)interval_usec, 0, 0, 0, 0, 0);
+}
+
+// command Land
+void MavlinkUDP::cmdNavLand(uint8_t targetSystem, uint8_t targetComponent, float abortAlt, float desiredYaw, float latitude, float longitude, float altitude) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_NAV_LAND, 0, abortAlt, 0, 0, desiredYaw, latitude, longitude, altitude);
+}
+
+// command LandStart
+void MavlinkUDP::cmdDoLandStart(uint8_t targetSystem, uint8_t targetComponent, float latitude, float longitude) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_DO_LAND_START, 0, 0, 0, 0, 0, latitude, longitude, 0);
+}
+
+// command TakeOff
+void MavlinkUDP::cmdNavTakeoff(uint8_t targetSystem, uint8_t targetComponent, float desiredPitch, float magnetometerYaw, float latitude, float longitude, float altitude) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_NAV_TAKEOFF, 0, desiredPitch, 0, 0, magnetometerYaw, latitude, longitude, altitude);
+}
+
+// command DoSetMode
+void MavlinkUDP::cmdDoSetMode(uint8_t targetSystem, uint8_t targetComponent, uint8_t mavMode) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_DO_SET_MODE, 0, mavMode, 0, 0, 0, 0, 0, 0);
+}
+
+// command DoPauseContinue
+void MavlinkUDP::cmdDoPauseContinue(uint8_t targetSystem, uint8_t targetComponent, uint8_t pauseContinue) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_DO_PAUSE_CONTINUE, 0, pauseContinue, 0, 0, 0, 0, 0, 0);
+}
+
+// command DoSetHome
+void MavlinkUDP::cmdDoSetHome(uint8_t targetSystem, uint8_t targetComponent, uint8_t useCurrent) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_DO_SET_HOME, 0, (float)useCurrent, 0, 0, 0, 0, 0, 0);
+}
+
+// command GetHomePosition
+void MavlinkUDP::cmdGetHomePosition(uint8_t targetSystem, uint8_t targetComponent) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_GET_HOME_POSITION, 0, 0, 0, 0, 0, 0, 0, 0);
+}
+
+// command MissionStart
+void MavlinkUDP::cmdMissionStart(uint8_t targetSystem, uint8_t targetComponent, uint8_t firstItem, uint8_t lastItem) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_MISSION_START, 0, (float)firstItem, (float)lastItem, 0, 0, 0, 0, 0);
+}
+
+// command DoSetParameter
+void MavlinkUDP::cmdDoSetParameter(uint8_t targetSystem, uint8_t targetComponent, uint8_t paramNumber, float paramValue) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_DO_SET_PARAMETER, 0, (float)paramNumber, paramValue, 0, 0, 0, 0, 0);
+}
+
+// command RequestAutopilotCapabilities
+void MavlinkUDP::cmdRequestAutopilotCapabilities(uint8_t targetSystem, uint8_t targetComponent) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES, 0, 1, 0, 0, 0, 0, 0, 0);
+}
+
+// command ReturnToLaunch
+void MavlinkUDP::cmdNavReturnToLaunch(uint8_t targetSystem, uint8_t targetComponent) {
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0, 0, 0, 0, 0, 0);
+}
+
+// command Shutdown
+void MavlinkUDP::cmdRebootShutdown(uint8_t targetSystem, uint8_t targetComponent, uint8_t autopilot, uint8_t onboardComputer) {
+    // for autopilot and onboardComputer, see TMAV_REBOOT_SHUTDOWN_PARAM
+    sendCommandLong(targetSystem, targetComponent, MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN, 0, autopilot, onboardComputer, 0, 0, 0, 0, 0);
+}
+
+
+// callback Heartbeat
+void MavlinkUDP::startHeartbeat(uint64_t period) {
+    timerHeartbeat.start(period, std::bind(&MavlinkUDP::callbackHeartbeat,this));
+}
+void MavlinkUDP::stopHeartbeat() {
+    timerHeartbeat.stop();
+}
+void MavlinkUDP::callbackHeartbeat() {
+    sendHeartbeat();
+}
+
+// callback SystemTime
+void MavlinkUDP::startSystemTime(uint64_t period) {
+    timerSystemTime.start(period, std::bind(&MavlinkUDP::callbackSystemTime,this));
+}
+void MavlinkUDP::stopSystemTime() {
+    timerSystemTime.stop();
+}
+void MavlinkUDP::callbackSystemTime() {
+    sendSystemTime();
+}
+
+// stop the callback function timers
+void MavlinkUDP::stopAllCallbackTimers() {
+    stopHeartbeat();
+    stopSystemTime();
+}
+
+// check the received message CRC, return true if OK
+bool MavlinkUDP::check_mavlink_crc(u_int8_t *buff_in, ssize_t recsize, u_int8_t msgid) {
+    u_int16_t *crc_accum = new u_int16_t(X25_INIT_CRC);
+    u_int16_t recv_crc;
+    for (int i = 1; i < (recsize-2); ++i)
+        crc_accumulate(buff_in[i],crc_accum);
+    crc_accumulate(hds_mavlink_message_crcs[msgid],crc_accum);
+    recv_crc = buff_in[recsize-1]<<8 ^ buff_in[recsize-2];
+    //cout << "CRC(recv): " << hex << setw(4) << recv_crc << endl;
+    //cout << "CRC(calc): " << hex << setw(4) << *crc_accum << endl;
+    // if the CRCs are the same, the subtraction result should be 0:
+    recv_crc -= *crc_accum;
+    delete crc_accum;
+    if(!recv_crc) return true;
+    return false;
+}
+
+// parse the received message
+void MavlinkUDP::print_message(u_int8_t *buff_in, ssize_t recsize) {
+    uint8_t temp;
+    mavlink_message_t msg;
+    mavlink_status_t status;
+    printf("\n[PRINT MESSAGE]\n");
+    printf("Timestamp: %ld\n", get_time_usec());
+    printf("Bytes received: %ld\n", recsize);
+    printf("Datagram: ");
+    for(int i=0; i<recsize; ++i) {
+        temp = buff_in[i];
+        //cout << base(10) << temp << " ";
+        printf("%02x ", temp);
+        if(mavlink_parse_char(MAVLINK_COMM_0, temp, &msg, &status)) {
+            printf("\nReceived packet: SYS: %d, COMP: %d, LEN: %d, MSG ID: %d\n", msg.sysid, msg.compid, msg.len, msg.msgid);
+            //printf("Iteration: %d\n", i);
+        }
+    }
+    printf("\n");
+
+}
+
+void MavlinkUDP::decode_message(u_int8_t *buff_in, ssize_t msg_size) {
+    mavlink_message_t message;
+    mavlink_status_t status;
+    Time_Stamps this_timestamps;
+    // parse message
+    for(int i=0; i<msg_size; ++i) mavlink_parse_char(MAVLINK_COMM_0, buff_in[i], &message, &status);
+    // handle message ID
+    current_messages.sysid  = message.sysid;
+    current_messages.compid = message.compid;
+//    printf("[DECODE]\n");
+//    printf("System ID: %d\n", message.sysid);
+//    printf("Component ID: %d\n", message.compid);
+//    printf("Message ID: %d\n", message.msgid);
+//    printf("Length: %d\n", message.len);
+
+    if(check_mavlink_crc(buff_in, msg_size, message.msgid))
+    {
+        switch (message.msgid)
+        {
+        case MAVLINK_MSG_ID_MISSION_CLEAR_ALL:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_CLEAR_ALL\n");
+            mavlink_msg_mission_clear_all_decode(&message,&(current_messages.clear_all));
+            current_messages.time_stamps.clear_all = get_time_usec();
+            this_timestamps.clear_all = current_messages.time_stamps.clear_all;
+            // clear the queue
+            clearMissionPlan();
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            missionCommands.push(mavItem);
+            //printf("[DEBUG] sysid = %d compid = %d\n", message.sysid, message.compid);
+            sendMissionAck(message.sysid, message.compid, MAV_MISSION_ACCEPTED);
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_ITEM_REACHED:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_ITEM_REACHED\n");
+            mavlink_msg_mission_item_reached_decode(&message, &(current_messages.mission_reached));
+            current_messages.time_stamps.mission_reached = get_time_usec();
+            this_timestamps.mission_reached = current_messages.time_stamps.mission_reached;
+            seqr=current_messages.mission_reached.seq;
+            sendMissionAck(message.sysid, message.compid, MAV_MISSION_ACCEPTED);
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_COUNT:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_COUNT\n");
+            mavlink_msg_mission_count_decode(&message, &(current_messages.mission_count));
+            current_messages.time_stamps.mission_count = get_time_usec();
+            this_timestamps.mission_count = current_messages.time_stamps.mission_count;
+            Waycount=current_messages.mission_count.count;
+            setMissionCount(current_messages.mission_count.count);
+            compt=0;
+            Wayseq=-1;
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_REQUEST_LIST:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_REQUEST_LIST\n");
+            mavlink_msg_mission_request_list_decode(&message, &(current_messages.mission_request_list));
+            current_messages.time_stamps.mission_request_list = get_time_usec();
+            this_timestamps.mission_request_list = current_messages.time_stamps.mission_request_list;
+            // send the mission count
+            sendMissionCount(target.getSysID(), target.getCompID(), getMissionCount());
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST\n");
+            mavlink_msg_mission_write_partial_list_decode(&message, &(current_messages).mission_write_partial_list);
+            current_messages.time_stamps.mission_write_partial_list = get_time_usec();
+            this_timestamps.mission_write_partial_list = current_messages.time_stamps.mission_write_partial_list;
+            //
+            // TODO process the partial list message
+            //
+            sendMissionAck(message.sysid, message.compid, MAV_MISSION_ACCEPTED);
+            break;
+        }
+        case MAVLINK_MSG_ID_TIMESYNC:
+        {
+            //  printf("MAVLINK_MSG_ID_TIMESYNC\n");
+            mavlink_msg_timesync_decode(&message, &(current_messages.timesync));
+            current_messages.time_stamps.timesync = get_time_usec();
+            this_timestamps.timesync = current_messages.time_stamps.timesync;
+            Xtimec=current_messages.timesync.tc1;
+            Xtimes=current_messages.timesync.ts1;
+            Xtimesync=true;
+            break;
+        }
+        case MAVLINK_MSG_ID_SYSTEM_TIME:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_SYSTEM_TIME\n");
+            mavlink_msg_system_time_decode(&message, &(current_messages.system_time));
+            current_messages.time_stamps.system_time = get_time_usec();
+            this_timestamps.system_time = current_messages.time_stamps.system_time;
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_ITEM:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_ITEM\n");
+            mavlink_msg_mission_item_decode(&message, &(current_messages.mission_item));
+            current_messages.time_stamps.mission_item = get_time_usec();
+            this_timestamps.mission_item = current_messages.time_stamps.mission_item;
+
+            // * Mission items queue:
+            // * 16   MAV_CMD_NAV_WAYPOINT            (hold time, acceptance radius, yaw angle, lat, long, altitude)
+            // * 21   MAV_CMD_NAV_LAND                (abort alt, yaw angle, lat, long, altitude)
+            // * 22   MAV_CMD_NAV_TAKEOFF             (yaw angle, lat, long, altitude)
+            // * 177  MAV_CMD_DO_JUMP                 (sequence, repeat count)
+            // * 20   MAV_CMD_NAV_RETURN_TO_LAUNCH    (empty)
+
+            //waypoint=true;
+            //setMissionCount(getMissionCount()+1);
+            //Wayseq=current_messages.mission_item.seq;
+            //frame=current_messages.mission_item.frame;
+            command=current_messages.mission_item.command;
+
+            switch(command) {
+            case MAV_CMD_NAV_TAKEOFF:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = command;
+                mavItem.sequence = mavlink_msg_mission_item_get_seq(&message);
+                mavItem.yaw_angle = mavlink_msg_mission_item_get_param4(&message);
+                mavItem.latitude = mavlink_msg_mission_item_get_x(&message);
+                mavItem.longitude = mavlink_msg_mission_item_get_y(&message);
+                mavItem.altitude = mavlink_msg_mission_item_get_z(&message);
+                // adding commands to the mission plan
+                missionPlan.push(mavItem);
+                //missionCommands.push(mavItem);
+                printf("[RECV] MISSION_ITEM: TAKEOFF\n");
+                break;
+            }
+            case MAV_CMD_NAV_LAND:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = command;
+                mavItem.sequence = mavlink_msg_mission_item_get_seq(&message);
+                mavItem.abort_altitude = mavlink_msg_mission_item_get_param1(&message);
+                mavItem.yaw_angle = mavlink_msg_mission_item_get_param4(&message);
+                mavItem.latitude = mavlink_msg_mission_item_get_x(&message);
+                mavItem.longitude = mavlink_msg_mission_item_get_y(&message);
+                mavItem.altitude = mavlink_msg_mission_item_get_z(&message);
+                // adding commands to the mission plan
+                missionPlan.push(mavItem);
+                printf("[RECV] MISSION_ITEM: LAND\n");
+                break;
+            }
+            case MAV_CMD_DO_JUMP:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = command;
+                mavItem.sequence = mavlink_msg_mission_item_get_seq(&message);
+                mavItem.jump_sequence = mavlink_msg_mission_item_get_param1(&message);
+                mavItem.jump_repeat_count = mavlink_msg_mission_item_get_param2(&message);
+                // adding commands to the mission plan
+                missionPlan.push(mavItem);
+                printf("[RECV] MISSION_ITEM: MAV_CMD_DO_JUMP seq %d repeat %d\n", mavItem.jump_sequence, mavItem.jump_repeat_count);
+                break;
+            }
+            case MAV_CMD_NAV_RETURN_TO_LAUNCH:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = command;
+                mavItem.sequence = mavlink_msg_mission_item_get_seq(&message);
+                // adding commands to the mission plan
+                missionPlan.push(mavItem);
+                printf("[RECV] MISSION_ITEM: MAV_CMD_NAV_RETURN_TO_LAUNCH\n");
+                break;
+            }
+            case MAV_CMD_NAV_WAYPOINT:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = command;
+                mavItem.sequence = mavlink_msg_mission_item_get_seq(&message);
+                mavItem.hold_time = mavlink_msg_mission_item_get_param1(&message);
+                mavItem.yaw_angle = mavlink_msg_mission_item_get_param4(&message);
+                mavItem.latitude = mavlink_msg_mission_item_get_x(&message);
+                mavItem.longitude = mavlink_msg_mission_item_get_y(&message);
+                mavItem.altitude = mavlink_msg_mission_item_get_z(&message);
+                // adding commands to the mission plan
+                missionPlan.push(mavItem);
+                printf("[RECV] MISSION_ITEM: WAYPOINT seq = %d, lat = %.2f, long = %.2f, alt = %.2f\n", mavItem.sequence, mavItem.latitude, mavItem.longitude, mavItem.altitude);
+                break;
+            }
+            }
+            // respond with ACK immediately
+            sendMissionAck(message.sysid, message.compid, MAV_MISSION_ACCEPTED);
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_ACK:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_MISSION_ACK\n");
+            mavlink_msg_mission_ack_decode(&message, &(current_messages.mission_ack));
+            // check if it is the right mission ack
+            current_messages.time_stamps.mission_ack = get_time_usec();
+            this_timestamps.mission_ack = current_messages.time_stamps.mission_ack;
+            setMissionAck();
+            //typeack=current_messages.mission_ack.type;
+            break;
+        }
+        case MAVLINK_MSG_ID_COMMAND_ACK:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_COMMAND_ACK\n");
+            mavlink_msg_command_ack_decode(&message, &(current_messages.command_ack));
+            // check if it is the right command ack
+            current_messages.time_stamps.command_ack = get_time_usec();
+            this_timestamps.command_ack = current_messages.time_stamps.command_ack;
+            setCommandAck();
+            break;
+        }
+        case MAVLINK_MSG_ID_MISSION_REQUEST:
+        {
+            //    printf("MAVLINK_MSG_ID_MISSION_REQUEST\n");
+            mavlink_msg_mission_request_decode(&message, &(current_messages.mission_request));
+            seq=current_messages.mission_request.seq;
+            current_messages.time_stamps.mission_request = get_time_usec();
+            this_timestamps.mission_request = current_messages.time_stamps.mission_request;
+            request=true;
+            break;
+        }
+        case MAVLINK_MSG_ID_HOME_POSITION:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_HOME_POSITION\n");
+            mavlink_msg_home_position_decode(&message, &(current_messages.home_position));
+            current_messages.time_stamps.home_position = get_time_usec();
+            this_timestamps.home_position = current_messages.time_stamps.home_position;
+            home_position_set=true;
+            break;
+        }
+        case MAVLINK_MSG_ID_HEARTBEAT:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_HEARTBEAT\n");
+            mavlink_msg_heartbeat_decode(&message, &(current_messages.heartbeat));
+            current_messages.time_stamps.heartbeat = get_time_usec();
+            this_timestamps.heartbeat = current_messages.time_stamps.heartbeat;
+            state=current_messages.heartbeat.system_status;
+            break;
+        }
+
+        case MAVLINK_MSG_ID_SYS_STATUS:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_SYS_STATUS\n");
+            mavlink_msg_sys_status_decode(&message, &(current_messages.sys_status));
+            current_messages.time_stamps.sys_status = get_time_usec();
+            this_timestamps.sys_status = current_messages.time_stamps.sys_status;
+            //USB_port->write_message(message);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_BATTERY_STATUS:
+        {
+            //printf("MAVLINK_MSG_ID_BATTERY_STATUS\n");
+            mavlink_msg_battery_status_decode(&message, &(current_messages.battery_status));
+            current_messages.time_stamps.battery_status = get_time_usec();
+            this_timestamps.battery_status = current_messages.time_stamps.battery_status;
+            //USB_port->write_message(message);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_RADIO_STATUS:
+        {
+            //printf("MAVLINK_MSG_ID_RADIO_STATUS\n");
+            mavlink_msg_radio_status_decode(&message, &(current_messages.radio_status));
+            current_messages.time_stamps.radio_status = get_time_usec();
+            this_timestamps.radio_status = current_messages.time_stamps.radio_status;
+            break;
+        }
+
+        case MAVLINK_MSG_ID_LOCAL_POSITION_NED:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_LOCAL_POSITION_NED\n");
+            mavlink_msg_local_position_ned_decode(&message, &(current_messages.local_position_ned));
+            current_messages.time_stamps.local_position_ned = get_time_usec();
+            this_timestamps.local_position_ned = current_messages.time_stamps.local_position_ned;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(&message);
+            mavItem.x = mavlink_msg_local_position_ned_get_x(&message);
+            mavItem.y = mavlink_msg_local_position_ned_get_y(&message);
+            mavItem.z = mavlink_msg_local_position_ned_get_z(&message);
+            mavItem.vx = mavlink_msg_local_position_ned_get_vx(&message);
+            mavItem.vy = mavlink_msg_local_position_ned_get_vy(&message);
+            mavItem.vz = mavlink_msg_local_position_ned_get_vz(&message);
+            missionCommands.push(mavItem);
+            recvSetpointX = mavItem.x;
+            recvSetpointY = mavItem.y;
+            break;
+        }
+
+        case MAVLINK_MSG_ID_GLOBAL_POSITION_INT:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_GLOBAL_POSITION_INT\n");
+            mavlink_msg_global_position_int_decode(&message, &(current_messages.global_position_int));
+            current_messages.time_stamps.global_position_int = get_time_usec();
+            this_timestamps.global_position_int = current_messages.time_stamps.global_position_int;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(&message);
+            mavItem.latitude = (float)mavlink_msg_global_position_int_get_lat(&message);
+            mavItem.longitude = (float)mavlink_msg_global_position_int_get_lon(&message);
+            mavItem.altitude = (float)mavlink_msg_global_position_int_get_alt(&message);
+            mavItem.relative_alt = (float)mavlink_msg_global_position_int_get_relative_alt(&message);
+            mavItem.vx = (float)mavlink_msg_global_position_int_get_vx(&message);
+            mavItem.vy = (float)mavlink_msg_global_position_int_get_vy(&message);
+            mavItem.vz = (float)mavlink_msg_global_position_int_get_vz(&message);
+            mavItem.yaw_angle = (float)mavlink_msg_global_position_int_get_hdg(&message); // heading
+            missionCommands.push(mavItem);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED:
+        {
+            mavlink_msg_set_position_target_local_ned_decode(&message, &(current_messages.set_position_target_local_ned));
+            current_messages.time_stamps.set_position_target_local_ned = get_time_usec();
+            this_timestamps.set_position_target_local_ned = current_messages.time_stamps.set_position_target_local_ned;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(&message);
+            mavItem.target_system = mavlink_msg_set_position_target_local_ned_get_target_system(&message);
+            mavItem.target_component = mavlink_msg_set_position_target_local_ned_get_target_component(&message);
+            mavItem.coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(&message);
+            mavItem.type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(&message);
+            mavItem.x = mavlink_msg_set_position_target_local_ned_get_x(&message);
+            mavItem.y = mavlink_msg_set_position_target_local_ned_get_y(&message);
+            mavItem.z = mavlink_msg_set_position_target_local_ned_get_z(&message);
+            mavItem.vx = mavlink_msg_set_position_target_local_ned_get_vx(&message);
+            mavItem.vy = mavlink_msg_set_position_target_local_ned_get_vy(&message);
+            mavItem.vz = mavlink_msg_set_position_target_local_ned_get_vz(&message);
+            mavItem.afx = mavlink_msg_set_position_target_local_ned_get_afx(&message);
+            mavItem.afy = mavlink_msg_set_position_target_local_ned_get_afy(&message);
+            mavItem.afz = mavlink_msg_set_position_target_local_ned_get_afz(&message);
+            mavItem.yaw = mavlink_msg_set_position_target_local_ned_get_yaw(&message);
+            mavItem.yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(&message);
+            missionCommands.push(mavItem);
+            printf("[RECV] MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED x = %.2f y = %.2f\n", mavItem.x, mavItem.y);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED\n");
+            mavlink_msg_position_target_local_ned_decode(&message, &(current_messages.position_target_local_ned));
+            current_messages.time_stamps.position_target_local_ned = get_time_usec();
+            this_timestamps.position_target_local_ned = current_messages.time_stamps.position_target_local_ned;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_position_target_local_ned_get_time_boot_ms(&message);
+            mavItem.coordinate_frame = mavlink_msg_position_target_local_ned_get_coordinate_frame(&message);
+            mavItem.type_mask = mavlink_msg_position_target_local_ned_get_type_mask(&message);
+            mavItem.x = mavlink_msg_position_target_local_ned_get_x(&message);
+            mavItem.y = mavlink_msg_position_target_local_ned_get_y(&message);
+            mavItem.z = mavlink_msg_position_target_local_ned_get_z(&message);
+            mavItem.vx = mavlink_msg_position_target_local_ned_get_vx(&message);
+            mavItem.vy = mavlink_msg_position_target_local_ned_get_vy(&message);
+            mavItem.vz = mavlink_msg_position_target_local_ned_get_vz(&message);
+            mavItem.afx = mavlink_msg_position_target_local_ned_get_afx(&message);
+            mavItem.afy = mavlink_msg_position_target_local_ned_get_afy(&message);
+            mavItem.afz = mavlink_msg_position_target_local_ned_get_afz(&message);
+            mavItem.yaw = mavlink_msg_position_target_local_ned_get_yaw(&message);
+            mavItem.yaw_rate = mavlink_msg_position_target_local_ned_get_yaw_rate(&message);
+            missionCommands.push(mavItem);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT\n");
+            mavlink_msg_set_position_target_global_int_decode(&message, &(current_messages.set_position_target_global_int));
+            current_messages.time_stamps.set_position_target_global_int = get_time_usec();
+            this_timestamps.set_position_target_global_int = current_messages.time_stamps.set_position_target_global_int;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_set_position_target_global_int_get_time_boot_ms(&message);
+            mavItem.target_system = mavlink_msg_set_position_target_global_int_get_target_system(&message);
+            mavItem.target_component = mavlink_msg_set_position_target_global_int_get_target_component(&message);
+            mavItem.coordinate_frame = mavlink_msg_set_position_target_global_int_get_coordinate_frame(&message);
+            mavItem.type_mask = mavlink_msg_set_position_target_global_int_get_type_mask(&message);
+            mavItem.lat_int = mavlink_msg_set_position_target_global_int_get_lat_int(&message);
+            mavItem.lon_int = mavlink_msg_set_position_target_global_int_get_lon_int(&message);
+            mavItem.altitude = mavlink_msg_set_position_target_global_int_get_alt(&message);
+            mavItem.vx = mavlink_msg_set_position_target_global_int_get_vx(&message);
+            mavItem.vy = mavlink_msg_set_position_target_global_int_get_vy(&message);
+            mavItem.vz = mavlink_msg_set_position_target_global_int_get_vz(&message);
+            mavItem.afx = mavlink_msg_set_position_target_global_int_get_afx(&message);
+            mavItem.afy = mavlink_msg_set_position_target_global_int_get_afy(&message);
+            mavItem.afz = mavlink_msg_set_position_target_global_int_get_afz(&message);
+            mavItem.yaw = mavlink_msg_set_position_target_global_int_get_yaw(&message);
+            mavItem.yaw_rate = mavlink_msg_set_position_target_global_int_get_yaw_rate(&message);
+            missionCommands.push(mavItem);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT:
+        {
+            printf("[RECV] MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT\n");
+            mavlink_msg_position_target_global_int_decode(&message, &(current_messages.position_target_global_int));
+            current_messages.time_stamps.position_target_global_int = get_time_usec();
+            this_timestamps.position_target_global_int = current_messages.time_stamps.position_target_global_int;
+            // insert it into the command queue
+            MavlinkItem mavItem;
+            mavItem.id = message.msgid;
+            mavItem.time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(&message);
+            mavItem.coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(&message);
+            mavItem.type_mask = mavlink_msg_position_target_global_int_get_type_mask(&message);
+            mavItem.lat_int = mavlink_msg_position_target_global_int_get_lat_int(&message);
+            mavItem.lon_int = mavlink_msg_position_target_global_int_get_lon_int(&message);
+            mavItem.altitude = mavlink_msg_position_target_global_int_get_alt(&message);
+            mavItem.vx = mavlink_msg_position_target_global_int_get_vx(&message);
+            mavItem.vy = mavlink_msg_position_target_global_int_get_vy(&message);
+            mavItem.vz = mavlink_msg_position_target_global_int_get_vz(&message);
+            mavItem.afx = mavlink_msg_position_target_global_int_get_afx(&message);
+            mavItem.afy = mavlink_msg_position_target_global_int_get_afy(&message);
+            mavItem.afz = mavlink_msg_position_target_global_int_get_afz(&message);
+            mavItem.yaw = mavlink_msg_position_target_global_int_get_yaw(&message);
+            mavItem.yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(&message);
+            missionCommands.push(mavItem);
+            break;
+        }
+
+        case MAVLINK_MSG_ID_HIGHRES_IMU:
+        {
+            //printf("[RECV] MAVLINK_MSG_ID_HIGHRES_IMU\n");
+            mavlink_msg_highres_imu_decode(&message, &(current_messages.highres_imu));
+            current_messages.time_stamps.highres_imu = get_time_usec();
+            this_timestamps.highres_imu = current_messages.time_stamps.highres_imu;
+            break;
+        }
+
+        case MAVLINK_MSG_ID_ATTITUDE:
+        {
+            //printf("MAVLINK_MSG_ID_ATTITUDE\n");
+            mavlink_msg_attitude_decode(&message, &(current_messages.attitude));
+            current_messages.time_stamps.attitude = get_time_usec();
+            this_timestamps.attitude = current_messages.time_stamps.attitude;
+            break;
+        }
+
+        case MAVLINK_MSG_ID_COMMAND_LONG:
+        {
+            //printf("[RECV] MAVLINK_MSG_ID_COMMAND_LONG\n");
+            mavlink_msg_command_long_decode(&message, &(current_messages.command_long));
+            current_messages.time_stamps.command_long = get_time_usec();
+            this_timestamps.command_long = current_messages.time_stamps.command_long;
+            // process the received command
+            printf("Received command %d\n", current_messages.command_long.command);
+            switch(current_messages.command_long.command) {
+            case MAV_CMD_SET_MESSAGE_INTERVAL:
+            {
+                int64_t desired_interval = (int64_t)current_messages.command_long.param2;
+                printf("[RECV] COMMAND_LONG: MAV_CMD_SET_MESSAGE_INTERVAL %d %ld\n", (int)current_messages.command_long.param1, (int64_t)current_messages.command_long.param2);
+                // adding to the command queue
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.callback_message = (uint16_t)mavlink_msg_command_long_get_param1(&message);
+                (desired_interval == -1)?(mavItem.callback_flag = false):(mavItem.callback_flag = true);
+                switch((int)current_messages.command_long.param1) {
+                case MAVLINK_MSG_ID_HEARTBEAT:
+                {
+                    if(current_messages.command_long.param2 == -1) {
+                        stopHeartbeat();
+                    } else if(current_messages.command_long.param2 == 0) {
+                        startHeartbeat(HEARTBEAT_DEFAULT_PERIOD);
+                    } else {
+                        startHeartbeat(desired_interval);
+                    }
+                    break;
+                }
+                case MAVLINK_MSG_ID_LOCAL_POSITION_NED:
+                {
+                    if(current_messages.command_long.param2 == -1) {
+                        sendingPosition = false;
+                    } else if(current_messages.command_long.param2 == 0) {
+                        sendingPositionInterval = POSITION_DEFAULT_PERIOD;
+                        sendingPosition = true;
+                    } else {
+                        sendingPositionInterval = desired_interval;
+                        sendingPosition = true;
+                    }
+                    mavItem.callback_period = sendingPositionInterval;
+                    break;
+                }
+                case MAVLINK_MSG_ID_ATTITUDE:
+                {
+                    if(current_messages.command_long.param2 == -1) {
+                        sendingAttitude = false;
+                    } else if(current_messages.command_long.param2 == 0) {
+                        sendingAttitudeInterval = ATTITUDE_DEFAULT_PERIOD;
+                        sendingAttitude = true;
+                    } else {
+                        sendingAttitudeInterval = desired_interval;
+                        sendingAttitude = true;
+                    }
+                    mavItem.callback_period = sendingAttitudeInterval;
+                    break;
+                }
+                case MAVLINK_MSG_ID_SYS_STATUS:
+                {
+                    if(current_messages.command_long.param2 == -1) {
+                        sendingSystemStatus = false;
+                    } else if(current_messages.command_long.param2 == 0) {
+                        sendingSystemStatusInterval = STATUS_DEFAULT_PERIOD;
+                        sendingSystemStatus = true;
+                    } else {
+                        sendingSystemStatusInterval = desired_interval;
+                        sendingSystemStatus = true;
+                    }
+                    mavItem.callback_period = sendingSystemStatusInterval;
+                    break;
+                }
+                default:
+                    break;
+                }
+                // finally add the command to the queue
+                missionCommands.push(mavItem);
+                break;
+            }
+                // * Commands queue:
+                // * 176  MAV_CMD_DO_SET_MODE             (mode MAV_MODE)
+                // * 179  MAV_CMD_DO_SET_HOME             (use current, lat, long, altitude)
+                // * 193  MAV_CMD_DO_PAUSE_CONTINUE       (holdContinue: 0=hold, 1=continue)
+                // * 300  MAV_CMD_MISSION_START           (first item, last item)
+                // * 410  MAV_CMD_GET_HOME_POS            (empty)
+                // * 20   MAV_CMD_NAV_RETURN_TO_LAUNCH    (empty)
+
+            case MAV_CMD_MISSION_START:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.first_item = (uint16_t)mavlink_msg_command_long_get_param1(&message);
+                mavItem.last_item = (uint16_t)mavlink_msg_command_long_get_param2(&message);
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_MISSION_START firstItem = %d, lastItem = %d\n", mavItem.first_item, mavItem.last_item);
+                missionStarted();
+                break;
+            }
+            case MAV_CMD_DO_SET_HOME:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.use_current = (uint8_t)mavlink_msg_command_long_get_param1(&message);
+                mavItem.latitude = mavlink_msg_command_long_get_param5(&message);
+                mavItem.longitude = mavlink_msg_command_long_get_param6(&message);
+                mavItem.altitude = mavlink_msg_command_long_get_param7(&message);
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_DO_SET_HOME use_current = %d, lat = %.2f, long = %.2f, altitude = %.2f\n", mavItem.use_current, mavItem.latitude, mavItem.longitude, mavItem.altitude);
+                break;
+            }
+            case MAV_CMD_GET_HOME_POSITION:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                missionCommands.push(mavItem);
+                // TODO respond with a home position
+                printf("[RECV] COMMAND_LONG: MAV_CMD_GET_HOME_POSITION\n");
+                break;
+            }
+            case MAV_CMD_DO_SET_MODE:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.mode = mavlink_msg_command_long_get_param1(&message);
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_DO_SET_MODE %d\n", mavItem.mode);
+                break;
+            }
+            case MAV_CMD_NAV_RETURN_TO_LAUNCH:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_NAV_RETURN_TO_LAUNCH\n");
+                break;
+            }
+            case MAV_CMD_NAV_TAKEOFF:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.min_pitch = mavlink_msg_command_long_get_param1(&message);
+                mavItem.yaw_angle = mavlink_msg_command_long_get_param4(&message);
+                mavItem.latitude = mavlink_msg_command_long_get_param5(&message);
+                mavItem.longitude = mavlink_msg_command_long_get_param6(&message);
+                mavItem.altitude = mavlink_msg_command_long_get_param7(&message);
+                // adding commands to the command queue
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_NAV_TAKEOFF\n");
+                break;
+            }
+            case MAV_CMD_NAV_LAND:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.abort_altitude = mavlink_msg_command_long_get_param1(&message);
+                mavItem.desired_yaw = mavlink_msg_command_long_get_param4(&message);
+                mavItem.latitude = mavlink_msg_command_long_get_param5(&message);
+                mavItem.longitude = mavlink_msg_command_long_get_param6(&message);
+                mavItem.altitude = mavlink_msg_command_long_get_param7(&message);
+                // adding commands to the command queue
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_NAV_LAND\n");
+                break;
+            }
+            case MAV_CMD_DO_PAUSE_CONTINUE:
+            {
+                MavlinkItem mavItem;
+                mavItem.id = mavlink_msg_command_long_get_command(&message);
+                mavItem.pause_continue = (uint16_t)mavlink_msg_command_long_get_param1(&message);
+                missionCommands.push(mavItem);
+                printf("[RECV] COMMAND_LONG: MAV_CMD_DO_PAUSE_CONTINUE pauseContinue = %d\n", mavItem.pause_continue);
+            }
+            case MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN:
+            {
+                // shutdown signal received
+                shutdown_flag = true;
+                printf("[RECV] COMMAND_LONG: MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN\n");
+                break;
+            }
+            case MAV_CMD_DO_REPOSITION:
+            {
+                // TODO reposition
+                printf("[TODO] DO_REPOSITION\n");
+                break;
+            }
+            case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES:
+            {
+                // TODO request autopilot capabilities
+                break;
+            }
+            default:
+                break;
+            }
+            // respond with ACK immediately
+            sendCommandAck(current_messages.command_long.command, MAV_CMD_ACK_OK);
+            break;
+        }
+        default:
+        {
+            printf("Warning, did not handle message id %i\n",message.msgid);
+            break;
+        }
+        }
+    } else {
+        printf("ERROR: CRC check failed!\n");
+    }
+}
+
+uint64_t MavlinkUDP::get_time_usec() {
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    return ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec;
+}
+
+void MavlinkUDP::debug(string debug_msg) {
+    if(debug_messages) cout << "[DEBUG] " << debug_msg << endl;
+}
+
+
+int MavlinkUDP::waitCommandAck(uint64_t timeout) {
+    uint64_t start_time = get_time_usec();
+    uint64_t end_time = start_time + timeout;
+    //printf("Wait: start_time %lld end_time %lld period %lld\n", start_time, end_time, end_time-start_time);
+    while(get_time_usec() < end_time)
+    {
+        if(getCommandAck()){
+            //printf("Command ACK received!\n");
+            resetCommandAck();
+            return 0;
+        }
+        usleep(1000);
+    }
+    printf("[ERROR] Command ACK timeout! %d\n", getCommandAck());
+    return -1;
+}
+
+int MavlinkUDP::waitMissionAck(uint64_t timeout) {
+    uint64_t start_time = get_time_usec();
+    uint64_t end_time = start_time + timeout;
+    //printf("Wait: start_time %lld end_time %lld period %lld\n", start_time, end_time, end_time-start_time);
+    while(get_time_usec() < end_time)
+    {
+        if(getMissionAck()){
+            //printf("Mission ACK received!\n");
+            resetMissionAck();
+            return 0;
+        }
+        usleep(1000);
+    }
+    printf("[ERROR] Mission ACK timeout!\n");
+    return -1;
+}
+
+int MavlinkUDP::waitMissionCount(uint64_t timeout) {
+    uint64_t start_time = get_time_usec();
+    uint64_t end_time = start_time + timeout;
+    int mission_count;
+    //printf("Wait: start_time %lld end_time %lld period %lld\n", start_time, end_time, end_time-start_time);
+    while(get_time_usec() < end_time)
+    {
+        // assignment in if!
+        if((mission_count = getMissionCount())){
+            //printf("Mission ACK received!\n");
+            resetMissionCount();
+            return mission_count;
+        }
+        usleep(1000);
+    }
+    printf("[ERROR] Mission ACK timeout!\n");
+    return -1;
+}
+
+MavlinkComponent::MavlinkComponent(std::string addr) : addrIP(addr) {
+    // craete the system ID out of the IP address
+    int byte1, byte2, byte3, byte4;
+    char dot = '.';
+    std::istringstream s(addrIP);
+    s >> byte1 >> dot >> byte2 >> dot >> byte3 >> dot >> byte4;
+    sysid = byte4;
+    compid = 0;
+    printf("Mavlink component created:\tSystem ID %d\tComponent ID %d\n", sysid, compid);
+}
Index: tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/MavlinkUDP.h	(revision 209)
@@ -0,0 +1,481 @@
+//  created:    20/04/2016
+//  updated:    20/09/2016
+//  filename:   MavlinkUDP.h
+//
+//  author:     Milan Erdelj, <milan.erdelj@hds.utc.fr>
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//              Current_messages and Time_Stamps:
+//              Copyright (c) 2014 MAVlink Development Team. All rights reserved.
+//              Trent Lukaczyk, <aerialhedgehog@gmail.com>
+//              Jaycee Lock,    <jaycee.lock@gmail.com>
+//              Lorenz Meier,   <lm@inf.ethz.ch>
+//
+//  version:    $Id: $
+//
+//  purpose:    MAVLink communication block class that used UDP sockets
+//
+//
+/*********************************************************************/
+
+#ifndef MAVLINKUDP_H
+#define MAVLINKUDP_H
+
+#include <thread>
+#include <iostream>
+#include <queue>
+#include <arpa/inet.h>
+#include <cstring>
+#include <unistd.h>
+#include <sys/time.h>
+#include "include/common/mavlink.h"
+#include "CallbackTimer.h"
+
+// TODO these constants should be read from a file
+#define LOCALHOST "127.0.0.1"
+#define MAVLINK_UDP_PORT 5555
+#define GCS_ADDR "192.168.6.150"
+#define UAV2 "192.168.6.2"
+#define UAV1 "192.168.6.1"
+#define PC_LATITUDE "192.168.6.100"
+
+#define MAX_NEIGH 50
+
+#define THREAD_MS_IN 10
+#define THREAD_MS_OUT 10
+
+#define BUFF_IN_LEN 80
+#define BUFF_OUT_LEN 80
+
+#define ACK_TIMEOUT 100000 // us
+#define HEARTBEAT_DEFAULT_PERIOD 1000000
+#define POSITION_DEFAULT_PERIOD 1000000
+#define ATTITUDE_DEFAULT_PERIOD 1000000
+#define STATUS_DEFAULT_PERIOD 1000000
+
+//#ifndef MAV_CUSTOM_PARAM
+//#define MAV_CUSTOM_PARAM
+
+//enum TMAVCustomParams {
+//    MAV_LOOP_MISSION_ITEMS=42,
+//    MAV_CUSTOM_PARAM1=43,
+//    MAV_CUSTOM_PARAM2=44
+//};
+
+//#endif
+
+#ifndef REBOOT_SHUTDOWN_PARAMS
+#define REBOOT_SHUTDOWN_PARAMS
+
+enum TRebootShutdownParam {
+    NO_EFFECT=0,
+    REBOOT=1,
+    SHUTDOWN=2,
+    REBOOT_KEEP_IN_BOOTLOADER=3
+};
+
+#endif
+
+struct Time_Stamps
+{
+    Time_Stamps() {
+        reset_timestamps();
+    }
+    uint64_t mission_ack;
+    uint64_t command_ack;
+    uint64_t command_long;
+    uint64_t timesync;
+    uint64_t mission_count;
+    uint64_t mission_request;
+    uint64_t mission_reached;
+    uint64_t mission_item;
+    uint64_t mission_request_list;
+    uint64_t mission_write_partial_list;
+    uint64_t heartbeat;
+    uint64_t home_position;
+    uint64_t sys_status;
+    uint64_t battery_status;
+    uint64_t radio_status;
+    uint64_t local_position_ned;
+    uint64_t global_position_int;
+    uint64_t set_position_target_local_ned;
+    uint64_t set_position_target_global_int;
+    uint64_t position_target_local_ned;
+    uint64_t position_target_global_int;
+    uint64_t highres_imu;
+    uint64_t attitude;
+    uint64_t system_time;
+    uint64_t clear_all;
+
+    void reset_timestamps() {
+        mission_request=0;
+        mission_request_list=0;
+        mission_write_partial_list=0;
+        mission_reached=0;
+        command_long=0;
+        timesync=0;
+        mission_count=0;
+        mission_item=0;
+        mission_ack=0;
+        home_position =0;
+        heartbeat = 0;
+        sys_status = 0;
+        battery_status = 0;
+        radio_status = 0;
+        local_position_ned = 0;
+        global_position_int = 0;
+        set_position_target_local_ned = 0;
+        set_position_target_global_int = 0;
+        position_target_local_ned = 0;
+        position_target_global_int = 0;
+        highres_imu = 0;
+        attitude = 0;
+        system_time = 0;
+        clear_all = 0;
+    }
+};
+
+// Struct containing information on the MAV we are currently connected to
+struct Mavlink_Messages {
+    int sysid;
+    int compid;
+    mavlink_system_time_t system_time;
+    mavlink_mission_request_t mission_request;
+    mavlink_mission_request_list_t mission_request_list;
+    mavlink_mission_write_partial_list_t mission_write_partial_list;
+    mavlink_mission_item_reached_t mission_reached;
+    mavlink_mission_clear_all_t clear_all;
+    mavlink_command_long_t command_long;
+    mavlink_command_ack_t command_ack;
+    mavlink_timesync_t timesync;
+    mavlink_mission_count_t mission_count;
+    mavlink_mission_ack_t mission_ack;
+    mavlink_mission_item_t mission_item;
+    mavlink_home_position_t home_position;
+    mavlink_heartbeat_t heartbeat;
+    mavlink_sys_status_t sys_status;
+    mavlink_battery_status_t battery_status;
+    mavlink_radio_status_t radio_status;
+    mavlink_local_position_ned_t local_position_ned;
+    mavlink_global_position_int_t global_position_int;
+    mavlink_set_position_target_local_ned_t set_position_target_local_ned;
+    mavlink_set_position_target_global_int_t set_position_target_global_int;
+    mavlink_position_target_local_ned_t position_target_local_ned;
+    mavlink_position_target_global_int_t position_target_global_int;
+    mavlink_highres_imu_t highres_imu;
+    mavlink_attitude_t attitude;
+    Time_Stamps time_stamps;
+    void reset_timestamps() {
+        time_stamps.reset_timestamps();
+    }
+};
+
+// * Mission items queue:
+// * 16   MAV_CMD_NAV_WAYPOINT            (hold time, acceptance radius, yaw angle, lat, long, altitude)
+// * 21   MAV_CMD_NAV_LAND                (abort alt, yaw angle, lat, long, altitude)
+// * 22   MAV_CMD_NAV_TAKEOFF             (yaw angle, lat, long, altitude)
+// * 177  MAV_CMD_DO_JUMP                 (sequence, repeat count)
+// * 20   MAV_CMD_NAV_RETURN_TO_LAUNCH    (empty)
+
+// * Commands queue:
+// * 176  MAV_CMD_DO_SET_MODE             (mode MAV_MODE)
+// * 179  MAV_CMD_DO_SET_HOME             (use current, lat, long, altitude)
+// * 193  MAV_CMD_DO_PAUSE_CONTINUE       (holdContinue: 0=hold, 1=continue)
+// * 300  MAV_CMD_MISSION_START           (first item, last item)
+// * 410  MAV_CMD_GET_HOME_POS            (empty)
+// * 20   MAV_CMD_NAV_RETURN_TO_LAUNCH    (empty)
+
+struct MavlinkItem {
+    // TODO add timestamp
+    //
+    uint16_t id;
+    uint8_t target_system;
+    uint8_t target_component;
+    uint16_t sequence;
+    uint16_t jump_sequence;
+    uint16_t jump_repeat_count;
+    uint8_t use_current;
+    uint64_t hold_time;
+    float radius;
+    float latitude, longitude, altitude, relative_alt;
+    float x, y, z;
+    float vx, vy, vz;
+    float afx, afy, afz;
+    float yaw, yaw_rate;
+    float abort_altitude;
+    float desired_yaw;
+    float yaw_angle;
+    float min_pitch;
+    uint8_t pause_continue;
+    uint16_t first_item, last_item;
+    uint8_t mode;
+    uint32_t time_boot_ms;
+    uint8_t coordinate_frame;
+    uint16_t type_mask;
+    int32_t lat_int, lon_int;
+    bool callback_flag;
+    uint64_t callback_period;
+    uint16_t callback_message;
+    MavlinkItem() {
+        target_system = target_component = 0;
+        first_item = last_item = 0;
+        mode = 0;
+        pause_continue = use_current = 0;
+        hold_time = 0;
+        id = sequence = 0;
+        jump_sequence = jump_repeat_count = 0;
+        radius = yaw_angle = latitude = longitude = altitude = relative_alt = x = y = z = 0;
+        desired_yaw = abort_altitude = 0;
+        min_pitch = 0;
+        vx = vy = vz = 0;
+        afx = afy = afz = 0;
+        yaw = yaw_rate = 0;
+        time_boot_ms = 0;
+        coordinate_frame = 0;
+        type_mask = 0;
+        lat_int = lon_int = 0;
+        callback_flag = false;
+        callback_message = 0;
+        callback_period = HEARTBEAT_DEFAULT_PERIOD;
+    }
+};
+
+class SocketRuntimeError {
+private:
+    std::string info;
+public:
+    SocketRuntimeError(const std::string& str) : info(str) {}
+    std::string getInfo() const { return info; }
+};
+
+class MavlinkRuntimeError {
+private:
+    std::string info;
+public:
+    MavlinkRuntimeError(const std::string& str) : info(str) {}
+    std::string getInfo() const { return info; }
+};
+
+class MavlinkComponent
+{
+public:
+    MavlinkComponent(std::string addr);
+    //MavComAgent();
+    ~MavlinkComponent() {}
+    uint8_t getSysID() const { return sysid; }
+    uint8_t getCompID() const { return compid; }
+    std::string getAddrIP() { return addrIP; }
+private:
+    uint8_t sysid; // system ID
+    uint8_t compid; // component ID
+    std::string addrIP; // IP address
+};
+
+class MavlinkUDP {
+public:
+    MavlinkUDP(const std::string& addr, int port);
+    ~MavlinkUDP();
+
+    // threads start and stop
+    void startThreads();
+    void stopThreads();
+    void handleQuit( int sig );
+    int getSocket() const { return m_socket_in; }
+    int getPort() const { return m_port; }
+    std::string getAddr() const { return m_addr; }
+    bool something_to_send;
+    uint16_t length_to_send;
+    u_int8_t buff_out[BUFF_OUT_LEN];
+    u_int8_t buff_in[BUFF_IN_LEN];
+    ssize_t recsize;
+    socklen_t fromlen;
+    void clearData();
+
+    char control_status;
+    char arming_status;
+    uint64_t write_count; // number of messages sent
+    uint64_t Xtimec;
+    uint64_t Xtimes;
+
+    int system_id;
+    int autopilot_id;
+    int component_id;
+    bool home_position_set;
+    bool ack;
+    bool Xtimesync;
+    int state;
+    int typeack;
+    bool request;
+    bool waypoint;
+    int frame;
+    int command;
+    int seq;
+    int seqr;
+    int seqold;
+    int count;
+    int Waycount;
+    int Wayseq;
+    int compt;
+    uint16_t message_interval;
+    bool debug_messages;
+
+    // received setpoint values
+    float recvSetpointX;
+    float recvSetpointY;
+
+    bool sendingPosition;
+    uint64_t sendingPositionInterval;
+    bool sendingAttitude;
+    uint64_t sendingAttitudeInterval;
+    bool sendingSystemStatus;
+    uint64_t sendingSystemStatusInterval;
+    bool sendingHeartbeat;
+    uint64_t sendingHeartbeatInterval;
+
+    // queue of mission items (plan de vol)
+    std::queue<MavlinkItem> missionPlan;
+    const std::queue<MavlinkItem>& getMissionPlan() const { return missionPlan; }
+    void clearMissionPlan() { std::queue<MavlinkItem> empty; std::swap(missionPlan, empty); }
+    uint16_t currentMissionItem;
+    uint16_t missionFirst;
+    uint16_t missionLast;
+    // queue of received commands
+    std::queue<MavlinkItem> missionCommands;
+    const std::queue<MavlinkItem>& getMissionCommands() const { return missionCommands; }
+    void clearMissionCommands() { std::queue<MavlinkItem> empty; std::swap(missionCommands, empty); }
+
+//    bool mission_items_loop;
+//    void itemsLoop() { mission_items_loop = true; }
+//    void itemsNoLoop() { mission_items_loop = false; }
+//    bool getItemsLoop() const { return mission_items_loop; }
+
+    bool missionActive;
+    bool getMissionStatus() const { return missionActive; }
+    void missionStarted() { missionActive = true; }
+    void missionStopped() { missionActive = false; }
+
+    mavlink_command_long_t com;
+    Mavlink_Messages current_messages;
+    mavlink_set_position_target_local_ned_t initial_position;
+    Time_Stamps last_timestamps;
+
+    MavlinkComponent me, target; // destination system
+
+    bool check_mavlink_crc(u_int8_t *buff_in, ssize_t recsize, u_int8_t msgid);
+    void decode_message(u_int8_t *buff_in, ssize_t size);
+    void print_message(u_int8_t *buff_in, ssize_t recsize);
+
+    // messages
+    void sendHeartbeat();
+    void sendSystemStatus(uint32_t onboardSensorsPresent, uint32_t onboardSensorsEnabled, uint32_t onboardSensorsHealth, uint16_t load, uint16_t voltage, int16_t current, int8_t batteryRemaining, uint16_t dropRateComm, uint16_t errorsComm, uint16_t errors1, uint16_t errors2, uint16_t errors3, uint16_t errors4); // callback
+    void sendBatteryStatus(uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, uint16_t *voltages, int16_t current, int32_t currentConsumed, int32_t energyConsumed, int8_t batteryRemaining); // callback
+    void sendSystemTime();
+    void sendLocalPositionNED(float x, float y, float z, float vx, float vy, float vz); // callback
+    void sendAttitude(float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed); // callback
+    void updateSetpoint(mavlink_set_position_target_local_ned_t setpoint);
+    void sendMissionAck(uint8_t targetSystem, uint8_t targetComponent, uint8_t type);
+    void sendCommandAck(uint16_t command, uint8_t result);
+    void sendAutopilotVersion(uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, uint8_t *flight_custom_version, uint8_t *middleware_custom_version, uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid);
+    void sendMissionCount(uint8_t targetSystem, uint8_t targetComponent, uint16_t count);
+    void sendCommandLong(uint8_t targetSystem, uint8_t targetComponent, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7);
+    void sendMissionWritePartialList(uint8_t targetSystem, uint8_t targetComponent, uint16_t startIndex, uint16_t endIndex);
+    void sendMissionItem(uint8_t targetSystem, uint8_t targetComponent, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z);
+    void sendMissionRequestList(uint8_t targetSystem, uint8_t targetComponent);
+    void sendMissionItemReached(uint16_t seq);
+    void sendMissionSetCurrent(uint8_t targetSystem, uint8_t targetComponent, uint16_t seq);
+    void sendMissionClearAll(uint8_t targetSystem, uint8_t targetComponent);
+    void sendSetPositionTargetLocalNED(uint32_t timeBootMs, uint8_t targetSystem, uint8_t targetComponent, uint8_t coordinateFrame, uint16_t typeMask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate);
+    void sendPositionTargetLocalNED(uint32_t timeBootMs, uint8_t coordinateFrame, uint16_t typeMask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate);
+    void sendSetPositionTargetGlobalInt(uint32_t time_boot_ms, uint8_t targetSystem, uint8_t targetComponent, uint8_t coordinateFrame, uint16_t typeMask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate);
+    void sendPositionTargetGlobalInt(uint32_t time_boot_ms, uint8_t coordinateFrame, uint16_t typeMask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate);
+
+    // mavlink commands
+    void cmdSetMessageInterval(uint8_t targetSystem, uint8_t targetComponent, uint8_t messageID, int64_t interval_usec);
+    void cmdNavWaypoint(uint8_t targetSystem, uint8_t targetComponent, float holdTime, float proximityRadius, float passRadius, float desiredYaw, float latitude, float longitude, float altitude);
+    void cmdNavLand(uint8_t targetSystem, uint8_t targetComponent, float abortAlt, float desiredYaw, float latitude, float longitude, float altitude); // land at location
+    void cmdDoLandStart(uint8_t targetSystem, uint8_t targetComponent, float latitude, float longitude); // mission command to perform landing
+    void cmdNavTakeoff(uint8_t targetSystem, uint8_t targetComponent, float desiredPitch, float magnetometerYaw, float latitude, float longitude, float altitude);
+    void cmdDoSetMode(uint8_t targetSystem, uint8_t targetComponent, uint8_t mavMode);
+    void cmdDoSetHome(uint8_t targetSystem, uint8_t targetComponent, uint8_t useCurrent);
+    void cmdGetHomePosition(uint8_t targetSystem, uint8_t targetComponent);
+    void cmdMissionStart(uint8_t targetSystem, uint8_t targetComponent, uint8_t firstItem, uint8_t lastItem);
+    void cmdDoSetParameter(uint8_t targetSystem, uint8_t targetComponent, uint8_t paramNumber, float paramValue);
+    void cmdRequestAutopilotCapabilities(uint8_t targetSystem, uint8_t targetComponent);
+    void cmdNavReturnToLaunch(uint8_t targetSystem, uint8_t targetComponent);
+    void cmdDoPauseContinue(uint8_t targetSystem, uint8_t targetComponent, uint8_t pauseContinue);
+    //void cmdVideoStartCapture(uint8_t targetSystem, uint8_t targetComponent);
+    //void cmdVideoStopCapture(uint8_t targetSystem, uint8_t targetComponent);
+    void cmdRebootShutdown(uint8_t targetSystem, uint8_t targetComponent, uint8_t autopilot, uint8_t onboardComputer);
+
+    bool getMissionAck() const { return mission_ack; }
+    bool getCommandAck() const { return command_ack; }
+    int getMissionCount() const { return mission_count; }
+    void setMissionAck() { mission_ack = true; }
+    void setCommandAck() { command_ack = true; }
+    void setMissionCount(int count) { mission_count = count; }
+    void resetMissionAck() { mission_ack = false; }
+    void resetCommandAck() { command_ack = false; }
+    void resetMissionCount() { mission_count = 0; }
+
+    bool ShutdownReceived() { return shutdown_flag; }
+
+    uint64_t get_time_usec();
+
+    int waitCommandAck(uint64_t timeout);
+    int waitMissionAck(uint64_t timeout);
+    int waitMissionCount(uint64_t timeout);
+
+private:
+
+    int m_socket_in;
+    int m_socket_out;
+    uint16_t m_port;
+    std::string m_addr;
+    struct addrinfo* m_addrinfo;
+    struct sockaddr_in myaddr_in, myaddr_out, client_in;
+    std::thread send_th;
+    std::thread recv_th;
+    void recv_thread(); // receiver thread
+    void send_thread();// sender thread
+    //int timed_recv(char *msg, size_t max_size, int max_wait_ms);
+    bool stop_recv;
+    bool stop_send;
+
+    inline void clearBuffer(uint8_t *buffer, int len);
+
+    mavlink_set_position_target_local_ned_t current_setpoint;
+
+    int bytes_sent;
+    // for local_position_ned
+    float position[6] = {};
+
+    // FIXME doesn't work with mavlink 2.0
+    mavlink_message_t msg;
+    u_int16_t msg_len;
+    u_int8_t hds_mavlink_message_crcs[256] = MAVLINK_MESSAGE_CRCS;
+
+    bool command_ack;
+    bool mission_ack;
+    int mission_count;
+
+    bool shutdown_flag;
+
+    int64_t heartbeat_period;
+    // callback timers
+    CallbackTimer timerHeartbeat;
+    void startHeartbeat(uint64_t period);
+    void stopHeartbeat();
+    void callbackHeartbeat();
+
+    CallbackTimer timerSystemTime;
+    void startSystemTime(uint64_t period);
+    void stopSystemTime();
+    void callbackSystemTime();
+
+    void stopAllCallbackTimers();
+
+    // debug
+    void debug(std::string debug_msg);
+};
+
+#endif // MAVLINKUDP_H
Index: tags/latest/tools/Controller/Mavlink/src/include/checksum.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/checksum.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/checksum.h	(revision 209)
@@ -0,0 +1,96 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _CHECKSUM_H_
+#define _CHECKSUM_H_
+
+// Visual Studio versions before 2010 don't have stdint.h, so we just error out.
+#if (defined _MSC_VER) && (_MSC_VER < 1600)
+#error "The C-MAVLink implementation requires Visual Studio 2010 or greater"
+#endif
+
+#include <stdint.h>
+
+/**
+ *
+ *  CALCULATE THE CHECKSUM
+ *
+ */
+
+#define X25_INIT_CRC 0xffff
+#define X25_VALIDATE_CRC 0xf0b8
+
+#ifndef HAVE_CRC_ACCUMULATE
+/**
+ * @brief Accumulate the X.25 CRC by adding one char at a time.
+ *
+ * The checksum function adds the hash of one char at a time to the
+ * 16 bit checksum (uint16_t).
+ *
+ * @param data new char to hash
+ * @param crcAccum the already accumulated checksum
+ **/
+static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum)
+{
+        /*Accumulate one byte of data into the CRC*/
+        uint8_t tmp;
+
+        tmp = data ^ (uint8_t)(*crcAccum &0xff);
+        tmp ^= (tmp<<4);
+        *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
+}
+#endif
+
+
+/**
+ * @brief Initiliaze the buffer for the X.25 CRC
+ *
+ * @param crcAccum the 16 bit X.25 CRC
+ */
+static inline void crc_init(uint16_t* crcAccum)
+{
+        *crcAccum = X25_INIT_CRC;
+}
+
+
+/**
+ * @brief Calculates the X.25 checksum on a byte buffer
+ *
+ * @param  pBuffer buffer containing the byte array to hash
+ * @param  length  length of the byte array
+ * @return the checksum over the buffer bytes
+ **/
+static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length)
+{
+        uint16_t crcTmp;
+        crc_init(&crcTmp);
+	while (length--) {
+                crc_accumulate(*pBuffer++, &crcTmp);
+        }
+        return crcTmp;
+}
+
+
+/**
+ * @brief Accumulate the X.25 CRC by adding an array of bytes
+ *
+ * The checksum function adds the hash of one char at a time to the
+ * 16 bit checksum (uint16_t).
+ *
+ * @param data new bytes to hash
+ * @param crcAccum the already accumulated checksum
+ **/
+static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length)
+{
+	const uint8_t *p = (const uint8_t *)pBuffer;
+	while (length--) {
+                crc_accumulate(*p++, crcAccum);
+        }
+}
+
+#endif /* _CHECKSUM_H_ */
+
+#ifdef __cplusplus
+}
+#endif
Index: tags/latest/tools/Controller/Mavlink/src/include/common/common.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/common.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/common.h	(revision 209)
@@ -0,0 +1,1013 @@
+/** @file
+ *	@brief MAVLink comm protocol generated from common.xml
+ *	@see http://mavlink.org
+ */
+#ifndef MAVLINK_COMMON_H
+#define MAVLINK_COMMON_H
+
+#ifndef MAVLINK_H
+    #error Wrong include order: MAVLINK_COMMON.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// MESSAGE LENGTHS AND CRCS
+
+#ifndef MAVLINK_MESSAGE_LENGTHS
+#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 4, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 229, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 93, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 40, 0, 182, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 0, 254, 36, 30, 18, 18, 51, 9, 0}
+#endif
+
+#ifndef MAVLINK_MESSAGE_CRCS
+#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 0, 35, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 0, 8, 204, 49, 170, 44, 83, 46, 0}
+#endif
+
+#ifndef MAVLINK_MESSAGE_INFO
+#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}}
+#endif
+
+#include "../protocol.h"
+
+#define MAVLINK_ENABLED_COMMON
+
+// ENUM DEFINITIONS
+
+
+/** @brief Micro air vehicle / autopilot classes. This identifies the individual model. */
+#ifndef HAVE_ENUM_MAV_AUTOPILOT
+#define HAVE_ENUM_MAV_AUTOPILOT
+typedef enum MAV_AUTOPILOT
+{
+	MAV_AUTOPILOT_GENERIC=0, /* Generic autopilot, full support for everything | */
+	MAV_AUTOPILOT_RESERVED=1, /* Reserved for future use. | */
+	MAV_AUTOPILOT_SLUGS=2, /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */
+	MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilotMega / ArduCopter, http://diydrones.com | */
+	MAV_AUTOPILOT_OPENPILOT=4, /* OpenPilot, http://openpilot.org | */
+	MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY=5, /* Generic autopilot only supporting simple waypoints | */
+	MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY=6, /* Generic autopilot supporting waypoints and other simple navigation commands | */
+	MAV_AUTOPILOT_GENERIC_MISSION_FULL=7, /* Generic autopilot supporting the full mission command set | */
+	MAV_AUTOPILOT_INVALID=8, /* No valid autopilot, e.g. a GCS or other MAVLink component | */
+	MAV_AUTOPILOT_PPZ=9, /* PPZ UAV - http://nongnu.org/paparazzi | */
+	MAV_AUTOPILOT_UDB=10, /* UAV Dev Board | */
+	MAV_AUTOPILOT_FP=11, /* FlexiPilot | */
+	MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */
+	MAV_AUTOPILOT_SMACCMPILOT=13, /* SMACCMPilot - http://smaccmpilot.org | */
+	MAV_AUTOPILOT_AUTOQUAD=14, /* AutoQuad -- http://autoquad.org | */
+	MAV_AUTOPILOT_ARMAZILA=15, /* Armazila -- http://armazila.com | */
+	MAV_AUTOPILOT_AEROB=16, /* Aerob -- http://aerob.ru | */
+	MAV_AUTOPILOT_ASLUAV=17, /* ASLUAV autopilot -- http://www.asl.ethz.ch | */
+	MAV_AUTOPILOT_ENUM_END=18, /*  | */
+} MAV_AUTOPILOT;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_MAV_TYPE
+#define HAVE_ENUM_MAV_TYPE
+typedef enum MAV_TYPE
+{
+	MAV_TYPE_GENERIC=0, /* Generic micro air vehicle. | */
+	MAV_TYPE_FIXED_WING=1, /* Fixed wing aircraft. | */
+	MAV_TYPE_QUADROTOR=2, /* Quadrotor | */
+	MAV_TYPE_COAXIAL=3, /* Coaxial helicopter | */
+	MAV_TYPE_HELICOPTER=4, /* Normal helicopter with tail rotor. | */
+	MAV_TYPE_ANTENNA_TRACKER=5, /* Ground installation | */
+	MAV_TYPE_GCS=6, /* Operator control unit / ground control station | */
+	MAV_TYPE_AIRSHIP=7, /* Airship, controlled | */
+	MAV_TYPE_FREE_BALLOON=8, /* Free balloon, uncontrolled | */
+	MAV_TYPE_ROCKET=9, /* Rocket | */
+	MAV_TYPE_GROUND_ROVER=10, /* Ground rover | */
+	MAV_TYPE_SURFACE_BOAT=11, /* Surface vessel, boat, ship | */
+	MAV_TYPE_SUBMARINE=12, /* Submarine | */
+	MAV_TYPE_HEXAROTOR=13, /* Hexarotor | */
+	MAV_TYPE_OCTOROTOR=14, /* Octorotor | */
+	MAV_TYPE_TRICOPTER=15, /* Octorotor | */
+	MAV_TYPE_FLAPPING_WING=16, /* Flapping wing | */
+	MAV_TYPE_KITE=17, /* Flapping wing | */
+	MAV_TYPE_ONBOARD_CONTROLLER=18, /* Onboard companion controller | */
+	MAV_TYPE_VTOL_DUOROTOR=19, /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */
+	MAV_TYPE_VTOL_QUADROTOR=20, /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */
+	MAV_TYPE_VTOL_TILTROTOR=21, /* Tiltrotor VTOL | */
+	MAV_TYPE_VTOL_RESERVED2=22, /* VTOL reserved 2 | */
+	MAV_TYPE_VTOL_RESERVED3=23, /* VTOL reserved 3 | */
+	MAV_TYPE_VTOL_RESERVED4=24, /* VTOL reserved 4 | */
+	MAV_TYPE_VTOL_RESERVED5=25, /* VTOL reserved 5 | */
+	MAV_TYPE_GIMBAL=26, /* Onboard gimbal | */
+	MAV_TYPE_ADSB=27, /* Onboard ADSB peripheral | */
+	MAV_TYPE_ENUM_END=28, /*  | */
+} MAV_TYPE;
+#endif
+
+/** @brief These values define the type of firmware release.  These values indicate the first version or release of this type.  For example the first alpha release would be 64, the second would be 65. */
+#ifndef HAVE_ENUM_FIRMWARE_VERSION_TYPE
+#define HAVE_ENUM_FIRMWARE_VERSION_TYPE
+typedef enum FIRMWARE_VERSION_TYPE
+{
+	FIRMWARE_VERSION_TYPE_DEV=0, /* development release | */
+	FIRMWARE_VERSION_TYPE_ALPHA=64, /* alpha release | */
+	FIRMWARE_VERSION_TYPE_BETA=128, /* beta release | */
+	FIRMWARE_VERSION_TYPE_RC=192, /* release candidate | */
+	FIRMWARE_VERSION_TYPE_OFFICIAL=255, /* official stable release | */
+	FIRMWARE_VERSION_TYPE_ENUM_END=256, /*  | */
+} FIRMWARE_VERSION_TYPE;
+#endif
+
+/** @brief These flags encode the MAV mode. */
+#ifndef HAVE_ENUM_MAV_MODE_FLAG
+#define HAVE_ENUM_MAV_MODE_FLAG
+typedef enum MAV_MODE_FLAG
+{
+	MAV_MODE_FLAG_CUSTOM_MODE_ENABLED=1, /* 0b00000001 Reserved for future use. | */
+	MAV_MODE_FLAG_TEST_ENABLED=2, /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */
+	MAV_MODE_FLAG_AUTO_ENABLED=4, /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */
+	MAV_MODE_FLAG_GUIDED_ENABLED=8, /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */
+	MAV_MODE_FLAG_STABILIZE_ENABLED=16, /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */
+	MAV_MODE_FLAG_HIL_ENABLED=32, /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */
+	MAV_MODE_FLAG_MANUAL_INPUT_ENABLED=64, /* 0b01000000 remote control input is enabled. | */
+	MAV_MODE_FLAG_SAFETY_ARMED=128, /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */
+	MAV_MODE_FLAG_ENUM_END=129, /*  | */
+} MAV_MODE_FLAG;
+#endif
+
+/** @brief These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. */
+#ifndef HAVE_ENUM_MAV_MODE_FLAG_DECODE_POSITION
+#define HAVE_ENUM_MAV_MODE_FLAG_DECODE_POSITION
+typedef enum MAV_MODE_FLAG_DECODE_POSITION
+{
+	MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE=1, /* Eighth bit: 00000001 | */
+	MAV_MODE_FLAG_DECODE_POSITION_TEST=2, /* Seventh bit: 00000010 | */
+	MAV_MODE_FLAG_DECODE_POSITION_AUTO=4, /* Sixt bit:   00000100 | */
+	MAV_MODE_FLAG_DECODE_POSITION_GUIDED=8, /* Fifth bit:  00001000 | */
+	MAV_MODE_FLAG_DECODE_POSITION_STABILIZE=16, /* Fourth bit: 00010000 | */
+	MAV_MODE_FLAG_DECODE_POSITION_HIL=32, /* Third bit:  00100000 | */
+	MAV_MODE_FLAG_DECODE_POSITION_MANUAL=64, /* Second bit: 01000000 | */
+	MAV_MODE_FLAG_DECODE_POSITION_SAFETY=128, /* First bit:  10000000 | */
+	MAV_MODE_FLAG_DECODE_POSITION_ENUM_END=129, /*  | */
+} MAV_MODE_FLAG_DECODE_POSITION;
+#endif
+
+/** @brief Override command, pauses current mission execution and moves immediately to a position */
+#ifndef HAVE_ENUM_MAV_GOTO
+#define HAVE_ENUM_MAV_GOTO
+typedef enum MAV_GOTO
+{
+	MAV_GOTO_DO_HOLD=0, /* Hold at the current position. | */
+	MAV_GOTO_DO_CONTINUE=1, /* Continue with the next item in mission execution. | */
+	MAV_GOTO_HOLD_AT_CURRENT_POSITION=2, /* Hold at the current position of the system | */
+	MAV_GOTO_HOLD_AT_SPECIFIED_POSITION=3, /* Hold at the position specified in the parameters of the DO_HOLD action | */
+	MAV_GOTO_ENUM_END=4, /*  | */
+} MAV_GOTO;
+#endif
+
+/** @brief These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it
+               simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. */
+#ifndef HAVE_ENUM_MAV_MODE
+#define HAVE_ENUM_MAV_MODE
+typedef enum MAV_MODE
+{
+	MAV_MODE_PREFLIGHT=0, /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */
+	MAV_MODE_MANUAL_DISARMED=64, /* System is allowed to be active, under manual (RC) control, no stabilization | */
+	MAV_MODE_TEST_DISARMED=66, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */
+	MAV_MODE_STABILIZE_DISARMED=80, /* System is allowed to be active, under assisted RC control. | */
+	MAV_MODE_GUIDED_DISARMED=88, /* System is allowed to be active, under autonomous control, manual setpoint | */
+	MAV_MODE_AUTO_DISARMED=92, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */
+	MAV_MODE_MANUAL_ARMED=192, /* System is allowed to be active, under manual (RC) control, no stabilization | */
+	MAV_MODE_TEST_ARMED=194, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */
+	MAV_MODE_STABILIZE_ARMED=208, /* System is allowed to be active, under assisted RC control. | */
+	MAV_MODE_GUIDED_ARMED=216, /* System is allowed to be active, under autonomous control, manual setpoint | */
+	MAV_MODE_AUTO_ARMED=220, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */
+	MAV_MODE_ENUM_END=221, /*  | */
+} MAV_MODE;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_MAV_STATE
+#define HAVE_ENUM_MAV_STATE
+typedef enum MAV_STATE
+{
+	MAV_STATE_UNINIT=0, /* Uninitialized system, state is unknown. | */
+	MAV_STATE_BOOT=1, /* System is booting up. | */
+	MAV_STATE_CALIBRATING=2, /* System is calibrating and not flight-ready. | */
+	MAV_STATE_STANDBY=3, /* System is grounded and on standby. It can be launched any time. | */
+	MAV_STATE_ACTIVE=4, /* System is active and might be already airborne. Motors are engaged. | */
+	MAV_STATE_CRITICAL=5, /* System is in a non-normal flight mode. It can however still navigate. | */
+	MAV_STATE_EMERGENCY=6, /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */
+	MAV_STATE_POWEROFF=7, /* System just initialized its power-down sequence, will shut down now. | */
+	MAV_STATE_ENUM_END=8, /*  | */
+} MAV_STATE;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_MAV_COMPONENT
+#define HAVE_ENUM_MAV_COMPONENT
+typedef enum MAV_COMPONENT
+{
+	MAV_COMP_ID_ALL=0, /*  | */
+	MAV_COMP_ID_CAMERA=100, /*  | */
+	MAV_COMP_ID_SERVO1=140, /*  | */
+	MAV_COMP_ID_SERVO2=141, /*  | */
+	MAV_COMP_ID_SERVO3=142, /*  | */
+	MAV_COMP_ID_SERVO4=143, /*  | */
+	MAV_COMP_ID_SERVO5=144, /*  | */
+	MAV_COMP_ID_SERVO6=145, /*  | */
+	MAV_COMP_ID_SERVO7=146, /*  | */
+	MAV_COMP_ID_SERVO8=147, /*  | */
+	MAV_COMP_ID_SERVO9=148, /*  | */
+	MAV_COMP_ID_SERVO10=149, /*  | */
+	MAV_COMP_ID_SERVO11=150, /*  | */
+	MAV_COMP_ID_SERVO12=151, /*  | */
+	MAV_COMP_ID_SERVO13=152, /*  | */
+	MAV_COMP_ID_SERVO14=153, /*  | */
+	MAV_COMP_ID_GIMBAL=154, /*  | */
+	MAV_COMP_ID_LOG=155, /*  | */
+	MAV_COMP_ID_ADSB=156, /*  | */
+	MAV_COMP_ID_OSD=157, /* On Screen Display (OSD) devices for video links | */
+	MAV_COMP_ID_PERIPHERAL=158, /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol | */
+	MAV_COMP_ID_MAPPER=180, /*  | */
+	MAV_COMP_ID_MISSIONPLANNER=190, /*  | */
+	MAV_COMP_ID_PATHPLANNER=195, /*  | */
+	MAV_COMP_ID_IMU=200, /*  | */
+	MAV_COMP_ID_IMU_2=201, /*  | */
+	MAV_COMP_ID_IMU_3=202, /*  | */
+	MAV_COMP_ID_GPS=220, /*  | */
+	MAV_COMP_ID_UDP_BRIDGE=240, /*  | */
+	MAV_COMP_ID_UART_BRIDGE=241, /*  | */
+	MAV_COMP_ID_SYSTEM_CONTROL=250, /*  | */
+	MAV_COMPONENT_ENUM_END=251, /*  | */
+} MAV_COMPONENT;
+#endif
+
+/** @brief These encode the sensors whose status is sent as part of the SYS_STATUS message. */
+#ifndef HAVE_ENUM_MAV_SYS_STATUS_SENSOR
+#define HAVE_ENUM_MAV_SYS_STATUS_SENSOR
+typedef enum MAV_SYS_STATUS_SENSOR
+{
+	MAV_SYS_STATUS_SENSOR_3D_GYRO=1, /* 0x01 3D gyro | */
+	MAV_SYS_STATUS_SENSOR_3D_ACCEL=2, /* 0x02 3D accelerometer | */
+	MAV_SYS_STATUS_SENSOR_3D_MAG=4, /* 0x04 3D magnetometer | */
+	MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE=8, /* 0x08 absolute pressure | */
+	MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE=16, /* 0x10 differential pressure | */
+	MAV_SYS_STATUS_SENSOR_GPS=32, /* 0x20 GPS | */
+	MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW=64, /* 0x40 optical flow | */
+	MAV_SYS_STATUS_SENSOR_VISION_POSITION=128, /* 0x80 computer vision position | */
+	MAV_SYS_STATUS_SENSOR_LASER_POSITION=256, /* 0x100 laser based position | */
+	MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH=512, /* 0x200 external ground truth (Vicon or Leica) | */
+	MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL=1024, /* 0x400 3D angular rate control | */
+	MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION=2048, /* 0x800 attitude stabilization | */
+	MAV_SYS_STATUS_SENSOR_YAW_POSITION=4096, /* 0x1000 yaw position | */
+	MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL=8192, /* 0x2000 z/altitude control | */
+	MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL=16384, /* 0x4000 x/y position control | */
+	MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS=32768, /* 0x8000 motor outputs / control | */
+	MAV_SYS_STATUS_SENSOR_RC_RECEIVER=65536, /* 0x10000 rc receiver | */
+	MAV_SYS_STATUS_SENSOR_3D_GYRO2=131072, /* 0x20000 2nd 3D gyro | */
+	MAV_SYS_STATUS_SENSOR_3D_ACCEL2=262144, /* 0x40000 2nd 3D accelerometer | */
+	MAV_SYS_STATUS_SENSOR_3D_MAG2=524288, /* 0x80000 2nd 3D magnetometer | */
+	MAV_SYS_STATUS_GEOFENCE=1048576, /* 0x100000 geofence | */
+	MAV_SYS_STATUS_AHRS=2097152, /* 0x200000 AHRS subsystem health | */
+	MAV_SYS_STATUS_TERRAIN=4194304, /* 0x400000 Terrain subsystem health | */
+	MAV_SYS_STATUS_REVERSE_MOTOR=8388608, /* 0x800000 Motors are reversed | */
+	MAV_SYS_STATUS_SENSOR_ENUM_END=8388609, /*  | */
+} MAV_SYS_STATUS_SENSOR;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_MAV_FRAME
+#define HAVE_ENUM_MAV_FRAME
+typedef enum MAV_FRAME
+{
+	MAV_FRAME_GLOBAL=0, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */
+	MAV_FRAME_LOCAL_NED=1, /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */
+	MAV_FRAME_MISSION=2, /* NOT a coordinate frame, indicates a mission command. | */
+	MAV_FRAME_GLOBAL_RELATIVE_ALT=3, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */
+	MAV_FRAME_LOCAL_ENU=4, /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */
+	MAV_FRAME_GLOBAL_INT=5, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) | */
+	MAV_FRAME_GLOBAL_RELATIVE_ALT_INT=6, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */
+	MAV_FRAME_LOCAL_OFFSET_NED=7, /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */
+	MAV_FRAME_BODY_NED=8, /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */
+	MAV_FRAME_BODY_OFFSET_NED=9, /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */
+	MAV_FRAME_GLOBAL_TERRAIN_ALT=10, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */
+	MAV_FRAME_GLOBAL_TERRAIN_ALT_INT=11, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */
+	MAV_FRAME_ENUM_END=12, /*  | */
+} MAV_FRAME;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_MAVLINK_DATA_STREAM_TYPE
+#define HAVE_ENUM_MAVLINK_DATA_STREAM_TYPE
+typedef enum MAVLINK_DATA_STREAM_TYPE
+{
+	MAVLINK_DATA_STREAM_IMG_JPEG=1, /*  | */
+	MAVLINK_DATA_STREAM_IMG_BMP=2, /*  | */
+	MAVLINK_DATA_STREAM_IMG_RAW8U=3, /*  | */
+	MAVLINK_DATA_STREAM_IMG_RAW32U=4, /*  | */
+	MAVLINK_DATA_STREAM_IMG_PGM=5, /*  | */
+	MAVLINK_DATA_STREAM_IMG_PNG=6, /*  | */
+	MAVLINK_DATA_STREAM_TYPE_ENUM_END=7, /*  | */
+} MAVLINK_DATA_STREAM_TYPE;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_FENCE_ACTION
+#define HAVE_ENUM_FENCE_ACTION
+typedef enum FENCE_ACTION
+{
+	FENCE_ACTION_NONE=0, /* Disable fenced mode | */
+	FENCE_ACTION_GUIDED=1, /* Switched to guided mode to return point (fence point 0) | */
+	FENCE_ACTION_REPORT=2, /* Report fence breach, but don't take action | */
+	FENCE_ACTION_GUIDED_THR_PASS=3, /* Switched to guided mode to return point (fence point 0) with manual throttle control | */
+	FENCE_ACTION_ENUM_END=4, /*  | */
+} FENCE_ACTION;
+#endif
+
+/** @brief  */
+#ifndef HAVE_ENUM_FENCE_BREACH
+#define HAVE_ENUM_FENCE_BREACH
+typedef enum FENCE_BREACH
+{
+	FENCE_BREACH_NONE=0, /* No last fence breach | */
+	FENCE_BREACH_MINALT=1, /* Breached minimum altitude | */
+	FENCE_BREACH_MAXALT=2, /* Breached maximum altitude | */
+	FENCE_BREACH_BOUNDARY=3, /* Breached fence boundary | */
+	FENCE_BREACH_ENUM_END=4, /*  | */
+} FENCE_BREACH;
+#endif
+
+/** @brief Enumeration of possible mount operation modes */
+#ifndef HAVE_ENUM_MAV_MOUNT_MODE
+#define HAVE_ENUM_MAV_MOUNT_MODE
+typedef enum MAV_MOUNT_MODE
+{
+	MAV_MOUNT_MODE_RETRACT=0, /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */
+	MAV_MOUNT_MODE_NEUTRAL=1, /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */
+	MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */
+	MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */
+	MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */
+	MAV_MOUNT_MODE_ENUM_END=5, /*  | */
+} MAV_MOUNT_MODE;
+#endif
+
+/** @brief Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. */
+#ifndef HAVE_ENUM_MAV_CMD
+#define HAVE_ENUM_MAV_CMD
+typedef enum MAV_CMD
+{
+	MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_NAV_LAND=21, /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]|  */
+	MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]|  */
+	MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude.  When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters|  */
+	MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude.  If Lat=Lon=0, then loiter at the current position.  Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached.  Additionally, if the Heading Required parameter is non-zero the  aircraft will not leave the loiter until heading toward the next waypoint.  |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude|  */
+	MAV_CMD_DO_FOLLOW=32, /* Being following a target |System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode| RESERVED| RESERVED| altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home| altitude| RESERVED| TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout|  */
+	MAV_CMD_DO_FOLLOW_REPOSITION=33, /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target (m)| X offset from target (m)| Y offset from target (m)|  */
+	MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z|  */
+	MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal|  */
+	MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal|  */
+	MAV_CMD_NAV_VTOL_TAKEOFF=84, /* Takeoff from ground using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_VTOL_LAND=85, /* Land using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude|  */
+	MAV_CMD_NAV_GUIDED_ENABLE=92, /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_NAV_DELAY=93, /* Delay the next navigation command a number of seconds or until a specified time |Delay in seconds (decimal, -1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty|  */
+	MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate.  Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude|  */
+	MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty|  */
+	MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list.  Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed  (m/s, -1 indicates no change)| Throttle  ( Percent, -1 indicates no change)| absolute or relative [0,1]| Empty| Empty| Empty|  */
+	MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude|  */
+	MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter.  Caution!  Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty|  */
+	MAV_CMD_DO_FLIGHTTERMINATION=185, /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty|  */
+	MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_REPOSITION=192, /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum.| Reserved| Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)|  */
+	MAV_CMD_DO_PAUSE_CONTINUE=193, /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved|  */
+	MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty|  */
+	MAV_CMD_DO_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z|  */
+	MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)|  */
+	MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty|  */
+	MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty|  */
+	MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value|  */
+	MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_FENCE_ENABLE=207, /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_PARACHUTE=208, /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty|  */
+	MAV_CMD_DO_GUIDED_MASTER=221, /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_DO_GUIDED_LIMITS=222, /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue.  0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue.  0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty|  */
+	MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty|  */
+	MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty|  */
+	MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units|  */
+	MAV_CMD_PREFLIGHT_UAVCAN=243, /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved|  */
+	MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty|  */
+	MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0|  */
+	MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position|  */
+	MAV_CMD_MISSION_START=300, /* start running a mission |first_item: the first mission item to run| last_item:  the last mission item to run (after this item is run, the mission ends)|  */
+	MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm|  */
+	MAV_CMD_GET_HOME_POSITION=410, /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved|  */
+	MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX|  */
+	MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID|  */
+	MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.|  */
+	MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)|  */
+	MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)|  */
+	MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence |Reserved| Reserved|  */
+	MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start)| Shutter integration time (in ms)| Reserved|  */
+	MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)|  */
+	MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture |Reserved| Reserved|  */
+	MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)|  */
+	MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.|  */
+	MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL|  */
+	MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved|  */
+	MAV_CMD_WAYPOINT_USER_1=31000, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_WAYPOINT_USER_2=31001, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_WAYPOINT_USER_3=31002, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_WAYPOINT_USER_4=31003, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_WAYPOINT_USER_5=31004, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_SPATIAL_USER_1=31005, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_SPATIAL_USER_2=31006, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_SPATIAL_USER_3=31007, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_SPATIAL_USER_4=31008, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_SPATIAL_USER_5=31009, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL|  */
+	MAV_CMD_USER_1=31010, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined|  */
+	MAV_CMD_USER_2=31011, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined|  */
+	MAV_CMD_USER_3=31012, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined|  */
+	MAV_CMD_USER_4=31013, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined|  */
+	MAV_CMD_USER_5=31014, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined|  */
+	MAV_CMD_ENUM_END=31015, /*  | */
+} MAV_CMD;
+#endif
+
+/** @brief THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a
+     recommendation to the autopilot software. Individual autopilots may or may not obey
+     the recommended messages. */
+#ifndef HAVE_ENUM_MAV_DATA_STREAM
+#define HAVE_ENUM_MAV_DATA_STREAM
+typedef enum MAV_DATA_STREAM
+{
+	MAV_DATA_STREAM_ALL=0, /* Enable all data streams | */
+	MAV_DATA_STREAM_RAW_SENSORS=1, /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */
+	MAV_DATA_STREAM_EXTENDED_STATUS=2, /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */
+	MAV_DATA_STREAM_RC_CHANNELS=3, /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */
+	MAV_DATA_STREAM_RAW_CONTROLLER=4, /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */
+	MAV_DATA_STREAM_POSITION=6, /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */
+	MAV_DATA_STREAM_EXTRA1=10, /* Dependent on the autopilot | */
+	MAV_DATA_STREAM_EXTRA2=11, /* Dependent on the autopilot | */
+	MAV_DATA_STREAM_EXTRA3=12, /* Dependent on the autopilot | */
+	MAV_DATA_STREAM_ENUM_END=13, /*  | */
+} MAV_DATA_STREAM;
+#endif
+
+/** @brief  The ROI (region of interest) for the vehicle. This can be
+                be used by the vehicle for camera/vehicle attitude alignment (see
+                MAV_CMD_NAV_ROI). */
+#ifndef HAVE_ENUM_MAV_ROI
+#define HAVE_ENUM_MAV_ROI
+typedef enum MAV_ROI
+{
+	MAV_ROI_NONE=0, /* No region of interest. | */
+	MAV_ROI_WPNEXT=1, /* Point toward next MISSION. | */
+	MAV_ROI_WPINDEX=2, /* Point toward given MISSION. | */
+	MAV_ROI_LOCATION=3, /* Point toward fixed location. | */
+	MAV_ROI_TARGET=4, /* Point toward of given id. | */
+	MAV_ROI_ENUM_END=5, /*  | */
+} MAV_ROI;
+#endif
+
+/** @brief ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. */
+#ifndef HAVE_ENUM_MAV_CMD_ACK
+#define HAVE_ENUM_MAV_CMD_ACK
+typedef enum MAV_CMD_ACK
+{
+	MAV_CMD_ACK_OK=1, /* Command / mission item is ok. | */
+	MAV_CMD_ACK_ERR_FAIL=2, /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */
+	MAV_CMD_ACK_ERR_ACCESS_DENIED=3, /* The system is refusing to accept this command from this source / communication partner. | */
+	MAV_CMD_ACK_ERR_NOT_SUPPORTED=4, /* Command or mission item is not supported, other commands would be accepted. | */
+	MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED=5, /* The coordinate frame of this command / mission item is not supported. | */
+	MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE=6, /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */
+	MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE=7, /* The X or latitude value is out of range. | */
+	MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE=8, /* The Y or longitude value is out of range. | */
+	MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE=9, /* The Z or altitude value is out of range. | */
+	MAV_CMD_ACK_ENUM_END=10, /*  | */
+} MAV_CMD_ACK;
+#endif
+
+/** @brief Specifies the datatype of a MAVLink parameter. */
+#ifndef HAVE_ENUM_MAV_PARAM_TYPE
+#define HAVE_ENUM_MAV_PARAM_TYPE
+typedef enum MAV_PARAM_TYPE
+{
+	MAV_PARAM_TYPE_UINT8=1, /* 8-bit unsigned integer | */
+	MAV_PARAM_TYPE_INT8=2, /* 8-bit signed integer | */
+	MAV_PARAM_TYPE_UINT16=3, /* 16-bit unsigned integer | */
+	MAV_PARAM_TYPE_INT16=4, /* 16-bit signed integer | */
+	MAV_PARAM_TYPE_UINT32=5, /* 32-bit unsigned integer | */
+	MAV_PARAM_TYPE_INT32=6, /* 32-bit signed integer | */
+	MAV_PARAM_TYPE_UINT64=7, /* 64-bit unsigned integer | */
+	MAV_PARAM_TYPE_INT64=8, /* 64-bit signed integer | */
+	MAV_PARAM_TYPE_REAL32=9, /* 32-bit floating-point | */
+	MAV_PARAM_TYPE_REAL64=10, /* 64-bit floating-point | */
+	MAV_PARAM_TYPE_ENUM_END=11, /*  | */
+} MAV_PARAM_TYPE;
+#endif
+
+/** @brief result from a mavlink command */
+#ifndef HAVE_ENUM_MAV_RESULT
+#define HAVE_ENUM_MAV_RESULT
+typedef enum MAV_RESULT
+{
+	MAV_RESULT_ACCEPTED=0, /* Command ACCEPTED and EXECUTED | */
+	MAV_RESULT_TEMPORARILY_REJECTED=1, /* Command TEMPORARY REJECTED/DENIED | */
+	MAV_RESULT_DENIED=2, /* Command PERMANENTLY DENIED | */
+	MAV_RESULT_UNSUPPORTED=3, /* Command UNKNOWN/UNSUPPORTED | */
+	MAV_RESULT_FAILED=4, /* Command executed, but failed | */
+	MAV_RESULT_ENUM_END=5, /*  | */
+} MAV_RESULT;
+#endif
+
+/** @brief result in a mavlink mission ack */
+#ifndef HAVE_ENUM_MAV_MISSION_RESULT
+#define HAVE_ENUM_MAV_MISSION_RESULT
+typedef enum MAV_MISSION_RESULT
+{
+	MAV_MISSION_ACCEPTED=0, /* mission accepted OK | */
+	MAV_MISSION_ERROR=1, /* generic error / not accepting mission commands at all right now | */
+	MAV_MISSION_UNSUPPORTED_FRAME=2, /* coordinate frame is not supported | */
+	MAV_MISSION_UNSUPPORTED=3, /* command is not supported | */
+	MAV_MISSION_NO_SPACE=4, /* mission item exceeds storage space | */
+	MAV_MISSION_INVALID=5, /* one of the parameters has an invalid value | */
+	MAV_MISSION_INVALID_PARAM1=6, /* param1 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM2=7, /* param2 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM3=8, /* param3 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM4=9, /* param4 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM5_X=10, /* x/param5 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM6_Y=11, /* y/param6 has an invalid value | */
+	MAV_MISSION_INVALID_PARAM7=12, /* param7 has an invalid value | */
+	MAV_MISSION_INVALID_SEQUENCE=13, /* received waypoint out of sequence | */
+	MAV_MISSION_DENIED=14, /* not accepting any mission commands from this communication partner | */
+	MAV_MISSION_RESULT_ENUM_END=15, /*  | */
+} MAV_MISSION_RESULT;
+#endif
+
+/** @brief Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. */
+#ifndef HAVE_ENUM_MAV_SEVERITY
+#define HAVE_ENUM_MAV_SEVERITY
+typedef enum MAV_SEVERITY
+{
+	MAV_SEVERITY_EMERGENCY=0, /* System is unusable. This is a "panic" condition. | */
+	MAV_SEVERITY_ALERT=1, /* Action should be taken immediately. Indicates error in non-critical systems. | */
+	MAV_SEVERITY_CRITICAL=2, /* Action must be taken immediately. Indicates failure in a primary system. | */
+	MAV_SEVERITY_ERROR=3, /* Indicates an error in secondary/redundant systems. | */
+	MAV_SEVERITY_WARNING=4, /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */
+	MAV_SEVERITY_NOTICE=5, /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */
+	MAV_SEVERITY_INFO=6, /* Normal operational messages. Useful for logging. No action is required for these messages. | */
+	MAV_SEVERITY_DEBUG=7, /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */
+	MAV_SEVERITY_ENUM_END=8, /*  | */
+} MAV_SEVERITY;
+#endif
+
+/** @brief Power supply status flags (bitmask) */
+#ifndef HAVE_ENUM_MAV_POWER_STATUS
+#define HAVE_ENUM_MAV_POWER_STATUS
+typedef enum MAV_POWER_STATUS
+{
+	MAV_POWER_STATUS_BRICK_VALID=1, /* main brick power supply valid | */
+	MAV_POWER_STATUS_SERVO_VALID=2, /* main servo power supply valid for FMU | */
+	MAV_POWER_STATUS_USB_CONNECTED=4, /* USB power is connected | */
+	MAV_POWER_STATUS_PERIPH_OVERCURRENT=8, /* peripheral supply is in over-current state | */
+	MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT=16, /* hi-power peripheral supply is in over-current state | */
+	MAV_POWER_STATUS_CHANGED=32, /* Power status has changed since boot | */
+	MAV_POWER_STATUS_ENUM_END=33, /*  | */
+} MAV_POWER_STATUS;
+#endif
+
+/** @brief SERIAL_CONTROL device types */
+#ifndef HAVE_ENUM_SERIAL_CONTROL_DEV
+#define HAVE_ENUM_SERIAL_CONTROL_DEV
+typedef enum SERIAL_CONTROL_DEV
+{
+	SERIAL_CONTROL_DEV_TELEM1=0, /* First telemetry port | */
+	SERIAL_CONTROL_DEV_TELEM2=1, /* Second telemetry port | */
+	SERIAL_CONTROL_DEV_GPS1=2, /* First GPS port | */
+	SERIAL_CONTROL_DEV_GPS2=3, /* Second GPS port | */
+	SERIAL_CONTROL_DEV_SHELL=10, /* system shell | */
+	SERIAL_CONTROL_DEV_ENUM_END=11, /*  | */
+} SERIAL_CONTROL_DEV;
+#endif
+
+/** @brief SERIAL_CONTROL flags (bitmask) */
+#ifndef HAVE_ENUM_SERIAL_CONTROL_FLAG
+#define HAVE_ENUM_SERIAL_CONTROL_FLAG
+typedef enum SERIAL_CONTROL_FLAG
+{
+	SERIAL_CONTROL_FLAG_REPLY=1, /* Set if this is a reply | */
+	SERIAL_CONTROL_FLAG_RESPOND=2, /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */
+	SERIAL_CONTROL_FLAG_EXCLUSIVE=4, /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */
+	SERIAL_CONTROL_FLAG_BLOCKING=8, /* Block on writes to the serial port | */
+	SERIAL_CONTROL_FLAG_MULTI=16, /* Send multiple replies until port is drained | */
+	SERIAL_CONTROL_FLAG_ENUM_END=17, /*  | */
+} SERIAL_CONTROL_FLAG;
+#endif
+
+/** @brief Enumeration of distance sensor types */
+#ifndef HAVE_ENUM_MAV_DISTANCE_SENSOR
+#define HAVE_ENUM_MAV_DISTANCE_SENSOR
+typedef enum MAV_DISTANCE_SENSOR
+{
+	MAV_DISTANCE_SENSOR_LASER=0, /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */
+	MAV_DISTANCE_SENSOR_ULTRASOUND=1, /* Ultrasound rangefinder, e.g. MaxBotix units | */
+	MAV_DISTANCE_SENSOR_INFRARED=2, /* Infrared rangefinder, e.g. Sharp units | */
+	MAV_DISTANCE_SENSOR_ENUM_END=3, /*  | */
+} MAV_DISTANCE_SENSOR;
+#endif
+
+/** @brief Enumeration of sensor orientation, according to its rotations */
+#ifndef HAVE_ENUM_MAV_SENSOR_ORIENTATION
+#define HAVE_ENUM_MAV_SENSOR_ORIENTATION
+typedef enum MAV_SENSOR_ORIENTATION
+{
+	MAV_SENSOR_ROTATION_NONE=0, /* Roll: 0, Pitch: 0, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_YAW_45=1, /* Roll: 0, Pitch: 0, Yaw: 45 | */
+	MAV_SENSOR_ROTATION_YAW_90=2, /* Roll: 0, Pitch: 0, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_YAW_135=3, /* Roll: 0, Pitch: 0, Yaw: 135 | */
+	MAV_SENSOR_ROTATION_YAW_180=4, /* Roll: 0, Pitch: 0, Yaw: 180 | */
+	MAV_SENSOR_ROTATION_YAW_225=5, /* Roll: 0, Pitch: 0, Yaw: 225 | */
+	MAV_SENSOR_ROTATION_YAW_270=6, /* Roll: 0, Pitch: 0, Yaw: 270 | */
+	MAV_SENSOR_ROTATION_YAW_315=7, /* Roll: 0, Pitch: 0, Yaw: 315 | */
+	MAV_SENSOR_ROTATION_ROLL_180=8, /* Roll: 180, Pitch: 0, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_45=9, /* Roll: 180, Pitch: 0, Yaw: 45 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_90=10, /* Roll: 180, Pitch: 0, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_135=11, /* Roll: 180, Pitch: 0, Yaw: 135 | */
+	MAV_SENSOR_ROTATION_PITCH_180=12, /* Roll: 0, Pitch: 180, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_225=13, /* Roll: 180, Pitch: 0, Yaw: 225 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_270=14, /* Roll: 180, Pitch: 0, Yaw: 270 | */
+	MAV_SENSOR_ROTATION_ROLL_180_YAW_315=15, /* Roll: 180, Pitch: 0, Yaw: 315 | */
+	MAV_SENSOR_ROTATION_ROLL_90=16, /* Roll: 90, Pitch: 0, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_90_YAW_45=17, /* Roll: 90, Pitch: 0, Yaw: 45 | */
+	MAV_SENSOR_ROTATION_ROLL_90_YAW_90=18, /* Roll: 90, Pitch: 0, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_ROLL_90_YAW_135=19, /* Roll: 90, Pitch: 0, Yaw: 135 | */
+	MAV_SENSOR_ROTATION_ROLL_270=20, /* Roll: 270, Pitch: 0, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_270_YAW_45=21, /* Roll: 270, Pitch: 0, Yaw: 45 | */
+	MAV_SENSOR_ROTATION_ROLL_270_YAW_90=22, /* Roll: 270, Pitch: 0, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_ROLL_270_YAW_135=23, /* Roll: 270, Pitch: 0, Yaw: 135 | */
+	MAV_SENSOR_ROTATION_PITCH_90=24, /* Roll: 0, Pitch: 90, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_PITCH_270=25, /* Roll: 0, Pitch: 270, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_PITCH_180_YAW_90=26, /* Roll: 0, Pitch: 180, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_PITCH_180_YAW_270=27, /* Roll: 0, Pitch: 180, Yaw: 270 | */
+	MAV_SENSOR_ROTATION_ROLL_90_PITCH_90=28, /* Roll: 90, Pitch: 90, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_180_PITCH_90=29, /* Roll: 180, Pitch: 90, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_270_PITCH_90=30, /* Roll: 270, Pitch: 90, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_90_PITCH_180=31, /* Roll: 90, Pitch: 180, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_270_PITCH_180=32, /* Roll: 270, Pitch: 180, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_90_PITCH_270=33, /* Roll: 90, Pitch: 270, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_180_PITCH_270=34, /* Roll: 180, Pitch: 270, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_270_PITCH_270=35, /* Roll: 270, Pitch: 270, Yaw: 0 | */
+	MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90=36, /* Roll: 90, Pitch: 180, Yaw: 90 | */
+	MAV_SENSOR_ROTATION_ROLL_90_YAW_270=37, /* Roll: 90, Pitch: 0, Yaw: 270 | */
+	MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315=38, /* Roll: 315, Pitch: 315, Yaw: 315 | */
+	MAV_SENSOR_ORIENTATION_ENUM_END=39, /*  | */
+} MAV_SENSOR_ORIENTATION;
+#endif
+
+/** @brief Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. */
+#ifndef HAVE_ENUM_MAV_PROTOCOL_CAPABILITY
+#define HAVE_ENUM_MAV_PROTOCOL_CAPABILITY
+typedef enum MAV_PROTOCOL_CAPABILITY
+{
+	MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT=1, /* Autopilot supports MISSION float message type. | */
+	MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT=2, /* Autopilot supports the new param float message type. | */
+	MAV_PROTOCOL_CAPABILITY_MISSION_INT=4, /* Autopilot supports MISSION_INT scaled integer message type. | */
+	MAV_PROTOCOL_CAPABILITY_COMMAND_INT=8, /* Autopilot supports COMMAND_INT scaled integer message type. | */
+	MAV_PROTOCOL_CAPABILITY_PARAM_UNION=16, /* Autopilot supports the new param union message type. | */
+	MAV_PROTOCOL_CAPABILITY_FTP=32, /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */
+	MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET=64, /* Autopilot supports commanding attitude offboard. | */
+	MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED=128, /* Autopilot supports commanding position and velocity targets in local NED frame. | */
+	MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT=256, /* Autopilot supports commanding position and velocity targets in global scaled integers. | */
+	MAV_PROTOCOL_CAPABILITY_TERRAIN=512, /* Autopilot supports terrain protocol / data handling. | */
+	MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET=1024, /* Autopilot supports direct actuator control. | */
+	MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION=2048, /* Autopilot supports the flight termination command. | */
+	MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION=4096, /* Autopilot supports onboard compass calibration. | */
+	MAV_PROTOCOL_CAPABILITY_ENUM_END=4097, /*  | */
+} MAV_PROTOCOL_CAPABILITY;
+#endif
+
+/** @brief Enumeration of estimator types */
+#ifndef HAVE_ENUM_MAV_ESTIMATOR_TYPE
+#define HAVE_ENUM_MAV_ESTIMATOR_TYPE
+typedef enum MAV_ESTIMATOR_TYPE
+{
+	MAV_ESTIMATOR_TYPE_NAIVE=1, /* This is a naive estimator without any real covariance feedback. | */
+	MAV_ESTIMATOR_TYPE_VISION=2, /* Computer vision based estimate. Might be up to scale. | */
+	MAV_ESTIMATOR_TYPE_VIO=3, /* Visual-inertial estimate. | */
+	MAV_ESTIMATOR_TYPE_GPS=4, /* Plain GPS estimate. | */
+	MAV_ESTIMATOR_TYPE_GPS_INS=5, /* Estimator integrating GPS and inertial sensing. | */
+	MAV_ESTIMATOR_TYPE_ENUM_END=6, /*  | */
+} MAV_ESTIMATOR_TYPE;
+#endif
+
+/** @brief Enumeration of battery types */
+#ifndef HAVE_ENUM_MAV_BATTERY_TYPE
+#define HAVE_ENUM_MAV_BATTERY_TYPE
+typedef enum MAV_BATTERY_TYPE
+{
+	MAV_BATTERY_TYPE_UNKNOWN=0, /* Not specified. | */
+	MAV_BATTERY_TYPE_LIPO=1, /* Lithium polymer battery | */
+	MAV_BATTERY_TYPE_LIFE=2, /* Lithium-iron-phosphate battery | */
+	MAV_BATTERY_TYPE_LION=3, /* Lithium-ION battery | */
+	MAV_BATTERY_TYPE_NIMH=4, /* Nickel metal hydride battery | */
+	MAV_BATTERY_TYPE_ENUM_END=5, /*  | */
+} MAV_BATTERY_TYPE;
+#endif
+
+/** @brief Enumeration of battery functions */
+#ifndef HAVE_ENUM_MAV_BATTERY_FUNCTION
+#define HAVE_ENUM_MAV_BATTERY_FUNCTION
+typedef enum MAV_BATTERY_FUNCTION
+{
+	MAV_BATTERY_FUNCTION_UNKNOWN=0, /* Battery function is unknown | */
+	MAV_BATTERY_FUNCTION_ALL=1, /* Battery supports all flight systems | */
+	MAV_BATTERY_FUNCTION_PROPULSION=2, /* Battery for the propulsion system | */
+	MAV_BATTERY_FUNCTION_AVIONICS=3, /* Avionics battery | */
+	MAV_BATTERY_TYPE_PAYLOAD=4, /* Payload battery | */
+	MAV_BATTERY_FUNCTION_ENUM_END=5, /*  | */
+} MAV_BATTERY_FUNCTION;
+#endif
+
+/** @brief Enumeration of VTOL states */
+#ifndef HAVE_ENUM_MAV_VTOL_STATE
+#define HAVE_ENUM_MAV_VTOL_STATE
+typedef enum MAV_VTOL_STATE
+{
+	MAV_VTOL_STATE_UNDEFINED=0, /* MAV is not configured as VTOL | */
+	MAV_VTOL_STATE_TRANSITION_TO_FW=1, /* VTOL is in transition from multicopter to fixed-wing | */
+	MAV_VTOL_STATE_TRANSITION_TO_MC=2, /* VTOL is in transition from fixed-wing to multicopter | */
+	MAV_VTOL_STATE_MC=3, /* VTOL is in multicopter state | */
+	MAV_VTOL_STATE_FW=4, /* VTOL is in fixed-wing state | */
+	MAV_VTOL_STATE_ENUM_END=5, /*  | */
+} MAV_VTOL_STATE;
+#endif
+
+/** @brief Enumeration of landed detector states */
+#ifndef HAVE_ENUM_MAV_LANDED_STATE
+#define HAVE_ENUM_MAV_LANDED_STATE
+typedef enum MAV_LANDED_STATE
+{
+	MAV_LANDED_STATE_UNDEFINED=0, /* MAV landed state is unknown | */
+	MAV_LANDED_STATE_ON_GROUND=1, /* MAV is landed (on ground) | */
+	MAV_LANDED_STATE_IN_AIR=2, /* MAV is in air | */
+	MAV_LANDED_STATE_ENUM_END=3, /*  | */
+} MAV_LANDED_STATE;
+#endif
+
+/** @brief Enumeration of the ADSB altimeter types */
+#ifndef HAVE_ENUM_ADSB_ALTITUDE_TYPE
+#define HAVE_ENUM_ADSB_ALTITUDE_TYPE
+typedef enum ADSB_ALTITUDE_TYPE
+{
+	ADSB_ALTITUDE_TYPE_PRESSURE_QNH=0, /* Altitude reported from a Baro source using QNH reference | */
+	ADSB_ALTITUDE_TYPE_GEOMETRIC=1, /* Altitude reported from a GNSS source | */
+	ADSB_ALTITUDE_TYPE_ENUM_END=2, /*  | */
+} ADSB_ALTITUDE_TYPE;
+#endif
+
+/** @brief ADSB classification for the type of vehicle emitting the transponder signal */
+#ifndef HAVE_ENUM_ADSB_EMITTER_TYPE
+#define HAVE_ENUM_ADSB_EMITTER_TYPE
+typedef enum ADSB_EMITTER_TYPE
+{
+	ADSB_EMITTER_TYPE_NO_INFO=0, /*  | */
+	ADSB_EMITTER_TYPE_LIGHT=1, /*  | */
+	ADSB_EMITTER_TYPE_SMALL=2, /*  | */
+	ADSB_EMITTER_TYPE_LARGE=3, /*  | */
+	ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE=4, /*  | */
+	ADSB_EMITTER_TYPE_HEAVY=5, /*  | */
+	ADSB_EMITTER_TYPE_HIGHLY_MANUV=6, /*  | */
+	ADSB_EMITTER_TYPE_ROTOCRAFT=7, /*  | */
+	ADSB_EMITTER_TYPE_UNASSIGNED=8, /*  | */
+	ADSB_EMITTER_TYPE_GLIDER=9, /*  | */
+	ADSB_EMITTER_TYPE_LIGHTER_AIR=10, /*  | */
+	ADSB_EMITTER_TYPE_PARACHUTE=11, /*  | */
+	ADSB_EMITTER_TYPE_ULTRA_LIGHT=12, /*  | */
+	ADSB_EMITTER_TYPE_UNASSIGNED2=13, /*  | */
+	ADSB_EMITTER_TYPE_UAV=14, /*  | */
+	ADSB_EMITTER_TYPE_SPACE=15, /*  | */
+	ADSB_EMITTER_TYPE_UNASSGINED3=16, /*  | */
+	ADSB_EMITTER_TYPE_EMERGENCY_SURFACE=17, /*  | */
+	ADSB_EMITTER_TYPE_SERVICE_SURFACE=18, /*  | */
+	ADSB_EMITTER_TYPE_POINT_OBSTACLE=19, /*  | */
+	ADSB_EMITTER_TYPE_ENUM_END=20, /*  | */
+} ADSB_EMITTER_TYPE;
+#endif
+
+/** @brief These flags indicate status such as data validity of each data source. Set = data valid */
+#ifndef HAVE_ENUM_ADSB_FLAGS
+#define HAVE_ENUM_ADSB_FLAGS
+typedef enum ADSB_FLAGS
+{
+	ADSB_FLAGS_VALID_COORDS=1, /*  | */
+	ADSB_FLAGS_VALID_ALTITUDE=2, /*  | */
+	ADSB_FLAGS_VALID_HEADING=4, /*  | */
+	ADSB_FLAGS_VALID_VELOCITY=8, /*  | */
+	ADSB_FLAGS_VALID_CALLSIGN=16, /*  | */
+	ADSB_FLAGS_VALID_SQUAWK=32, /*  | */
+	ADSB_FLAGS_SIMULATED=64, /*  | */
+	ADSB_FLAGS_ENUM_END=65, /*  | */
+} ADSB_FLAGS;
+#endif
+
+/** @brief Bitmask of options for the MAV_CMD_DO_REPOSITION */
+#ifndef HAVE_ENUM_MAV_DO_REPOSITION_FLAGS
+#define HAVE_ENUM_MAV_DO_REPOSITION_FLAGS
+typedef enum MAV_DO_REPOSITION_FLAGS
+{
+	MAV_DO_REPOSITION_FLAGS_CHANGE_MODE=1, /* The aircraft should immediately transition into guided. This should not be set for follow me applications | */
+	MAV_DO_REPOSITION_FLAGS_ENUM_END=2, /*  | */
+} MAV_DO_REPOSITION_FLAGS;
+#endif
+
+/** @brief Flags in EKF_STATUS message */
+#ifndef HAVE_ENUM_ESTIMATOR_STATUS_FLAGS
+#define HAVE_ENUM_ESTIMATOR_STATUS_FLAGS
+typedef enum ESTIMATOR_STATUS_FLAGS
+{
+	ESTIMATOR_ATTITUDE=1, /* True if the attitude estimate is good | */
+	ESTIMATOR_VELOCITY_HORIZ=2, /* True if the horizontal velocity estimate is good | */
+	ESTIMATOR_VELOCITY_VERT=4, /* True if the  vertical velocity estimate is good | */
+	ESTIMATOR_POS_HORIZ_REL=8, /* True if the horizontal position (relative) estimate is good | */
+	ESTIMATOR_POS_HORIZ_ABS=16, /* True if the horizontal position (absolute) estimate is good | */
+	ESTIMATOR_POS_VERT_ABS=32, /* True if the vertical position (absolute) estimate is good | */
+	ESTIMATOR_POS_VERT_AGL=64, /* True if the vertical position (above ground) estimate is good | */
+	ESTIMATOR_CONST_POS_MODE=128, /* True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) | */
+	ESTIMATOR_PRED_POS_HORIZ_REL=256, /* True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate | */
+	ESTIMATOR_PRED_POS_HORIZ_ABS=512, /* True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate | */
+	ESTIMATOR_GPS_GLITCH=1024, /* True if the EKF has detected a GPS glitch | */
+	ESTIMATOR_STATUS_FLAGS_ENUM_END=1025, /*  | */
+} ESTIMATOR_STATUS_FLAGS;
+#endif
+
+// MAVLINK VERSION
+
+#ifndef MAVLINK_VERSION
+#define MAVLINK_VERSION 3
+#endif
+
+#if (MAVLINK_VERSION == 0)
+#undef MAVLINK_VERSION
+#define MAVLINK_VERSION 3
+#endif
+
+// MESSAGE DEFINITIONS
+#include "./mavlink_msg_heartbeat.h"
+#include "./mavlink_msg_sys_status.h"
+#include "./mavlink_msg_system_time.h"
+#include "./mavlink_msg_ping.h"
+#include "./mavlink_msg_change_operator_control.h"
+#include "./mavlink_msg_change_operator_control_ack.h"
+#include "./mavlink_msg_auth_key.h"
+#include "./mavlink_msg_set_mode.h"
+#include "./mavlink_msg_param_request_read.h"
+#include "./mavlink_msg_param_request_list.h"
+#include "./mavlink_msg_param_value.h"
+#include "./mavlink_msg_param_set.h"
+#include "./mavlink_msg_gps_raw_int.h"
+#include "./mavlink_msg_gps_status.h"
+#include "./mavlink_msg_scaled_imu.h"
+#include "./mavlink_msg_raw_imu.h"
+#include "./mavlink_msg_raw_pressure.h"
+#include "./mavlink_msg_scaled_pressure.h"
+#include "./mavlink_msg_attitude.h"
+#include "./mavlink_msg_attitude_quaternion.h"
+#include "./mavlink_msg_local_position_ned.h"
+#include "./mavlink_msg_global_position_int.h"
+#include "./mavlink_msg_rc_channels_scaled.h"
+#include "./mavlink_msg_rc_channels_raw.h"
+#include "./mavlink_msg_servo_output_raw.h"
+#include "./mavlink_msg_mission_request_partial_list.h"
+#include "./mavlink_msg_mission_write_partial_list.h"
+#include "./mavlink_msg_mission_item.h"
+#include "./mavlink_msg_mission_request.h"
+#include "./mavlink_msg_mission_set_current.h"
+#include "./mavlink_msg_mission_current.h"
+#include "./mavlink_msg_mission_request_list.h"
+#include "./mavlink_msg_mission_count.h"
+#include "./mavlink_msg_mission_clear_all.h"
+#include "./mavlink_msg_mission_item_reached.h"
+#include "./mavlink_msg_mission_ack.h"
+#include "./mavlink_msg_set_gps_global_origin.h"
+#include "./mavlink_msg_gps_global_origin.h"
+#include "./mavlink_msg_param_map_rc.h"
+#include "./mavlink_msg_mission_request_int.h"
+#include "./mavlink_msg_safety_set_allowed_area.h"
+#include "./mavlink_msg_safety_allowed_area.h"
+#include "./mavlink_msg_attitude_quaternion_cov.h"
+#include "./mavlink_msg_nav_controller_output.h"
+#include "./mavlink_msg_global_position_int_cov.h"
+#include "./mavlink_msg_local_position_ned_cov.h"
+#include "./mavlink_msg_rc_channels.h"
+#include "./mavlink_msg_request_data_stream.h"
+#include "./mavlink_msg_data_stream.h"
+#include "./mavlink_msg_manual_control.h"
+#include "./mavlink_msg_rc_channels_override.h"
+#include "./mavlink_msg_mission_item_int.h"
+#include "./mavlink_msg_vfr_hud.h"
+#include "./mavlink_msg_command_int.h"
+#include "./mavlink_msg_command_long.h"
+#include "./mavlink_msg_command_ack.h"
+#include "./mavlink_msg_manual_setpoint.h"
+#include "./mavlink_msg_set_attitude_target.h"
+#include "./mavlink_msg_attitude_target.h"
+#include "./mavlink_msg_set_position_target_local_ned.h"
+#include "./mavlink_msg_position_target_local_ned.h"
+#include "./mavlink_msg_set_position_target_global_int.h"
+#include "./mavlink_msg_position_target_global_int.h"
+#include "./mavlink_msg_local_position_ned_system_global_offset.h"
+#include "./mavlink_msg_hil_state.h"
+#include "./mavlink_msg_hil_controls.h"
+#include "./mavlink_msg_hil_rc_inputs_raw.h"
+#include "./mavlink_msg_optical_flow.h"
+#include "./mavlink_msg_global_vision_position_estimate.h"
+#include "./mavlink_msg_vision_position_estimate.h"
+#include "./mavlink_msg_vision_speed_estimate.h"
+#include "./mavlink_msg_vicon_position_estimate.h"
+#include "./mavlink_msg_highres_imu.h"
+#include "./mavlink_msg_optical_flow_rad.h"
+#include "./mavlink_msg_hil_sensor.h"
+#include "./mavlink_msg_sim_state.h"
+#include "./mavlink_msg_radio_status.h"
+#include "./mavlink_msg_file_transfer_protocol.h"
+#include "./mavlink_msg_timesync.h"
+#include "./mavlink_msg_camera_trigger.h"
+#include "./mavlink_msg_hil_gps.h"
+#include "./mavlink_msg_hil_optical_flow.h"
+#include "./mavlink_msg_hil_state_quaternion.h"
+#include "./mavlink_msg_scaled_imu2.h"
+#include "./mavlink_msg_log_request_list.h"
+#include "./mavlink_msg_log_entry.h"
+#include "./mavlink_msg_log_request_data.h"
+#include "./mavlink_msg_log_data.h"
+#include "./mavlink_msg_log_erase.h"
+#include "./mavlink_msg_log_request_end.h"
+#include "./mavlink_msg_gps_inject_data.h"
+#include "./mavlink_msg_gps2_raw.h"
+#include "./mavlink_msg_power_status.h"
+#include "./mavlink_msg_serial_control.h"
+#include "./mavlink_msg_gps_rtk.h"
+#include "./mavlink_msg_gps2_rtk.h"
+#include "./mavlink_msg_scaled_imu3.h"
+#include "./mavlink_msg_data_transmission_handshake.h"
+#include "./mavlink_msg_encapsulated_data.h"
+#include "./mavlink_msg_distance_sensor.h"
+#include "./mavlink_msg_terrain_request.h"
+#include "./mavlink_msg_terrain_data.h"
+#include "./mavlink_msg_terrain_check.h"
+#include "./mavlink_msg_terrain_report.h"
+#include "./mavlink_msg_scaled_pressure2.h"
+#include "./mavlink_msg_att_pos_mocap.h"
+#include "./mavlink_msg_set_actuator_control_target.h"
+#include "./mavlink_msg_actuator_control_target.h"
+#include "./mavlink_msg_altitude.h"
+#include "./mavlink_msg_resource_request.h"
+#include "./mavlink_msg_scaled_pressure3.h"
+#include "./mavlink_msg_follow_target.h"
+#include "./mavlink_msg_control_system_state.h"
+#include "./mavlink_msg_battery_status.h"
+#include "./mavlink_msg_autopilot_version.h"
+#include "./mavlink_msg_landing_target.h"
+#include "./mavlink_msg_estimator_status.h"
+#include "./mavlink_msg_wind_cov.h"
+#include "./mavlink_msg_gps_rtcm_data.h"
+#include "./mavlink_msg_vibration.h"
+#include "./mavlink_msg_home_position.h"
+#include "./mavlink_msg_set_home_position.h"
+#include "./mavlink_msg_message_interval.h"
+#include "./mavlink_msg_extended_sys_state.h"
+#include "./mavlink_msg_adsb_vehicle.h"
+#include "./mavlink_msg_v2_extension.h"
+#include "./mavlink_msg_memory_vect.h"
+#include "./mavlink_msg_debug_vect.h"
+#include "./mavlink_msg_named_value_float.h"
+#include "./mavlink_msg_named_value_int.h"
+#include "./mavlink_msg_statustext.h"
+#include "./mavlink_msg_debug.h"
+
+// base include
+
+
+#if MAVLINK_COMMAND_24BIT
+#include "../mavlink_get_info.h"
+#endif
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+#endif // MAVLINK_COMMON_H
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink.h	(revision 209)
@@ -0,0 +1,35 @@
+/** @file
+ *	@brief MAVLink comm protocol built from common.xml
+ *	@see http://mavlink.org
+ */
+#ifndef MAVLINK_H
+#define MAVLINK_H
+
+#ifndef MAVLINK_STX
+#define MAVLINK_STX 254
+#endif
+
+#ifndef MAVLINK_ENDIAN
+#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
+#endif
+
+#ifndef MAVLINK_ALIGNED_FIELDS
+#define MAVLINK_ALIGNED_FIELDS 1
+#endif
+
+#ifndef MAVLINK_CRC_EXTRA
+#define MAVLINK_CRC_EXTRA 1
+#endif
+
+#ifndef MAVLINK_COMMAND_24BIT
+#define MAVLINK_COMMAND_24BIT 0
+#endif
+
+#ifndef MAVLINK_PACKED
+#define MAVLINK_PACKED __attribute__((__packed__))
+#endif
+
+#include "version.h"
+#include "common.h"
+
+#endif // MAVLINK_H
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_actuator_control_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_actuator_control_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_actuator_control_target.h	(revision 209)
@@ -0,0 +1,254 @@
+// MESSAGE ACTUATOR_CONTROL_TARGET PACKING
+
+#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140
+
+typedef struct MAVLINK_PACKED __mavlink_actuator_control_target_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/
+ uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/
+} mavlink_actuator_control_target_t;
+
+#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41
+#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41
+#define MAVLINK_MSG_ID_140_LEN 41
+#define MAVLINK_MSG_ID_140_MIN_LEN 41
+
+#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181
+#define MAVLINK_MSG_ID_140_CRC 181
+
+#define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
+	140, \
+	"ACTUATOR_CONTROL_TARGET", \
+	3, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
+         { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
+         { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
+	"ACTUATOR_CONTROL_TARGET", \
+	3, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
+         { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
+         { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a actuator_control_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t group_mlx, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_float_array(buf, 8, controls, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
+#else
+	mavlink_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a actuator_control_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t group_mlx,const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_float_array(buf, 8, controls, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
+#else
+	mavlink_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a actuator_control_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param actuator_control_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
+{
+	return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
+}
+
+/**
+ * @brief Encode a actuator_control_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param actuator_control_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
+{
+	return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
+}
+
+/**
+ * @brief Send a actuator_control_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_float_array(buf, 8, controls, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+#else
+	mavlink_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a actuator_control_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_actuator_control_target_t* actuator_control_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_actuator_control_target_send(chan, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)actuator_control_target, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t group_mlx, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_float_array(buf, 8, controls, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+#else
+	mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->group_mlx = group_mlx;
+	mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ACTUATOR_CONTROL_TARGET UNPACKING
+
+
+/**
+ * @brief Get field time_usec from actuator_control_target message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field group_mlx from actuator_control_target message
+ *
+ * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ */
+static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  40);
+}
+
+/**
+ * @brief Get field controls from actuator_control_target message
+ *
+ * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ */
+static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
+{
+	return _MAV_RETURN_float_array(msg, controls, 8,  8);
+}
+
+/**
+ * @brief Decode a actuator_control_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param actuator_control_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_actuator_control_target_t* actuator_control_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg);
+	mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls);
+	actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN;
+        memset(actuator_control_target, 0, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
+	memcpy(actuator_control_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_adsb_vehicle.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_adsb_vehicle.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_adsb_vehicle.h	(revision 209)
@@ -0,0 +1,504 @@
+// MESSAGE ADSB_VEHICLE PACKING
+
+#define MAVLINK_MSG_ID_ADSB_VEHICLE 246
+
+typedef struct MAVLINK_PACKED __mavlink_adsb_vehicle_t
+{
+ uint32_t ICAO_address; /*< ICAO address*/
+ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
+ int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
+ int32_t altitude; /*< Altitude(ASL) in millimeters*/
+ uint16_t heading; /*< Course over ground in centidegrees*/
+ uint16_t hor_velocity; /*< The horizontal velocity in centimeters/second*/
+ int16_t ver_velocity; /*< The vertical velocity in centimeters/second, positive is up*/
+ uint16_t flags; /*< Flags to indicate various statuses including valid data fields*/
+ uint16_t squawk; /*< Squawk code*/
+ uint8_t altitude_type; /*< Type from ADSB_ALTITUDE_TYPE enum*/
+ char callsign[9]; /*< The callsign, 8+null*/
+ uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/
+ uint8_t tslc; /*< Time since last communication in seconds*/
+} mavlink_adsb_vehicle_t;
+
+#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38
+#define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38
+#define MAVLINK_MSG_ID_246_LEN 38
+#define MAVLINK_MSG_ID_246_MIN_LEN 38
+
+#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 184
+#define MAVLINK_MSG_ID_246_CRC 184
+
+#define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
+	246, \
+	"ADSB_VEHICLE", \
+	13, \
+	{  { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
+         { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
+         { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
+         { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
+         { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
+         { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
+         { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
+         { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
+         { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
+	"ADSB_VEHICLE", \
+	13, \
+	{  { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
+         { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
+         { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
+         { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
+         { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
+         { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
+         { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
+         { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
+         { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a adsb_vehicle message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param ICAO_address ICAO address
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
+ * @param altitude Altitude(ASL) in millimeters
+ * @param heading Course over ground in centidegrees
+ * @param hor_velocity The horizontal velocity in centimeters/second
+ * @param ver_velocity The vertical velocity in centimeters/second, positive is up
+ * @param callsign The callsign, 8+null
+ * @param emitter_type Type from ADSB_EMITTER_TYPE enum
+ * @param tslc Time since last communication in seconds
+ * @param flags Flags to indicate various statuses including valid data fields
+ * @param squawk Squawk code
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
+	_mav_put_uint32_t(buf, 0, ICAO_address);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, altitude);
+	_mav_put_uint16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, hor_velocity);
+	_mav_put_int16_t(buf, 20, ver_velocity);
+	_mav_put_uint16_t(buf, 22, flags);
+	_mav_put_uint16_t(buf, 24, squawk);
+	_mav_put_uint8_t(buf, 26, altitude_type);
+	_mav_put_uint8_t(buf, 36, emitter_type);
+	_mav_put_uint8_t(buf, 37, tslc);
+	_mav_put_char_array(buf, 27, callsign, 9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
+#else
+	mavlink_adsb_vehicle_t packet;
+	packet.ICAO_address = ICAO_address;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.altitude = altitude;
+	packet.heading = heading;
+	packet.hor_velocity = hor_velocity;
+	packet.ver_velocity = ver_velocity;
+	packet.flags = flags;
+	packet.squawk = squawk;
+	packet.altitude_type = altitude_type;
+	packet.emitter_type = emitter_type;
+	packet.tslc = tslc;
+	mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+}
+
+/**
+ * @brief Pack a adsb_vehicle message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param ICAO_address ICAO address
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
+ * @param altitude Altitude(ASL) in millimeters
+ * @param heading Course over ground in centidegrees
+ * @param hor_velocity The horizontal velocity in centimeters/second
+ * @param ver_velocity The vertical velocity in centimeters/second, positive is up
+ * @param callsign The callsign, 8+null
+ * @param emitter_type Type from ADSB_EMITTER_TYPE enum
+ * @param tslc Time since last communication in seconds
+ * @param flags Flags to indicate various statuses including valid data fields
+ * @param squawk Squawk code
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
+	_mav_put_uint32_t(buf, 0, ICAO_address);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, altitude);
+	_mav_put_uint16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, hor_velocity);
+	_mav_put_int16_t(buf, 20, ver_velocity);
+	_mav_put_uint16_t(buf, 22, flags);
+	_mav_put_uint16_t(buf, 24, squawk);
+	_mav_put_uint8_t(buf, 26, altitude_type);
+	_mav_put_uint8_t(buf, 36, emitter_type);
+	_mav_put_uint8_t(buf, 37, tslc);
+	_mav_put_char_array(buf, 27, callsign, 9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
+#else
+	mavlink_adsb_vehicle_t packet;
+	packet.ICAO_address = ICAO_address;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.altitude = altitude;
+	packet.heading = heading;
+	packet.hor_velocity = hor_velocity;
+	packet.ver_velocity = ver_velocity;
+	packet.flags = flags;
+	packet.squawk = squawk;
+	packet.altitude_type = altitude_type;
+	packet.emitter_type = emitter_type;
+	packet.tslc = tslc;
+	mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+}
+
+/**
+ * @brief Encode a adsb_vehicle struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param adsb_vehicle C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
+{
+	return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
+}
+
+/**
+ * @brief Encode a adsb_vehicle struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param adsb_vehicle C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
+{
+	return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
+}
+
+/**
+ * @brief Send a adsb_vehicle message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param ICAO_address ICAO address
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
+ * @param altitude Altitude(ASL) in millimeters
+ * @param heading Course over ground in centidegrees
+ * @param hor_velocity The horizontal velocity in centimeters/second
+ * @param ver_velocity The vertical velocity in centimeters/second, positive is up
+ * @param callsign The callsign, 8+null
+ * @param emitter_type Type from ADSB_EMITTER_TYPE enum
+ * @param tslc Time since last communication in seconds
+ * @param flags Flags to indicate various statuses including valid data fields
+ * @param squawk Squawk code
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
+	_mav_put_uint32_t(buf, 0, ICAO_address);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, altitude);
+	_mav_put_uint16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, hor_velocity);
+	_mav_put_int16_t(buf, 20, ver_velocity);
+	_mav_put_uint16_t(buf, 22, flags);
+	_mav_put_uint16_t(buf, 24, squawk);
+	_mav_put_uint8_t(buf, 26, altitude_type);
+	_mav_put_uint8_t(buf, 36, emitter_type);
+	_mav_put_uint8_t(buf, 37, tslc);
+	_mav_put_char_array(buf, 27, callsign, 9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+#else
+	mavlink_adsb_vehicle_t packet;
+	packet.ICAO_address = ICAO_address;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.altitude = altitude;
+	packet.heading = heading;
+	packet.hor_velocity = hor_velocity;
+	packet.ver_velocity = ver_velocity;
+	packet.flags = flags;
+	packet.squawk = squawk;
+	packet.altitude_type = altitude_type;
+	packet.emitter_type = emitter_type;
+	packet.tslc = tslc;
+	mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a adsb_vehicle message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_adsb_vehicle_send_struct(mavlink_channel_t chan, const mavlink_adsb_vehicle_t* adsb_vehicle)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_adsb_vehicle_send(chan, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)adsb_vehicle, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ADSB_VEHICLE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, ICAO_address);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, altitude);
+	_mav_put_uint16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, hor_velocity);
+	_mav_put_int16_t(buf, 20, ver_velocity);
+	_mav_put_uint16_t(buf, 22, flags);
+	_mav_put_uint16_t(buf, 24, squawk);
+	_mav_put_uint8_t(buf, 26, altitude_type);
+	_mav_put_uint8_t(buf, 36, emitter_type);
+	_mav_put_uint8_t(buf, 37, tslc);
+	_mav_put_char_array(buf, 27, callsign, 9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+#else
+	mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf;
+	packet->ICAO_address = ICAO_address;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->altitude = altitude;
+	packet->heading = heading;
+	packet->hor_velocity = hor_velocity;
+	packet->ver_velocity = ver_velocity;
+	packet->flags = flags;
+	packet->squawk = squawk;
+	packet->altitude_type = altitude_type;
+	packet->emitter_type = emitter_type;
+	packet->tslc = tslc;
+	mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ADSB_VEHICLE UNPACKING
+
+
+/**
+ * @brief Get field ICAO_address from adsb_vehicle message
+ *
+ * @return ICAO address
+ */
+static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field lat from adsb_vehicle message
+ *
+ * @return Latitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field lon from adsb_vehicle message
+ *
+ * @return Longitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field altitude_type from adsb_vehicle message
+ *
+ * @return Type from ADSB_ALTITUDE_TYPE enum
+ */
+static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  26);
+}
+
+/**
+ * @brief Get field altitude from adsb_vehicle message
+ *
+ * @return Altitude(ASL) in millimeters
+ */
+static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field heading from adsb_vehicle message
+ *
+ * @return Course over ground in centidegrees
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field hor_velocity from adsb_vehicle message
+ *
+ * @return The horizontal velocity in centimeters/second
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field ver_velocity from adsb_vehicle message
+ *
+ * @return The vertical velocity in centimeters/second, positive is up
+ */
+static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Get field callsign from adsb_vehicle message
+ *
+ * @return The callsign, 8+null
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign)
+{
+	return _MAV_RETURN_char_array(msg, callsign, 9,  27);
+}
+
+/**
+ * @brief Get field emitter_type from adsb_vehicle message
+ *
+ * @return Type from ADSB_EMITTER_TYPE enum
+ */
+static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field tslc from adsb_vehicle message
+ *
+ * @return Time since last communication in seconds
+ */
+static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  37);
+}
+
+/**
+ * @brief Get field flags from adsb_vehicle message
+ *
+ * @return Flags to indicate various statuses including valid data fields
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field squawk from adsb_vehicle message
+ *
+ * @return Squawk code
+ */
+static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Decode a adsb_vehicle message into a struct
+ *
+ * @param msg The message to decode
+ * @param adsb_vehicle C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_adsb_vehicle_decode(const mavlink_message_t* msg, mavlink_adsb_vehicle_t* adsb_vehicle)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg);
+	adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg);
+	adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg);
+	adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg);
+	adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg);
+	adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg);
+	adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg);
+	adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg);
+	adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg);
+	adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg);
+	mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign);
+	adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg);
+	adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ADSB_VEHICLE_LEN? msg->len : MAVLINK_MSG_ID_ADSB_VEHICLE_LEN;
+        memset(adsb_vehicle, 0, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
+	memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_altitude.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_altitude.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_altitude.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE ALTITUDE PACKING
+
+#define MAVLINK_MSG_ID_ALTITUDE 141
+
+typedef struct MAVLINK_PACKED __mavlink_altitude_t
+{
+ uint64_t time_usec; /*< Timestamp (milliseconds since system boot)*/
+ float altitude_monotonic; /*< This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/
+ float altitude_amsl; /*< This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.*/
+ float altitude_local; /*< This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.*/
+ float altitude_relative; /*< This is the altitude above the home position. It resets on each change of the current home position.*/
+ float altitude_terrain; /*< This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/
+ float bottom_clearance; /*< This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/
+} mavlink_altitude_t;
+
+#define MAVLINK_MSG_ID_ALTITUDE_LEN 32
+#define MAVLINK_MSG_ID_ALTITUDE_MIN_LEN 32
+#define MAVLINK_MSG_ID_141_LEN 32
+#define MAVLINK_MSG_ID_141_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_ALTITUDE_CRC 47
+#define MAVLINK_MSG_ID_141_CRC 47
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
+	141, \
+	"ALTITUDE", \
+	7, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
+         { "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
+         { "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
+         { "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
+         { "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
+         { "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
+         { "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
+	"ALTITUDE", \
+	7, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
+         { "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
+         { "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
+         { "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
+         { "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
+         { "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
+         { "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a altitude message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (milliseconds since system boot)
+ * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
+ * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
+ * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
+ * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
+ * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
+ * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, altitude_monotonic);
+	_mav_put_float(buf, 12, altitude_amsl);
+	_mav_put_float(buf, 16, altitude_local);
+	_mav_put_float(buf, 20, altitude_relative);
+	_mav_put_float(buf, 24, altitude_terrain);
+	_mav_put_float(buf, 28, bottom_clearance);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
+#else
+	mavlink_altitude_t packet;
+	packet.time_usec = time_usec;
+	packet.altitude_monotonic = altitude_monotonic;
+	packet.altitude_amsl = altitude_amsl;
+	packet.altitude_local = altitude_local;
+	packet.altitude_relative = altitude_relative;
+	packet.altitude_terrain = altitude_terrain;
+	packet.bottom_clearance = bottom_clearance;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+}
+
+/**
+ * @brief Pack a altitude message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (milliseconds since system boot)
+ * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
+ * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
+ * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
+ * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
+ * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
+ * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float altitude_monotonic,float altitude_amsl,float altitude_local,float altitude_relative,float altitude_terrain,float bottom_clearance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, altitude_monotonic);
+	_mav_put_float(buf, 12, altitude_amsl);
+	_mav_put_float(buf, 16, altitude_local);
+	_mav_put_float(buf, 20, altitude_relative);
+	_mav_put_float(buf, 24, altitude_terrain);
+	_mav_put_float(buf, 28, bottom_clearance);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
+#else
+	mavlink_altitude_t packet;
+	packet.time_usec = time_usec;
+	packet.altitude_monotonic = altitude_monotonic;
+	packet.altitude_amsl = altitude_amsl;
+	packet.altitude_local = altitude_local;
+	packet.altitude_relative = altitude_relative;
+	packet.altitude_terrain = altitude_terrain;
+	packet.bottom_clearance = bottom_clearance;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+}
+
+/**
+ * @brief Encode a altitude struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param altitude C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
+{
+	return mavlink_msg_altitude_pack(system_id, component_id, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
+}
+
+/**
+ * @brief Encode a altitude struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param altitude C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
+{
+	return mavlink_msg_altitude_pack_chan(system_id, component_id, chan, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
+}
+
+/**
+ * @brief Send a altitude message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (milliseconds since system boot)
+ * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
+ * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
+ * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
+ * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
+ * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
+ * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_altitude_send(mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, altitude_monotonic);
+	_mav_put_float(buf, 12, altitude_amsl);
+	_mav_put_float(buf, 16, altitude_local);
+	_mav_put_float(buf, 20, altitude_relative);
+	_mav_put_float(buf, 24, altitude_terrain);
+	_mav_put_float(buf, 28, bottom_clearance);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+#else
+	mavlink_altitude_t packet;
+	packet.time_usec = time_usec;
+	packet.altitude_monotonic = altitude_monotonic;
+	packet.altitude_amsl = altitude_amsl;
+	packet.altitude_local = altitude_local;
+	packet.altitude_relative = altitude_relative;
+	packet.altitude_terrain = altitude_terrain;
+	packet.bottom_clearance = bottom_clearance;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a altitude message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_altitude_send_struct(mavlink_channel_t chan, const mavlink_altitude_t* altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_altitude_send(chan, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)altitude, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ALTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, altitude_monotonic);
+	_mav_put_float(buf, 12, altitude_amsl);
+	_mav_put_float(buf, 16, altitude_local);
+	_mav_put_float(buf, 20, altitude_relative);
+	_mav_put_float(buf, 24, altitude_terrain);
+	_mav_put_float(buf, 28, bottom_clearance);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+#else
+	mavlink_altitude_t *packet = (mavlink_altitude_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->altitude_monotonic = altitude_monotonic;
+	packet->altitude_amsl = altitude_amsl;
+	packet->altitude_local = altitude_local;
+	packet->altitude_relative = altitude_relative;
+	packet->altitude_terrain = altitude_terrain;
+	packet->bottom_clearance = bottom_clearance;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ALTITUDE UNPACKING
+
+
+/**
+ * @brief Get field time_usec from altitude message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field altitude_monotonic from altitude message
+ *
+ * @return This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
+ */
+static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field altitude_amsl from altitude message
+ *
+ * @return This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
+ */
+static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field altitude_local from altitude message
+ *
+ * @return This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
+ */
+static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field altitude_relative from altitude message
+ *
+ * @return This is the altitude above the home position. It resets on each change of the current home position.
+ */
+static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field altitude_terrain from altitude message
+ *
+ * @return This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
+ */
+static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field bottom_clearance from altitude message
+ *
+ * @return This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
+ */
+static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Decode a altitude message into a struct
+ *
+ * @param msg The message to decode
+ * @param altitude C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_altitude_decode(const mavlink_message_t* msg, mavlink_altitude_t* altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	altitude->time_usec = mavlink_msg_altitude_get_time_usec(msg);
+	altitude->altitude_monotonic = mavlink_msg_altitude_get_altitude_monotonic(msg);
+	altitude->altitude_amsl = mavlink_msg_altitude_get_altitude_amsl(msg);
+	altitude->altitude_local = mavlink_msg_altitude_get_altitude_local(msg);
+	altitude->altitude_relative = mavlink_msg_altitude_get_altitude_relative(msg);
+	altitude->altitude_terrain = mavlink_msg_altitude_get_altitude_terrain(msg);
+	altitude->bottom_clearance = mavlink_msg_altitude_get_bottom_clearance(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ALTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ALTITUDE_LEN;
+        memset(altitude, 0, MAVLINK_MSG_ID_ALTITUDE_LEN);
+	memcpy(altitude, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_att_pos_mocap.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_att_pos_mocap.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_att_pos_mocap.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE ATT_POS_MOCAP PACKING
+
+#define MAVLINK_MSG_ID_ATT_POS_MOCAP 138
+
+typedef struct MAVLINK_PACKED __mavlink_att_pos_mocap_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
+ float x; /*< X position in meters (NED)*/
+ float y; /*< Y position in meters (NED)*/
+ float z; /*< Z position in meters (NED)*/
+} mavlink_att_pos_mocap_t;
+
+#define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 36
+#define MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN 36
+#define MAVLINK_MSG_ID_138_LEN 36
+#define MAVLINK_MSG_ID_138_MIN_LEN 36
+
+#define MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC 109
+#define MAVLINK_MSG_ID_138_CRC 109
+
+#define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
+	138, \
+	"ATT_POS_MOCAP", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
+	"ATT_POS_MOCAP", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a att_pos_mocap message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param x X position in meters (NED)
+ * @param y Y position in meters (NED)
+ * @param z Z position in meters (NED)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, const float *q, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, x);
+	_mav_put_float(buf, 28, y);
+	_mav_put_float(buf, 32, z);
+	_mav_put_float_array(buf, 8, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
+#else
+	mavlink_att_pos_mocap_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+}
+
+/**
+ * @brief Pack a att_pos_mocap message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param x X position in meters (NED)
+ * @param y Y position in meters (NED)
+ * @param z Z position in meters (NED)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,const float *q,float x,float y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, x);
+	_mav_put_float(buf, 28, y);
+	_mav_put_float(buf, 32, z);
+	_mav_put_float_array(buf, 8, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
+#else
+	mavlink_att_pos_mocap_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+}
+
+/**
+ * @brief Encode a att_pos_mocap struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param att_pos_mocap C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
+{
+	return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
+}
+
+/**
+ * @brief Encode a att_pos_mocap struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param att_pos_mocap C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
+{
+	return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
+}
+
+/**
+ * @brief Send a att_pos_mocap message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param x X position in meters (NED)
+ * @param y Y position in meters (NED)
+ * @param z Z position in meters (NED)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, x);
+	_mav_put_float(buf, 28, y);
+	_mav_put_float(buf, 32, z);
+	_mav_put_float_array(buf, 8, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+#else
+	mavlink_att_pos_mocap_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+#endif
+}
+
+/**
+ * @brief Send a att_pos_mocap message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_att_pos_mocap_send_struct(mavlink_channel_t chan, const mavlink_att_pos_mocap_t* att_pos_mocap)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_att_pos_mocap_send(chan, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)att_pos_mocap, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, const float *q, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, x);
+	_mav_put_float(buf, 28, y);
+	_mav_put_float(buf, 32, z);
+	_mav_put_float_array(buf, 8, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+#else
+	mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ATT_POS_MOCAP UNPACKING
+
+
+/**
+ * @brief Get field time_usec from att_pos_mocap message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field q from att_pos_mocap message
+ *
+ * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ */
+static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  8);
+}
+
+/**
+ * @brief Get field x from att_pos_mocap message
+ *
+ * @return X position in meters (NED)
+ */
+static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field y from att_pos_mocap message
+ *
+ * @return Y position in meters (NED)
+ */
+static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field z from att_pos_mocap message
+ *
+ * @return Z position in meters (NED)
+ */
+static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Decode a att_pos_mocap message into a struct
+ *
+ * @param msg The message to decode
+ * @param att_pos_mocap C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_att_pos_mocap_decode(const mavlink_message_t* msg, mavlink_att_pos_mocap_t* att_pos_mocap)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg);
+	mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q);
+	att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg);
+	att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg);
+	att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN? msg->len : MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN;
+        memset(att_pos_mocap, 0, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
+	memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE ATTITUDE PACKING
+
+#define MAVLINK_MSG_ID_ATTITUDE 30
+
+typedef struct MAVLINK_PACKED __mavlink_attitude_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float roll; /*< Roll angle (rad, -pi..+pi)*/
+ float pitch; /*< Pitch angle (rad, -pi..+pi)*/
+ float yaw; /*< Yaw angle (rad, -pi..+pi)*/
+ float rollspeed; /*< Roll angular speed (rad/s)*/
+ float pitchspeed; /*< Pitch angular speed (rad/s)*/
+ float yawspeed; /*< Yaw angular speed (rad/s)*/
+} mavlink_attitude_t;
+
+#define MAVLINK_MSG_ID_ATTITUDE_LEN 28
+#define MAVLINK_MSG_ID_ATTITUDE_MIN_LEN 28
+#define MAVLINK_MSG_ID_30_LEN 28
+#define MAVLINK_MSG_ID_30_MIN_LEN 28
+
+#define MAVLINK_MSG_ID_ATTITUDE_CRC 39
+#define MAVLINK_MSG_ID_30_CRC 39
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
+	30, \
+	"ATTITUDE", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
+	"ATTITUDE", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a attitude message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param roll Roll angle (rad, -pi..+pi)
+ * @param pitch Pitch angle (rad, -pi..+pi)
+ * @param yaw Yaw angle (rad, -pi..+pi)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, rollspeed);
+	_mav_put_float(buf, 20, pitchspeed);
+	_mav_put_float(buf, 24, yawspeed);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
+#else
+	mavlink_attitude_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+}
+
+/**
+ * @brief Pack a attitude message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param roll Roll angle (rad, -pi..+pi)
+ * @param pitch Pitch angle (rad, -pi..+pi)
+ * @param yaw Yaw angle (rad, -pi..+pi)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, rollspeed);
+	_mav_put_float(buf, 20, pitchspeed);
+	_mav_put_float(buf, 24, yawspeed);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
+#else
+	mavlink_attitude_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+}
+
+/**
+ * @brief Encode a attitude struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
+{
+	return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
+}
+
+/**
+ * @brief Encode a attitude struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
+{
+	return mavlink_msg_attitude_pack_chan(system_id, component_id, chan, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
+}
+
+/**
+ * @brief Send a attitude message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param roll Roll angle (rad, -pi..+pi)
+ * @param pitch Pitch angle (rad, -pi..+pi)
+ * @param yaw Yaw angle (rad, -pi..+pi)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, rollspeed);
+	_mav_put_float(buf, 20, pitchspeed);
+	_mav_put_float(buf, 24, yawspeed);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+#else
+	mavlink_attitude_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a attitude message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_attitude_send_struct(mavlink_channel_t chan, const mavlink_attitude_t* attitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_attitude_send(chan, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)attitude, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ATTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, rollspeed);
+	_mav_put_float(buf, 20, pitchspeed);
+	_mav_put_float(buf, 24, yawspeed);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+#else
+	mavlink_attitude_t *packet = (mavlink_attitude_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+	packet->rollspeed = rollspeed;
+	packet->pitchspeed = pitchspeed;
+	packet->yawspeed = yawspeed;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ATTITUDE UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from attitude message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field roll from attitude message
+ *
+ * @return Roll angle (rad, -pi..+pi)
+ */
+static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field pitch from attitude message
+ *
+ * @return Pitch angle (rad, -pi..+pi)
+ */
+static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field yaw from attitude message
+ *
+ * @return Yaw angle (rad, -pi..+pi)
+ */
+static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field rollspeed from attitude message
+ *
+ * @return Roll angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field pitchspeed from attitude message
+ *
+ * @return Pitch angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field yawspeed from attitude message
+ *
+ * @return Yaw angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a attitude message into a struct
+ *
+ * @param msg The message to decode
+ * @param attitude C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mavlink_attitude_t* attitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	attitude->time_boot_ms = mavlink_msg_attitude_get_time_boot_ms(msg);
+	attitude->roll = mavlink_msg_attitude_get_roll(msg);
+	attitude->pitch = mavlink_msg_attitude_get_pitch(msg);
+	attitude->yaw = mavlink_msg_attitude_get_yaw(msg);
+	attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg);
+	attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg);
+	attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_LEN;
+        memset(attitude, 0, MAVLINK_MSG_ID_ATTITUDE_LEN);
+	memcpy(attitude, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion.h	(revision 209)
@@ -0,0 +1,387 @@
+// MESSAGE ATTITUDE_QUATERNION PACKING
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31
+
+typedef struct MAVLINK_PACKED __mavlink_attitude_quaternion_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float q1; /*< Quaternion component 1, w (1 in null-rotation)*/
+ float q2; /*< Quaternion component 2, x (0 in null-rotation)*/
+ float q3; /*< Quaternion component 3, y (0 in null-rotation)*/
+ float q4; /*< Quaternion component 4, z (0 in null-rotation)*/
+ float rollspeed; /*< Roll angular speed (rad/s)*/
+ float pitchspeed; /*< Pitch angular speed (rad/s)*/
+ float yawspeed; /*< Yaw angular speed (rad/s)*/
+} mavlink_attitude_quaternion_t;
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN 32
+#define MAVLINK_MSG_ID_31_LEN 32
+#define MAVLINK_MSG_ID_31_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246
+#define MAVLINK_MSG_ID_31_CRC 246
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
+	31, \
+	"ATTITUDE_QUATERNION", \
+	8, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
+         { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
+         { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
+         { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
+         { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
+	"ATTITUDE_QUATERNION", \
+	8, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
+         { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
+         { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
+         { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
+         { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a attitude_quaternion message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q1 Quaternion component 1, w (1 in null-rotation)
+ * @param q2 Quaternion component 2, x (0 in null-rotation)
+ * @param q3 Quaternion component 3, y (0 in null-rotation)
+ * @param q4 Quaternion component 4, z (0 in null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, q1);
+	_mav_put_float(buf, 8, q2);
+	_mav_put_float(buf, 12, q3);
+	_mav_put_float(buf, 16, q4);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
+#else
+	mavlink_attitude_quaternion_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+}
+
+/**
+ * @brief Pack a attitude_quaternion message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q1 Quaternion component 1, w (1 in null-rotation)
+ * @param q2 Quaternion component 2, x (0 in null-rotation)
+ * @param q3 Quaternion component 3, y (0 in null-rotation)
+ * @param q4 Quaternion component 4, z (0 in null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, q1);
+	_mav_put_float(buf, 8, q2);
+	_mav_put_float(buf, 12, q3);
+	_mav_put_float(buf, 16, q4);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
+#else
+	mavlink_attitude_quaternion_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+}
+
+/**
+ * @brief Encode a attitude_quaternion struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_quaternion C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
+{
+	return mavlink_msg_attitude_quaternion_pack(system_id, component_id, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
+}
+
+/**
+ * @brief Encode a attitude_quaternion struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_quaternion C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
+{
+	return mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, chan, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
+}
+
+/**
+ * @brief Send a attitude_quaternion message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q1 Quaternion component 1, w (1 in null-rotation)
+ * @param q2 Quaternion component 2, x (0 in null-rotation)
+ * @param q3 Quaternion component 3, y (0 in null-rotation)
+ * @param q4 Quaternion component 4, z (0 in null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, q1);
+	_mav_put_float(buf, 8, q2);
+	_mav_put_float(buf, 12, q3);
+	_mav_put_float(buf, 16, q4);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+#else
+	mavlink_attitude_quaternion_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a attitude_quaternion message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_attitude_quaternion_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_t* attitude_quaternion)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_attitude_quaternion_send(chan, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)attitude_quaternion, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, q1);
+	_mav_put_float(buf, 8, q2);
+	_mav_put_float(buf, 12, q3);
+	_mav_put_float(buf, 16, q4);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+#else
+	mavlink_attitude_quaternion_t *packet = (mavlink_attitude_quaternion_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->q1 = q1;
+	packet->q2 = q2;
+	packet->q3 = q3;
+	packet->q4 = q4;
+	packet->rollspeed = rollspeed;
+	packet->pitchspeed = pitchspeed;
+	packet->yawspeed = yawspeed;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ATTITUDE_QUATERNION UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from attitude_quaternion message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field q1 from attitude_quaternion message
+ *
+ * @return Quaternion component 1, w (1 in null-rotation)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field q2 from attitude_quaternion message
+ *
+ * @return Quaternion component 2, x (0 in null-rotation)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field q3 from attitude_quaternion message
+ *
+ * @return Quaternion component 3, y (0 in null-rotation)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field q4 from attitude_quaternion message
+ *
+ * @return Quaternion component 4, z (0 in null-rotation)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field rollspeed from attitude_quaternion message
+ *
+ * @return Roll angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitchspeed from attitude_quaternion message
+ *
+ * @return Pitch angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yawspeed from attitude_quaternion message
+ *
+ * @return Yaw angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Decode a attitude_quaternion message into a struct
+ *
+ * @param msg The message to decode
+ * @param attitude_quaternion C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_attitude_quaternion_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_t* attitude_quaternion)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	attitude_quaternion->time_boot_ms = mavlink_msg_attitude_quaternion_get_time_boot_ms(msg);
+	attitude_quaternion->q1 = mavlink_msg_attitude_quaternion_get_q1(msg);
+	attitude_quaternion->q2 = mavlink_msg_attitude_quaternion_get_q2(msg);
+	attitude_quaternion->q3 = mavlink_msg_attitude_quaternion_get_q3(msg);
+	attitude_quaternion->q4 = mavlink_msg_attitude_quaternion_get_q4(msg);
+	attitude_quaternion->rollspeed = mavlink_msg_attitude_quaternion_get_rollspeed(msg);
+	attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg);
+	attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN;
+        memset(attitude_quaternion, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
+	memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion_cov.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion_cov.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_quaternion_cov.h	(revision 209)
@@ -0,0 +1,330 @@
+// MESSAGE ATTITUDE_QUATERNION_COV PACKING
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV 61
+
+typedef struct MAVLINK_PACKED __mavlink_attitude_quaternion_cov_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/
+ float rollspeed; /*< Roll angular speed (rad/s)*/
+ float pitchspeed; /*< Pitch angular speed (rad/s)*/
+ float yawspeed; /*< Yaw angular speed (rad/s)*/
+ float covariance[9]; /*< Attitude covariance*/
+} mavlink_attitude_quaternion_cov_t;
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 68
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN 68
+#define MAVLINK_MSG_ID_61_LEN 68
+#define MAVLINK_MSG_ID_61_MIN_LEN 68
+
+#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC 153
+#define MAVLINK_MSG_ID_61_CRC 153
+
+#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_Q_LEN 4
+#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_COVARIANCE_LEN 9
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
+	61, \
+	"ATTITUDE_QUATERNION_COV", \
+	6, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 32, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
+	"ATTITUDE_QUATERNION_COV", \
+	6, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 32, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a attitude_quaternion_cov message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @param covariance Attitude covariance
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_float_array(buf, 4, q, 4);
+	_mav_put_float_array(buf, 32, covariance, 9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
+#else
+	mavlink_attitude_quaternion_cov_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+}
+
+/**
+ * @brief Pack a attitude_quaternion_cov message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @param covariance Attitude covariance
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,const float *q,float rollspeed,float pitchspeed,float yawspeed,const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_float_array(buf, 4, q, 4);
+	_mav_put_float_array(buf, 32, covariance, 9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
+#else
+	mavlink_attitude_quaternion_cov_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+}
+
+/**
+ * @brief Encode a attitude_quaternion_cov struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_quaternion_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
+{
+	return mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
+}
+
+/**
+ * @brief Encode a attitude_quaternion_cov struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_quaternion_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
+{
+	return mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, chan, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
+}
+
+/**
+ * @brief Send a attitude_quaternion_cov message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
+ * @param rollspeed Roll angular speed (rad/s)
+ * @param pitchspeed Pitch angular speed (rad/s)
+ * @param yawspeed Yaw angular speed (rad/s)
+ * @param covariance Attitude covariance
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_attitude_quaternion_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_float_array(buf, 4, q, 4);
+	_mav_put_float_array(buf, 32, covariance, 9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+#else
+	mavlink_attitude_quaternion_cov_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+#endif
+}
+
+/**
+ * @brief Send a attitude_quaternion_cov message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_attitude_quaternion_cov_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_attitude_quaternion_cov_send(chan, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)attitude_quaternion_cov, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_float_array(buf, 4, q, 4);
+	_mav_put_float_array(buf, 32, covariance, 9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+#else
+	mavlink_attitude_quaternion_cov_t *packet = (mavlink_attitude_quaternion_cov_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->rollspeed = rollspeed;
+	packet->pitchspeed = pitchspeed;
+	packet->yawspeed = yawspeed;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+	mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ATTITUDE_QUATERNION_COV UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from attitude_quaternion_cov message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field q from attitude_quaternion_cov message
+ *
+ * @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  4);
+}
+
+/**
+ * @brief Get field rollspeed from attitude_quaternion_cov message
+ *
+ * @return Roll angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitchspeed from attitude_quaternion_cov message
+ *
+ * @return Pitch angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yawspeed from attitude_quaternion_cov message
+ *
+ * @return Yaw angular speed (rad/s)
+ */
+static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field covariance from attitude_quaternion_cov message
+ *
+ * @return Attitude covariance
+ */
+static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
+{
+	return _MAV_RETURN_float_array(msg, covariance, 9,  32);
+}
+
+/**
+ * @brief Decode a attitude_quaternion_cov message into a struct
+ *
+ * @param msg The message to decode
+ * @param attitude_quaternion_cov C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_attitude_quaternion_cov_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	attitude_quaternion_cov->time_boot_ms = mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(msg);
+	mavlink_msg_attitude_quaternion_cov_get_q(msg, attitude_quaternion_cov->q);
+	attitude_quaternion_cov->rollspeed = mavlink_msg_attitude_quaternion_cov_get_rollspeed(msg);
+	attitude_quaternion_cov->pitchspeed = mavlink_msg_attitude_quaternion_cov_get_pitchspeed(msg);
+	attitude_quaternion_cov->yawspeed = mavlink_msg_attitude_quaternion_cov_get_yawspeed(msg);
+	mavlink_msg_attitude_quaternion_cov_get_covariance(msg, attitude_quaternion_cov->covariance);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN;
+        memset(attitude_quaternion_cov, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
+	memcpy(attitude_quaternion_cov, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_attitude_target.h	(revision 209)
@@ -0,0 +1,354 @@
+// MESSAGE ATTITUDE_TARGET PACKING
+
+#define MAVLINK_MSG_ID_ATTITUDE_TARGET 83
+
+typedef struct MAVLINK_PACKED __mavlink_attitude_target_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
+ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
+ float body_roll_rate; /*< Body roll rate in radians per second*/
+ float body_pitch_rate; /*< Body roll rate in radians per second*/
+ float body_yaw_rate; /*< Body roll rate in radians per second*/
+ float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/
+ uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/
+} mavlink_attitude_target_t;
+
+#define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37
+#define MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN 37
+#define MAVLINK_MSG_ID_83_LEN 37
+#define MAVLINK_MSG_ID_83_MIN_LEN 37
+
+#define MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC 22
+#define MAVLINK_MSG_ID_83_CRC 22
+
+#define MAVLINK_MSG_ATTITUDE_TARGET_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
+	83, \
+	"ATTITUDE_TARGET", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
+         { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
+         { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
+         { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
+	"ATTITUDE_TARGET", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
+         { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
+         { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
+         { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a attitude_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
+#else
+	mavlink_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a attitude_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
+#else
+	mavlink_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a attitude_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
+{
+	return mavlink_msg_attitude_target_pack(system_id, component_id, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
+}
+
+/**
+ * @brief Encode a attitude_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param attitude_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
+{
+	return mavlink_msg_attitude_target_pack_chan(system_id, component_id, chan, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
+}
+
+/**
+ * @brief Send a attitude_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+#else
+	mavlink_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a attitude_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_attitude_target_t* attitude_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_attitude_target_send(chan, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)attitude_target, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+#else
+	mavlink_attitude_target_t *packet = (mavlink_attitude_target_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->body_roll_rate = body_roll_rate;
+	packet->body_pitch_rate = body_pitch_rate;
+	packet->body_yaw_rate = body_yaw_rate;
+	packet->thrust = thrust;
+	packet->type_mask = type_mask;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ATTITUDE_TARGET UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from attitude_target message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field type_mask from attitude_target message
+ *
+ * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
+ */
+static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field q from attitude_target message
+ *
+ * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ */
+static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  4);
+}
+
+/**
+ * @brief Get field body_roll_rate from attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field body_pitch_rate from attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field body_yaw_rate from attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field thrust from attitude_target message
+ *
+ * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ */
+static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Decode a attitude_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param attitude_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_attitude_target_decode(const mavlink_message_t* msg, mavlink_attitude_target_t* attitude_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	attitude_target->time_boot_ms = mavlink_msg_attitude_target_get_time_boot_ms(msg);
+	mavlink_msg_attitude_target_get_q(msg, attitude_target->q);
+	attitude_target->body_roll_rate = mavlink_msg_attitude_target_get_body_roll_rate(msg);
+	attitude_target->body_pitch_rate = mavlink_msg_attitude_target_get_body_pitch_rate(msg);
+	attitude_target->body_yaw_rate = mavlink_msg_attitude_target_get_body_yaw_rate(msg);
+	attitude_target->thrust = mavlink_msg_attitude_target_get_thrust(msg);
+	attitude_target->type_mask = mavlink_msg_attitude_target_get_type_mask(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN;
+        memset(attitude_target, 0, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
+	memcpy(attitude_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_auth_key.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_auth_key.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_auth_key.h	(revision 209)
@@ -0,0 +1,212 @@
+// MESSAGE AUTH_KEY PACKING
+
+#define MAVLINK_MSG_ID_AUTH_KEY 7
+
+typedef struct MAVLINK_PACKED __mavlink_auth_key_t
+{
+ char key[32]; /*< key*/
+} mavlink_auth_key_t;
+
+#define MAVLINK_MSG_ID_AUTH_KEY_LEN 32
+#define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32
+#define MAVLINK_MSG_ID_7_LEN 32
+#define MAVLINK_MSG_ID_7_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_AUTH_KEY_CRC 119
+#define MAVLINK_MSG_ID_7_CRC 119
+
+#define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
+	7, \
+	"AUTH_KEY", \
+	1, \
+	{  { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
+	"AUTH_KEY", \
+	1, \
+	{  { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a auth_key message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param key key
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       const char *key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
+
+	_mav_put_char_array(buf, 0, key, 32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
+#else
+	mavlink_auth_key_t packet;
+
+	mav_array_memcpy(packet.key, key, sizeof(char)*32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+}
+
+/**
+ * @brief Pack a auth_key message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param key key
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           const char *key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
+
+	_mav_put_char_array(buf, 0, key, 32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
+#else
+	mavlink_auth_key_t packet;
+
+	mav_array_memcpy(packet.key, key, sizeof(char)*32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+}
+
+/**
+ * @brief Encode a auth_key struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param auth_key C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
+{
+	return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key);
+}
+
+/**
+ * @brief Encode a auth_key struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param auth_key C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
+{
+	return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->key);
+}
+
+/**
+ * @brief Send a auth_key message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param key key
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
+
+	_mav_put_char_array(buf, 0, key, 32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+#else
+	mavlink_auth_key_t packet;
+
+	mav_array_memcpy(packet.key, key, sizeof(char)*32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+#endif
+}
+
+/**
+ * @brief Send a auth_key message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_auth_key_send_struct(mavlink_channel_t chan, const mavlink_auth_key_t* auth_key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_auth_key_send(chan, auth_key->key);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)auth_key, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_AUTH_KEY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  const char *key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+
+	_mav_put_char_array(buf, 0, key, 32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+#else
+	mavlink_auth_key_t *packet = (mavlink_auth_key_t *)msgbuf;
+
+	mav_array_memcpy(packet->key, key, sizeof(char)*32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE AUTH_KEY UNPACKING
+
+
+/**
+ * @brief Get field key from auth_key message
+ *
+ * @return key
+ */
+static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key)
+{
+	return _MAV_RETURN_char_array(msg, key, 32,  0);
+}
+
+/**
+ * @brief Decode a auth_key message into a struct
+ *
+ * @param msg The message to decode
+ * @param auth_key C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mavlink_msg_auth_key_get_key(msg, auth_key->key);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_AUTH_KEY_LEN? msg->len : MAVLINK_MSG_ID_AUTH_KEY_LEN;
+        memset(auth_key, 0, MAVLINK_MSG_ID_AUTH_KEY_LEN);
+	memcpy(auth_key, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_autopilot_version.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_autopilot_version.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_autopilot_version.h	(revision 209)
@@ -0,0 +1,456 @@
+// MESSAGE AUTOPILOT_VERSION PACKING
+
+#define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
+
+typedef struct MAVLINK_PACKED __mavlink_autopilot_version_t
+{
+ uint64_t capabilities; /*< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)*/
+ uint64_t uid; /*< UID if provided by hardware*/
+ uint32_t flight_sw_version; /*< Firmware version number*/
+ uint32_t middleware_sw_version; /*< Middleware version number*/
+ uint32_t os_sw_version; /*< Operating system version number*/
+ uint32_t board_version; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/
+ uint16_t vendor_id; /*< ID of the board vendor*/
+ uint16_t product_id; /*< ID of the product*/
+ uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
+ uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
+ uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
+} mavlink_autopilot_version_t;
+
+#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60
+#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
+#define MAVLINK_MSG_ID_148_LEN 60
+#define MAVLINK_MSG_ID_148_MIN_LEN 60
+
+#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
+#define MAVLINK_MSG_ID_148_CRC 178
+
+#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
+#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
+#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
+	148, \
+	"AUTOPILOT_VERSION", \
+	11, \
+	{  { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
+         { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
+         { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
+         { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
+         { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
+         { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
+         { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
+         { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
+         { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
+         { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
+         { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
+	"AUTOPILOT_VERSION", \
+	11, \
+	{  { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
+         { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
+         { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
+         { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
+         { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
+         { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
+         { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
+         { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
+         { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
+         { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
+         { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a autopilot_version message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
+ * @param flight_sw_version Firmware version number
+ * @param middleware_sw_version Middleware version number
+ * @param os_sw_version Operating system version number
+ * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
+ * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param vendor_id ID of the board vendor
+ * @param product_id ID of the product
+ * @param uid UID if provided by hardware
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
+	_mav_put_uint64_t(buf, 0, capabilities);
+	_mav_put_uint64_t(buf, 8, uid);
+	_mav_put_uint32_t(buf, 16, flight_sw_version);
+	_mav_put_uint32_t(buf, 20, middleware_sw_version);
+	_mav_put_uint32_t(buf, 24, os_sw_version);
+	_mav_put_uint32_t(buf, 28, board_version);
+	_mav_put_uint16_t(buf, 32, vendor_id);
+	_mav_put_uint16_t(buf, 34, product_id);
+	_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
+#else
+	mavlink_autopilot_version_t packet;
+	packet.capabilities = capabilities;
+	packet.uid = uid;
+	packet.flight_sw_version = flight_sw_version;
+	packet.middleware_sw_version = middleware_sw_version;
+	packet.os_sw_version = os_sw_version;
+	packet.board_version = board_version;
+	packet.vendor_id = vendor_id;
+	packet.product_id = product_id;
+	mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+}
+
+/**
+ * @brief Pack a autopilot_version message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
+ * @param flight_sw_version Firmware version number
+ * @param middleware_sw_version Middleware version number
+ * @param os_sw_version Operating system version number
+ * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
+ * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param vendor_id ID of the board vendor
+ * @param product_id ID of the product
+ * @param uid UID if provided by hardware
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t capabilities,uint32_t flight_sw_version,uint32_t middleware_sw_version,uint32_t os_sw_version,uint32_t board_version,const uint8_t *flight_custom_version,const uint8_t *middleware_custom_version,const uint8_t *os_custom_version,uint16_t vendor_id,uint16_t product_id,uint64_t uid)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
+	_mav_put_uint64_t(buf, 0, capabilities);
+	_mav_put_uint64_t(buf, 8, uid);
+	_mav_put_uint32_t(buf, 16, flight_sw_version);
+	_mav_put_uint32_t(buf, 20, middleware_sw_version);
+	_mav_put_uint32_t(buf, 24, os_sw_version);
+	_mav_put_uint32_t(buf, 28, board_version);
+	_mav_put_uint16_t(buf, 32, vendor_id);
+	_mav_put_uint16_t(buf, 34, product_id);
+	_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
+#else
+	mavlink_autopilot_version_t packet;
+	packet.capabilities = capabilities;
+	packet.uid = uid;
+	packet.flight_sw_version = flight_sw_version;
+	packet.middleware_sw_version = middleware_sw_version;
+	packet.os_sw_version = os_sw_version;
+	packet.board_version = board_version;
+	packet.vendor_id = vendor_id;
+	packet.product_id = product_id;
+	mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+}
+
+/**
+ * @brief Encode a autopilot_version struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param autopilot_version C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
+{
+	return mavlink_msg_autopilot_version_pack(system_id, component_id, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
+}
+
+/**
+ * @brief Encode a autopilot_version struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param autopilot_version C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
+{
+	return mavlink_msg_autopilot_version_pack_chan(system_id, component_id, chan, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
+}
+
+/**
+ * @brief Send a autopilot_version message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
+ * @param flight_sw_version Firmware version number
+ * @param middleware_sw_version Middleware version number
+ * @param os_sw_version Operating system version number
+ * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
+ * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ * @param vendor_id ID of the board vendor
+ * @param product_id ID of the product
+ * @param uid UID if provided by hardware
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
+	_mav_put_uint64_t(buf, 0, capabilities);
+	_mav_put_uint64_t(buf, 8, uid);
+	_mav_put_uint32_t(buf, 16, flight_sw_version);
+	_mav_put_uint32_t(buf, 20, middleware_sw_version);
+	_mav_put_uint32_t(buf, 24, os_sw_version);
+	_mav_put_uint32_t(buf, 28, board_version);
+	_mav_put_uint16_t(buf, 32, vendor_id);
+	_mav_put_uint16_t(buf, 34, product_id);
+	_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+#else
+	mavlink_autopilot_version_t packet;
+	packet.capabilities = capabilities;
+	packet.uid = uid;
+	packet.flight_sw_version = flight_sw_version;
+	packet.middleware_sw_version = middleware_sw_version;
+	packet.os_sw_version = os_sw_version;
+	packet.board_version = board_version;
+	packet.vendor_id = vendor_id;
+	packet.product_id = product_id;
+	mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a autopilot_version message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_t* autopilot_version)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_autopilot_version_send(chan, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)autopilot_version, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, capabilities);
+	_mav_put_uint64_t(buf, 8, uid);
+	_mav_put_uint32_t(buf, 16, flight_sw_version);
+	_mav_put_uint32_t(buf, 20, middleware_sw_version);
+	_mav_put_uint32_t(buf, 24, os_sw_version);
+	_mav_put_uint32_t(buf, 28, board_version);
+	_mav_put_uint16_t(buf, 32, vendor_id);
+	_mav_put_uint16_t(buf, 34, product_id);
+	_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
+	_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+#else
+	mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf;
+	packet->capabilities = capabilities;
+	packet->uid = uid;
+	packet->flight_sw_version = flight_sw_version;
+	packet->middleware_sw_version = middleware_sw_version;
+	packet->os_sw_version = os_sw_version;
+	packet->board_version = board_version;
+	packet->vendor_id = vendor_id;
+	packet->product_id = product_id;
+	mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
+	mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE AUTOPILOT_VERSION UNPACKING
+
+
+/**
+ * @brief Get field capabilities from autopilot_version message
+ *
+ * @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
+ */
+static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field flight_sw_version from autopilot_version message
+ *
+ * @return Firmware version number
+ */
+static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  16);
+}
+
+/**
+ * @brief Get field middleware_sw_version from autopilot_version message
+ *
+ * @return Middleware version number
+ */
+static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  20);
+}
+
+/**
+ * @brief Get field os_sw_version from autopilot_version message
+ *
+ * @return Operating system version number
+ */
+static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  24);
+}
+
+/**
+ * @brief Get field board_version from autopilot_version message
+ *
+ * @return HW / board version (last 8 bytes should be silicon ID, if any)
+ */
+static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  28);
+}
+
+/**
+ * @brief Get field flight_custom_version from autopilot_version message
+ *
+ * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ */
+static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version)
+{
+	return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8,  36);
+}
+
+/**
+ * @brief Get field middleware_custom_version from autopilot_version message
+ *
+ * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ */
+static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version)
+{
+	return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8,  44);
+}
+
+/**
+ * @brief Get field os_custom_version from autopilot_version message
+ *
+ * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
+ */
+static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version)
+{
+	return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8,  52);
+}
+
+/**
+ * @brief Get field vendor_id from autopilot_version message
+ *
+ * @return ID of the board vendor
+ */
+static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  32);
+}
+
+/**
+ * @brief Get field product_id from autopilot_version message
+ *
+ * @return ID of the product
+ */
+static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  34);
+}
+
+/**
+ * @brief Get field uid from autopilot_version message
+ *
+ * @return UID if provided by hardware
+ */
+static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  8);
+}
+
+/**
+ * @brief Decode a autopilot_version message into a struct
+ *
+ * @param msg The message to decode
+ * @param autopilot_version C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t* msg, mavlink_autopilot_version_t* autopilot_version)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg);
+	autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg);
+	autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg);
+	autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg);
+	autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg);
+	autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg);
+	autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg);
+	autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg);
+	mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version);
+	mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version);
+	mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN;
+        memset(autopilot_version, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
+	memcpy(autopilot_version, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_battery_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_battery_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_battery_status.h	(revision 209)
@@ -0,0 +1,404 @@
+// MESSAGE BATTERY_STATUS PACKING
+
+#define MAVLINK_MSG_ID_BATTERY_STATUS 147
+
+typedef struct MAVLINK_PACKED __mavlink_battery_status_t
+{
+ int32_t current_consumed; /*< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate*/
+ int32_t energy_consumed; /*< Consumed energy, in 100*Joules (intergrated U*I*dt)  (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate*/
+ int16_t temperature; /*< Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.*/
+ uint16_t voltages[10]; /*< Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.*/
+ int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/
+ uint8_t id; /*< Battery ID*/
+ uint8_t battery_function; /*< Function of the battery*/
+ uint8_t type; /*< Type (chemistry) of the battery*/
+ int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery*/
+} mavlink_battery_status_t;
+
+#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 36
+#define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36
+#define MAVLINK_MSG_ID_147_LEN 36
+#define MAVLINK_MSG_ID_147_MIN_LEN 36
+
+#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154
+#define MAVLINK_MSG_ID_147_CRC 154
+
+#define MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN 10
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
+	147, \
+	"BATTERY_STATUS", \
+	9, \
+	{  { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
+         { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
+         { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
+         { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
+         { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
+         { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
+	"BATTERY_STATUS", \
+	9, \
+	{  { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
+         { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
+         { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
+         { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
+         { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
+         { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a battery_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param id Battery ID
+ * @param battery_function Function of the battery
+ * @param type Type (chemistry) of the battery
+ * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
+ * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
+ * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt)  (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
+	_mav_put_int32_t(buf, 0, current_consumed);
+	_mav_put_int32_t(buf, 4, energy_consumed);
+	_mav_put_int16_t(buf, 8, temperature);
+	_mav_put_int16_t(buf, 30, current_battery);
+	_mav_put_uint8_t(buf, 32, id);
+	_mav_put_uint8_t(buf, 33, battery_function);
+	_mav_put_uint8_t(buf, 34, type);
+	_mav_put_int8_t(buf, 35, battery_remaining);
+	_mav_put_uint16_t_array(buf, 10, voltages, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
+#else
+	mavlink_battery_status_t packet;
+	packet.current_consumed = current_consumed;
+	packet.energy_consumed = energy_consumed;
+	packet.temperature = temperature;
+	packet.current_battery = current_battery;
+	packet.id = id;
+	packet.battery_function = battery_function;
+	packet.type = type;
+	packet.battery_remaining = battery_remaining;
+	mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a battery_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param id Battery ID
+ * @param battery_function Function of the battery
+ * @param type Type (chemistry) of the battery
+ * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
+ * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
+ * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt)  (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
+	_mav_put_int32_t(buf, 0, current_consumed);
+	_mav_put_int32_t(buf, 4, energy_consumed);
+	_mav_put_int16_t(buf, 8, temperature);
+	_mav_put_int16_t(buf, 30, current_battery);
+	_mav_put_uint8_t(buf, 32, id);
+	_mav_put_uint8_t(buf, 33, battery_function);
+	_mav_put_uint8_t(buf, 34, type);
+	_mav_put_int8_t(buf, 35, battery_remaining);
+	_mav_put_uint16_t_array(buf, 10, voltages, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
+#else
+	mavlink_battery_status_t packet;
+	packet.current_consumed = current_consumed;
+	packet.energy_consumed = energy_consumed;
+	packet.temperature = temperature;
+	packet.current_battery = current_battery;
+	packet.id = id;
+	packet.battery_function = battery_function;
+	packet.type = type;
+	packet.battery_remaining = battery_remaining;
+	mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a battery_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param battery_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
+{
+	return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
+}
+
+/**
+ * @brief Encode a battery_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param battery_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
+{
+	return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
+}
+
+/**
+ * @brief Send a battery_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param id Battery ID
+ * @param battery_function Function of the battery
+ * @param type Type (chemistry) of the battery
+ * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
+ * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
+ * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt)  (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
+	_mav_put_int32_t(buf, 0, current_consumed);
+	_mav_put_int32_t(buf, 4, energy_consumed);
+	_mav_put_int16_t(buf, 8, temperature);
+	_mav_put_int16_t(buf, 30, current_battery);
+	_mav_put_uint8_t(buf, 32, id);
+	_mav_put_uint8_t(buf, 33, battery_function);
+	_mav_put_uint8_t(buf, 34, type);
+	_mav_put_int8_t(buf, 35, battery_remaining);
+	_mav_put_uint16_t_array(buf, 10, voltages, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+#else
+	mavlink_battery_status_t packet;
+	packet.current_consumed = current_consumed;
+	packet.energy_consumed = energy_consumed;
+	packet.temperature = temperature;
+	packet.current_battery = current_battery;
+	packet.id = id;
+	packet.battery_function = battery_function;
+	packet.type = type;
+	packet.battery_remaining = battery_remaining;
+	mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a battery_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan, const mavlink_battery_status_t* battery_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)battery_status, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_BATTERY_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, current_consumed);
+	_mav_put_int32_t(buf, 4, energy_consumed);
+	_mav_put_int16_t(buf, 8, temperature);
+	_mav_put_int16_t(buf, 30, current_battery);
+	_mav_put_uint8_t(buf, 32, id);
+	_mav_put_uint8_t(buf, 33, battery_function);
+	_mav_put_uint8_t(buf, 34, type);
+	_mav_put_int8_t(buf, 35, battery_remaining);
+	_mav_put_uint16_t_array(buf, 10, voltages, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+#else
+	mavlink_battery_status_t *packet = (mavlink_battery_status_t *)msgbuf;
+	packet->current_consumed = current_consumed;
+	packet->energy_consumed = energy_consumed;
+	packet->temperature = temperature;
+	packet->current_battery = current_battery;
+	packet->id = id;
+	packet->battery_function = battery_function;
+	packet->type = type;
+	packet->battery_remaining = battery_remaining;
+	mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE BATTERY_STATUS UNPACKING
+
+
+/**
+ * @brief Get field id from battery_status message
+ *
+ * @return Battery ID
+ */
+static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field battery_function from battery_status message
+ *
+ * @return Function of the battery
+ */
+static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field type from battery_status message
+ *
+ * @return Type (chemistry) of the battery
+ */
+static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field temperature from battery_status message
+ *
+ * @return Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
+ */
+static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field voltages from battery_status message
+ *
+ * @return Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
+ */
+static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t* msg, uint16_t *voltages)
+{
+	return _MAV_RETURN_uint16_t_array(msg, voltages, 10,  10);
+}
+
+/**
+ * @brief Get field current_battery from battery_status message
+ *
+ * @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ */
+static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  30);
+}
+
+/**
+ * @brief Get field current_consumed from battery_status message
+ *
+ * @return Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
+ */
+static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field energy_consumed from battery_status message
+ *
+ * @return Consumed energy, in 100*Joules (intergrated U*I*dt)  (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
+ */
+static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field battery_remaining from battery_status message
+ *
+ * @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
+ */
+static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int8_t(msg,  35);
+}
+
+/**
+ * @brief Decode a battery_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param battery_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg);
+	battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg);
+	battery_status->temperature = mavlink_msg_battery_status_get_temperature(msg);
+	mavlink_msg_battery_status_get_voltages(msg, battery_status->voltages);
+	battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg);
+	battery_status->id = mavlink_msg_battery_status_get_id(msg);
+	battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg);
+	battery_status->type = mavlink_msg_battery_status_get_type(msg);
+	battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY_STATUS_LEN? msg->len : MAVLINK_MSG_ID_BATTERY_STATUS_LEN;
+        memset(battery_status, 0, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
+	memcpy(battery_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_camera_trigger.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_camera_trigger.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_camera_trigger.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE CAMERA_TRIGGER PACKING
+
+#define MAVLINK_MSG_ID_CAMERA_TRIGGER 112
+
+typedef struct MAVLINK_PACKED __mavlink_camera_trigger_t
+{
+ uint64_t time_usec; /*< Timestamp for the image frame in microseconds*/
+ uint32_t seq; /*< Image frame sequence*/
+} mavlink_camera_trigger_t;
+
+#define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12
+#define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12
+#define MAVLINK_MSG_ID_112_LEN 12
+#define MAVLINK_MSG_ID_112_MIN_LEN 12
+
+#define MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC 174
+#define MAVLINK_MSG_ID_112_CRC 174
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
+	112, \
+	"CAMERA_TRIGGER", \
+	2, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
+	"CAMERA_TRIGGER", \
+	2, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a camera_trigger message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp for the image frame in microseconds
+ * @param seq Image frame sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint32_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
+#else
+	mavlink_camera_trigger_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+}
+
+/**
+ * @brief Pack a camera_trigger message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp for the image frame in microseconds
+ * @param seq Image frame sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint32_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
+#else
+	mavlink_camera_trigger_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+}
+
+/**
+ * @brief Encode a camera_trigger struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param camera_trigger C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
+{
+	return mavlink_msg_camera_trigger_pack(system_id, component_id, msg, camera_trigger->time_usec, camera_trigger->seq);
+}
+
+/**
+ * @brief Encode a camera_trigger struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param camera_trigger C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
+{
+	return mavlink_msg_camera_trigger_pack_chan(system_id, component_id, chan, msg, camera_trigger->time_usec, camera_trigger->seq);
+}
+
+/**
+ * @brief Send a camera_trigger message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp for the image frame in microseconds
+ * @param seq Image frame sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+#else
+	mavlink_camera_trigger_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+#endif
+}
+
+/**
+ * @brief Send a camera_trigger message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_camera_trigger_send_struct(mavlink_channel_t chan, const mavlink_camera_trigger_t* camera_trigger)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_camera_trigger_send(chan, camera_trigger->time_usec, camera_trigger->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)camera_trigger, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint32_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+#else
+	mavlink_camera_trigger_t *packet = (mavlink_camera_trigger_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE CAMERA_TRIGGER UNPACKING
+
+
+/**
+ * @brief Get field time_usec from camera_trigger message
+ *
+ * @return Timestamp for the image frame in microseconds
+ */
+static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field seq from camera_trigger message
+ *
+ * @return Image frame sequence
+ */
+static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Decode a camera_trigger message into a struct
+ *
+ * @param msg The message to decode
+ * @param camera_trigger C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_camera_trigger_decode(const mavlink_message_t* msg, mavlink_camera_trigger_t* camera_trigger)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	camera_trigger->time_usec = mavlink_msg_camera_trigger_get_time_usec(msg);
+	camera_trigger->seq = mavlink_msg_camera_trigger_get_seq(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN;
+        memset(camera_trigger, 0, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
+	memcpy(camera_trigger, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE CHANGE_OPERATOR_CONTROL PACKING
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5
+
+typedef struct MAVLINK_PACKED __mavlink_change_operator_control_t
+{
+ uint8_t target_system; /*< System the GCS requests control for*/
+ uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
+ uint8_t version; /*< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/
+ char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/
+} mavlink_change_operator_control_t;
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28
+#define MAVLINK_MSG_ID_5_LEN 28
+#define MAVLINK_MSG_ID_5_MIN_LEN 28
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217
+#define MAVLINK_MSG_ID_5_CRC 217
+
+#define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
+	5, \
+	"CHANGE_OPERATOR_CONTROL", \
+	4, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
+         { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
+         { "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
+         { "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
+	"CHANGE_OPERATOR_CONTROL", \
+	4, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
+         { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
+         { "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
+         { "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a change_operator_control message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System the GCS requests control for
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
+ * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, version);
+	_mav_put_char_array(buf, 3, passkey, 25);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
+#else
+	mavlink_change_operator_control_t packet;
+	packet.target_system = target_system;
+	packet.control_request = control_request;
+	packet.version = version;
+	mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+}
+
+/**
+ * @brief Pack a change_operator_control message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System the GCS requests control for
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
+ * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, version);
+	_mav_put_char_array(buf, 3, passkey, 25);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
+#else
+	mavlink_change_operator_control_t packet;
+	packet.target_system = target_system;
+	packet.control_request = control_request;
+	packet.version = version;
+	mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+}
+
+/**
+ * @brief Encode a change_operator_control struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param change_operator_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
+{
+	return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
+}
+
+/**
+ * @brief Encode a change_operator_control struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param change_operator_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
+{
+	return mavlink_msg_change_operator_control_pack_chan(system_id, component_id, chan, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
+}
+
+/**
+ * @brief Send a change_operator_control message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System the GCS requests control for
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
+ * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, version);
+	_mav_put_char_array(buf, 3, passkey, 25);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+#else
+	mavlink_change_operator_control_t packet;
+	packet.target_system = target_system;
+	packet.control_request = control_request;
+	packet.version = version;
+	mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a change_operator_control message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_change_operator_control_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_t* change_operator_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_change_operator_control_send(chan, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)change_operator_control, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, version);
+	_mav_put_char_array(buf, 3, passkey, 25);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+#else
+	mavlink_change_operator_control_t *packet = (mavlink_change_operator_control_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->control_request = control_request;
+	packet->version = version;
+	mav_array_memcpy(packet->passkey, passkey, sizeof(char)*25);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE CHANGE_OPERATOR_CONTROL UNPACKING
+
+
+/**
+ * @brief Get field target_system from change_operator_control message
+ *
+ * @return System the GCS requests control for
+ */
+static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field control_request from change_operator_control message
+ *
+ * @return 0: request control of this MAV, 1: Release control of this MAV
+ */
+static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field version from change_operator_control message
+ *
+ * @return 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
+ */
+static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field passkey from change_operator_control message
+ *
+ * @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
+ */
+static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey)
+{
+	return _MAV_RETURN_char_array(msg, passkey, 25,  3);
+}
+
+/**
+ * @brief Decode a change_operator_control message into a struct
+ *
+ * @param msg The message to decode
+ * @param change_operator_control C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_change_operator_control_decode(const mavlink_message_t* msg, mavlink_change_operator_control_t* change_operator_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg);
+	change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg);
+	change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg);
+	mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN;
+        memset(change_operator_control, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
+	memcpy(change_operator_control, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control_ack.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control_ack.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_change_operator_control_ack.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6
+
+typedef struct MAVLINK_PACKED __mavlink_change_operator_control_ack_t
+{
+ uint8_t gcs_system_id; /*< ID of the GCS this message */
+ uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
+ uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/
+} mavlink_change_operator_control_ack_t;
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN 3
+#define MAVLINK_MSG_ID_6_LEN 3
+#define MAVLINK_MSG_ID_6_MIN_LEN 3
+
+#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104
+#define MAVLINK_MSG_ID_6_CRC 104
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
+	6, \
+	"CHANGE_OPERATOR_CONTROL_ACK", \
+	3, \
+	{  { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
+         { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
+         { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
+	"CHANGE_OPERATOR_CONTROL_ACK", \
+	3, \
+	{  { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
+         { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
+         { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a change_operator_control_ack message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param gcs_system_id ID of the GCS this message 
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, gcs_system_id);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, ack);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
+#else
+	mavlink_change_operator_control_ack_t packet;
+	packet.gcs_system_id = gcs_system_id;
+	packet.control_request = control_request;
+	packet.ack = ack;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+}
+
+/**
+ * @brief Pack a change_operator_control_ack message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gcs_system_id ID of the GCS this message 
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t gcs_system_id,uint8_t control_request,uint8_t ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, gcs_system_id);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, ack);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
+#else
+	mavlink_change_operator_control_ack_t packet;
+	packet.gcs_system_id = gcs_system_id;
+	packet.control_request = control_request;
+	packet.ack = ack;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+}
+
+/**
+ * @brief Encode a change_operator_control_ack struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param change_operator_control_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
+{
+	return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
+}
+
+/**
+ * @brief Encode a change_operator_control_ack struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param change_operator_control_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
+{
+	return mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, chan, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
+}
+
+/**
+ * @brief Send a change_operator_control_ack message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param gcs_system_id ID of the GCS this message 
+ * @param control_request 0: request control of this MAV, 1: Release control of this MAV
+ * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, gcs_system_id);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, ack);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+#else
+	mavlink_change_operator_control_ack_t packet;
+	packet.gcs_system_id = gcs_system_id;
+	packet.control_request = control_request;
+	packet.ack = ack;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a change_operator_control_ack message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_change_operator_control_ack_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_change_operator_control_ack_send(chan, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)change_operator_control_ack, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, gcs_system_id);
+	_mav_put_uint8_t(buf, 1, control_request);
+	_mav_put_uint8_t(buf, 2, ack);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+#else
+	mavlink_change_operator_control_ack_t *packet = (mavlink_change_operator_control_ack_t *)msgbuf;
+	packet->gcs_system_id = gcs_system_id;
+	packet->control_request = control_request;
+	packet->ack = ack;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE CHANGE_OPERATOR_CONTROL_ACK UNPACKING
+
+
+/**
+ * @brief Get field gcs_system_id from change_operator_control_ack message
+ *
+ * @return ID of the GCS this message 
+ */
+static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field control_request from change_operator_control_ack message
+ *
+ * @return 0: request control of this MAV, 1: Release control of this MAV
+ */
+static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field ack from change_operator_control_ack message
+ *
+ * @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
+ */
+static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Decode a change_operator_control_ack message into a struct
+ *
+ * @param msg The message to decode
+ * @param change_operator_control_ack C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_message_t* msg, mavlink_change_operator_control_ack_t* change_operator_control_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg);
+	change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg);
+	change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN;
+        memset(change_operator_control_ack, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
+	memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_ack.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_ack.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_ack.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE COMMAND_ACK PACKING
+
+#define MAVLINK_MSG_ID_COMMAND_ACK 77
+
+typedef struct MAVLINK_PACKED __mavlink_command_ack_t
+{
+ uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/
+ uint8_t result; /*< See MAV_RESULT enum*/
+} mavlink_command_ack_t;
+
+#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3
+#define MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN 3
+#define MAVLINK_MSG_ID_77_LEN 3
+#define MAVLINK_MSG_ID_77_MIN_LEN 3
+
+#define MAVLINK_MSG_ID_COMMAND_ACK_CRC 143
+#define MAVLINK_MSG_ID_77_CRC 143
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
+	77, \
+	"COMMAND_ACK", \
+	2, \
+	{  { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
+         { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
+	"COMMAND_ACK", \
+	2, \
+	{  { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
+         { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a command_ack message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param result See MAV_RESULT enum
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t command, uint8_t result)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
+	_mav_put_uint16_t(buf, 0, command);
+	_mav_put_uint8_t(buf, 2, result);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
+#else
+	mavlink_command_ack_t packet;
+	packet.command = command;
+	packet.result = result;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+}
+
+/**
+ * @brief Pack a command_ack message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param result See MAV_RESULT enum
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t command,uint8_t result)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
+	_mav_put_uint16_t(buf, 0, command);
+	_mav_put_uint8_t(buf, 2, result);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
+#else
+	mavlink_command_ack_t packet;
+	packet.command = command;
+	packet.result = result;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+}
+
+/**
+ * @brief Encode a command_ack struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param command_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
+{
+	return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result);
+}
+
+/**
+ * @brief Encode a command_ack struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param command_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
+{
+	return mavlink_msg_command_ack_pack_chan(system_id, component_id, chan, msg, command_ack->command, command_ack->result);
+}
+
+/**
+ * @brief Send a command_ack message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param result See MAV_RESULT enum
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
+	_mav_put_uint16_t(buf, 0, command);
+	_mav_put_uint8_t(buf, 2, result);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+#else
+	mavlink_command_ack_t packet;
+	packet.command = command;
+	packet.result = result;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a command_ack message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_command_ack_send_struct(mavlink_channel_t chan, const mavlink_command_ack_t* command_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_command_ack_send(chan, command_ack->command, command_ack->result);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)command_ack, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_COMMAND_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t command, uint8_t result)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, command);
+	_mav_put_uint8_t(buf, 2, result);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+#else
+	mavlink_command_ack_t *packet = (mavlink_command_ack_t *)msgbuf;
+	packet->command = command;
+	packet->result = result;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE COMMAND_ACK UNPACKING
+
+
+/**
+ * @brief Get field command from command_ack message
+ *
+ * @return Command ID, as defined by MAV_CMD enum.
+ */
+static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field result from command_ack message
+ *
+ * @return See MAV_RESULT enum
+ */
+static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Decode a command_ack message into a struct
+ *
+ * @param msg The message to decode
+ * @param command_ack C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	command_ack->command = mavlink_msg_command_ack_get_command(msg);
+	command_ack->result = mavlink_msg_command_ack_get_result(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_ACK_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_ACK_LEN;
+        memset(command_ack, 0, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
+	memcpy(command_ack, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_int.h	(revision 209)
@@ -0,0 +1,512 @@
+// MESSAGE COMMAND_INT PACKING
+
+#define MAVLINK_MSG_ID_COMMAND_INT 75
+
+typedef struct MAVLINK_PACKED __mavlink_command_int_t
+{
+ float param1; /*< PARAM1, see MAV_CMD enum*/
+ float param2; /*< PARAM2, see MAV_CMD enum*/
+ float param3; /*< PARAM3, see MAV_CMD enum*/
+ float param4; /*< PARAM4, see MAV_CMD enum*/
+ int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
+ int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/
+ float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/
+ uint16_t command; /*< The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t frame; /*< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h*/
+ uint8_t current; /*< false:0, true:1*/
+ uint8_t autocontinue; /*< autocontinue to next wp*/
+} mavlink_command_int_t;
+
+#define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
+#define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35
+#define MAVLINK_MSG_ID_75_LEN 35
+#define MAVLINK_MSG_ID_75_MIN_LEN 35
+
+#define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
+#define MAVLINK_MSG_ID_75_CRC 158
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
+	75, \
+	"COMMAND_INT", \
+	13, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
+	"COMMAND_INT", \
+	13, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a command_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, frame);
+	_mav_put_uint8_t(buf, 33, current);
+	_mav_put_uint8_t(buf, 34, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
+#else
+	mavlink_command_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+}
+
+/**
+ * @brief Pack a command_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, frame);
+	_mav_put_uint8_t(buf, 33, current);
+	_mav_put_uint8_t(buf, 34, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
+#else
+	mavlink_command_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+}
+
+/**
+ * @brief Encode a command_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param command_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
+{
+	return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
+}
+
+/**
+ * @brief Encode a command_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param command_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
+{
+	return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
+}
+
+/**
+ * @brief Send a command_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, frame);
+	_mav_put_uint8_t(buf, 33, current);
+	_mav_put_uint8_t(buf, 34, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+#else
+	mavlink_command_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a command_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, frame);
+	_mav_put_uint8_t(buf, 33, current);
+	_mav_put_uint8_t(buf, 34, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+#else
+	mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
+	packet->param1 = param1;
+	packet->param2 = param2;
+	packet->param3 = param3;
+	packet->param4 = param4;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->command = command;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->frame = frame;
+	packet->current = current;
+	packet->autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE COMMAND_INT UNPACKING
+
+
+/**
+ * @brief Get field target_system from command_int message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  30);
+}
+
+/**
+ * @brief Get field target_component from command_int message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  31);
+}
+
+/**
+ * @brief Get field frame from command_int message
+ *
+ * @return The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
+ */
+static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field command from command_int message
+ *
+ * @return The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
+ */
+static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field current from command_int message
+ *
+ * @return false:0, true:1
+ */
+static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field autocontinue from command_int message
+ *
+ * @return autocontinue to next wp
+ */
+static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field param1 from command_int message
+ *
+ * @return PARAM1, see MAV_CMD enum
+ */
+static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param2 from command_int message
+ *
+ * @return PARAM2, see MAV_CMD enum
+ */
+static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field param3 from command_int message
+ *
+ * @return PARAM3, see MAV_CMD enum
+ */
+static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field param4 from command_int message
+ *
+ * @return PARAM4, see MAV_CMD enum
+ */
+static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field x from command_int message
+ *
+ * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ */
+static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field y from command_int message
+ *
+ * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
+ */
+static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  20);
+}
+
+/**
+ * @brief Get field z from command_int message
+ *
+ * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ */
+static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a command_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param command_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	command_int->param1 = mavlink_msg_command_int_get_param1(msg);
+	command_int->param2 = mavlink_msg_command_int_get_param2(msg);
+	command_int->param3 = mavlink_msg_command_int_get_param3(msg);
+	command_int->param4 = mavlink_msg_command_int_get_param4(msg);
+	command_int->x = mavlink_msg_command_int_get_x(msg);
+	command_int->y = mavlink_msg_command_int_get_y(msg);
+	command_int->z = mavlink_msg_command_int_get_z(msg);
+	command_int->command = mavlink_msg_command_int_get_command(msg);
+	command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
+	command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
+	command_int->frame = mavlink_msg_command_int_get_frame(msg);
+	command_int->current = mavlink_msg_command_int_get_current(msg);
+	command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
+        memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
+	memcpy(command_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_long.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_long.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_long.h	(revision 209)
@@ -0,0 +1,462 @@
+// MESSAGE COMMAND_LONG PACKING
+
+#define MAVLINK_MSG_ID_COMMAND_LONG 76
+
+typedef struct MAVLINK_PACKED __mavlink_command_long_t
+{
+ float param1; /*< Parameter 1, as defined by MAV_CMD enum.*/
+ float param2; /*< Parameter 2, as defined by MAV_CMD enum.*/
+ float param3; /*< Parameter 3, as defined by MAV_CMD enum.*/
+ float param4; /*< Parameter 4, as defined by MAV_CMD enum.*/
+ float param5; /*< Parameter 5, as defined by MAV_CMD enum.*/
+ float param6; /*< Parameter 6, as defined by MAV_CMD enum.*/
+ float param7; /*< Parameter 7, as defined by MAV_CMD enum.*/
+ uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/
+ uint8_t target_system; /*< System which should execute the command*/
+ uint8_t target_component; /*< Component which should execute the command, 0 for all components*/
+ uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/
+} mavlink_command_long_t;
+
+#define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33
+#define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33
+#define MAVLINK_MSG_ID_76_LEN 33
+#define MAVLINK_MSG_ID_76_MIN_LEN 33
+
+#define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152
+#define MAVLINK_MSG_ID_76_CRC 152
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
+	76, \
+	"COMMAND_LONG", \
+	11, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
+         { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
+         { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
+         { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
+         { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
+	"COMMAND_LONG", \
+	11, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
+         { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
+         { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
+         { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
+         { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a command_long message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System which should execute the command
+ * @param target_component Component which should execute the command, 0 for all components
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
+ * @param param1 Parameter 1, as defined by MAV_CMD enum.
+ * @param param2 Parameter 2, as defined by MAV_CMD enum.
+ * @param param3 Parameter 3, as defined by MAV_CMD enum.
+ * @param param4 Parameter 4, as defined by MAV_CMD enum.
+ * @param param5 Parameter 5, as defined by MAV_CMD enum.
+ * @param param6 Parameter 6, as defined by MAV_CMD enum.
+ * @param param7 Parameter 7, as defined by MAV_CMD enum.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, param5);
+	_mav_put_float(buf, 20, param6);
+	_mav_put_float(buf, 24, param7);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, confirmation);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
+#else
+	mavlink_command_long_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.param5 = param5;
+	packet.param6 = param6;
+	packet.param7 = param7;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.confirmation = confirmation;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+}
+
+/**
+ * @brief Pack a command_long message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System which should execute the command
+ * @param target_component Component which should execute the command, 0 for all components
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
+ * @param param1 Parameter 1, as defined by MAV_CMD enum.
+ * @param param2 Parameter 2, as defined by MAV_CMD enum.
+ * @param param3 Parameter 3, as defined by MAV_CMD enum.
+ * @param param4 Parameter 4, as defined by MAV_CMD enum.
+ * @param param5 Parameter 5, as defined by MAV_CMD enum.
+ * @param param6 Parameter 6, as defined by MAV_CMD enum.
+ * @param param7 Parameter 7, as defined by MAV_CMD enum.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, param5);
+	_mav_put_float(buf, 20, param6);
+	_mav_put_float(buf, 24, param7);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, confirmation);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
+#else
+	mavlink_command_long_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.param5 = param5;
+	packet.param6 = param6;
+	packet.param7 = param7;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.confirmation = confirmation;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+}
+
+/**
+ * @brief Encode a command_long struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param command_long C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
+{
+	return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
+}
+
+/**
+ * @brief Encode a command_long struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param command_long C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
+{
+	return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
+}
+
+/**
+ * @brief Send a command_long message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System which should execute the command
+ * @param target_component Component which should execute the command, 0 for all components
+ * @param command Command ID, as defined by MAV_CMD enum.
+ * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
+ * @param param1 Parameter 1, as defined by MAV_CMD enum.
+ * @param param2 Parameter 2, as defined by MAV_CMD enum.
+ * @param param3 Parameter 3, as defined by MAV_CMD enum.
+ * @param param4 Parameter 4, as defined by MAV_CMD enum.
+ * @param param5 Parameter 5, as defined by MAV_CMD enum.
+ * @param param6 Parameter 6, as defined by MAV_CMD enum.
+ * @param param7 Parameter 7, as defined by MAV_CMD enum.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, param5);
+	_mav_put_float(buf, 20, param6);
+	_mav_put_float(buf, 24, param7);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, confirmation);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+#else
+	mavlink_command_long_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.param5 = param5;
+	packet.param6 = param6;
+	packet.param7 = param7;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.confirmation = confirmation;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+#endif
+}
+
+/**
+ * @brief Send a command_long message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_command_long_send_struct(mavlink_channel_t chan, const mavlink_command_long_t* command_long)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_command_long_send(chan, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)command_long, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_COMMAND_LONG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, param5);
+	_mav_put_float(buf, 20, param6);
+	_mav_put_float(buf, 24, param7);
+	_mav_put_uint16_t(buf, 28, command);
+	_mav_put_uint8_t(buf, 30, target_system);
+	_mav_put_uint8_t(buf, 31, target_component);
+	_mav_put_uint8_t(buf, 32, confirmation);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+#else
+	mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf;
+	packet->param1 = param1;
+	packet->param2 = param2;
+	packet->param3 = param3;
+	packet->param4 = param4;
+	packet->param5 = param5;
+	packet->param6 = param6;
+	packet->param7 = param7;
+	packet->command = command;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->confirmation = confirmation;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE COMMAND_LONG UNPACKING
+
+
+/**
+ * @brief Get field target_system from command_long message
+ *
+ * @return System which should execute the command
+ */
+static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  30);
+}
+
+/**
+ * @brief Get field target_component from command_long message
+ *
+ * @return Component which should execute the command, 0 for all components
+ */
+static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  31);
+}
+
+/**
+ * @brief Get field command from command_long message
+ *
+ * @return Command ID, as defined by MAV_CMD enum.
+ */
+static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field confirmation from command_long message
+ *
+ * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
+ */
+static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field param1 from command_long message
+ *
+ * @return Parameter 1, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param2 from command_long message
+ *
+ * @return Parameter 2, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field param3 from command_long message
+ *
+ * @return Parameter 3, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field param4 from command_long message
+ *
+ * @return Parameter 4, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field param5 from command_long message
+ *
+ * @return Parameter 5, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field param6 from command_long message
+ *
+ * @return Parameter 6, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field param7 from command_long message
+ *
+ * @return Parameter 7, as defined by MAV_CMD enum.
+ */
+static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a command_long message into a struct
+ *
+ * @param msg The message to decode
+ * @param command_long C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, mavlink_command_long_t* command_long)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	command_long->param1 = mavlink_msg_command_long_get_param1(msg);
+	command_long->param2 = mavlink_msg_command_long_get_param2(msg);
+	command_long->param3 = mavlink_msg_command_long_get_param3(msg);
+	command_long->param4 = mavlink_msg_command_long_get_param4(msg);
+	command_long->param5 = mavlink_msg_command_long_get_param5(msg);
+	command_long->param6 = mavlink_msg_command_long_get_param6(msg);
+	command_long->param7 = mavlink_msg_command_long_get_param7(msg);
+	command_long->command = mavlink_msg_command_long_get_command(msg);
+	command_long->target_system = mavlink_msg_command_long_get_target_system(msg);
+	command_long->target_component = mavlink_msg_command_long_get_target_component(msg);
+	command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_LONG_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_LONG_LEN;
+        memset(command_long, 0, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
+	memcpy(command_long, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_control_system_state.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_control_system_state.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_control_system_state.h	(revision 209)
@@ -0,0 +1,606 @@
+// MESSAGE CONTROL_SYSTEM_STATE PACKING
+
+#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE 146
+
+typedef struct MAVLINK_PACKED __mavlink_control_system_state_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float x_acc; /*< X acceleration in body frame*/
+ float y_acc; /*< Y acceleration in body frame*/
+ float z_acc; /*< Z acceleration in body frame*/
+ float x_vel; /*< X velocity in body frame*/
+ float y_vel; /*< Y velocity in body frame*/
+ float z_vel; /*< Z velocity in body frame*/
+ float x_pos; /*< X position in local frame*/
+ float y_pos; /*< Y position in local frame*/
+ float z_pos; /*< Z position in local frame*/
+ float airspeed; /*< Airspeed, set to -1 if unknown*/
+ float vel_variance[3]; /*< Variance of body velocity estimate*/
+ float pos_variance[3]; /*< Variance in local position*/
+ float q[4]; /*< The attitude, represented as Quaternion*/
+ float roll_rate; /*< Angular rate in roll axis*/
+ float pitch_rate; /*< Angular rate in pitch axis*/
+ float yaw_rate; /*< Angular rate in yaw axis*/
+} mavlink_control_system_state_t;
+
+#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN 100
+#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN 100
+#define MAVLINK_MSG_ID_146_LEN 100
+#define MAVLINK_MSG_ID_146_MIN_LEN 100
+
+#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC 103
+#define MAVLINK_MSG_ID_146_CRC 103
+
+#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_VEL_VARIANCE_LEN 3
+#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_POS_VARIANCE_LEN 3
+#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
+	146, \
+	"CONTROL_SYSTEM_STATE", \
+	17, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
+         { "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
+         { "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
+         { "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
+         { "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
+         { "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
+         { "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
+         { "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
+         { "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
+         { "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
+         { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
+         { "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
+         { "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
+         { "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
+         { "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
+	"CONTROL_SYSTEM_STATE", \
+	17, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
+         { "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
+         { "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
+         { "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
+         { "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
+         { "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
+         { "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
+         { "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
+         { "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
+         { "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
+         { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
+         { "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
+         { "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
+         { "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
+         { "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a control_system_state message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param x_acc X acceleration in body frame
+ * @param y_acc Y acceleration in body frame
+ * @param z_acc Z acceleration in body frame
+ * @param x_vel X velocity in body frame
+ * @param y_vel Y velocity in body frame
+ * @param z_vel Z velocity in body frame
+ * @param x_pos X position in local frame
+ * @param y_pos Y position in local frame
+ * @param z_pos Z position in local frame
+ * @param airspeed Airspeed, set to -1 if unknown
+ * @param vel_variance Variance of body velocity estimate
+ * @param pos_variance Variance in local position
+ * @param q The attitude, represented as Quaternion
+ * @param roll_rate Angular rate in roll axis
+ * @param pitch_rate Angular rate in pitch axis
+ * @param yaw_rate Angular rate in yaw axis
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x_acc);
+	_mav_put_float(buf, 12, y_acc);
+	_mav_put_float(buf, 16, z_acc);
+	_mav_put_float(buf, 20, x_vel);
+	_mav_put_float(buf, 24, y_vel);
+	_mav_put_float(buf, 28, z_vel);
+	_mav_put_float(buf, 32, x_pos);
+	_mav_put_float(buf, 36, y_pos);
+	_mav_put_float(buf, 40, z_pos);
+	_mav_put_float(buf, 44, airspeed);
+	_mav_put_float(buf, 88, roll_rate);
+	_mav_put_float(buf, 92, pitch_rate);
+	_mav_put_float(buf, 96, yaw_rate);
+	_mav_put_float_array(buf, 48, vel_variance, 3);
+	_mav_put_float_array(buf, 60, pos_variance, 3);
+	_mav_put_float_array(buf, 72, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
+#else
+	mavlink_control_system_state_t packet;
+	packet.time_usec = time_usec;
+	packet.x_acc = x_acc;
+	packet.y_acc = y_acc;
+	packet.z_acc = z_acc;
+	packet.x_vel = x_vel;
+	packet.y_vel = y_vel;
+	packet.z_vel = z_vel;
+	packet.x_pos = x_pos;
+	packet.y_pos = y_pos;
+	packet.z_pos = z_pos;
+	packet.airspeed = airspeed;
+	packet.roll_rate = roll_rate;
+	packet.pitch_rate = pitch_rate;
+	packet.yaw_rate = yaw_rate;
+	mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+}
+
+/**
+ * @brief Pack a control_system_state message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param x_acc X acceleration in body frame
+ * @param y_acc Y acceleration in body frame
+ * @param z_acc Z acceleration in body frame
+ * @param x_vel X velocity in body frame
+ * @param y_vel Y velocity in body frame
+ * @param z_vel Z velocity in body frame
+ * @param x_pos X position in local frame
+ * @param y_pos Y position in local frame
+ * @param z_pos Z position in local frame
+ * @param airspeed Airspeed, set to -1 if unknown
+ * @param vel_variance Variance of body velocity estimate
+ * @param pos_variance Variance in local position
+ * @param q The attitude, represented as Quaternion
+ * @param roll_rate Angular rate in roll axis
+ * @param pitch_rate Angular rate in pitch axis
+ * @param yaw_rate Angular rate in yaw axis
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float x_acc,float y_acc,float z_acc,float x_vel,float y_vel,float z_vel,float x_pos,float y_pos,float z_pos,float airspeed,const float *vel_variance,const float *pos_variance,const float *q,float roll_rate,float pitch_rate,float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x_acc);
+	_mav_put_float(buf, 12, y_acc);
+	_mav_put_float(buf, 16, z_acc);
+	_mav_put_float(buf, 20, x_vel);
+	_mav_put_float(buf, 24, y_vel);
+	_mav_put_float(buf, 28, z_vel);
+	_mav_put_float(buf, 32, x_pos);
+	_mav_put_float(buf, 36, y_pos);
+	_mav_put_float(buf, 40, z_pos);
+	_mav_put_float(buf, 44, airspeed);
+	_mav_put_float(buf, 88, roll_rate);
+	_mav_put_float(buf, 92, pitch_rate);
+	_mav_put_float(buf, 96, yaw_rate);
+	_mav_put_float_array(buf, 48, vel_variance, 3);
+	_mav_put_float_array(buf, 60, pos_variance, 3);
+	_mav_put_float_array(buf, 72, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
+#else
+	mavlink_control_system_state_t packet;
+	packet.time_usec = time_usec;
+	packet.x_acc = x_acc;
+	packet.y_acc = y_acc;
+	packet.z_acc = z_acc;
+	packet.x_vel = x_vel;
+	packet.y_vel = y_vel;
+	packet.z_vel = z_vel;
+	packet.x_pos = x_pos;
+	packet.y_pos = y_pos;
+	packet.z_pos = z_pos;
+	packet.airspeed = airspeed;
+	packet.roll_rate = roll_rate;
+	packet.pitch_rate = pitch_rate;
+	packet.yaw_rate = yaw_rate;
+	mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+}
+
+/**
+ * @brief Encode a control_system_state struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param control_system_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_control_system_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
+{
+	return mavlink_msg_control_system_state_pack(system_id, component_id, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
+}
+
+/**
+ * @brief Encode a control_system_state struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param control_system_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
+{
+	return mavlink_msg_control_system_state_pack_chan(system_id, component_id, chan, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
+}
+
+/**
+ * @brief Send a control_system_state message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param x_acc X acceleration in body frame
+ * @param y_acc Y acceleration in body frame
+ * @param z_acc Z acceleration in body frame
+ * @param x_vel X velocity in body frame
+ * @param y_vel Y velocity in body frame
+ * @param z_vel Z velocity in body frame
+ * @param x_pos X position in local frame
+ * @param y_pos Y position in local frame
+ * @param z_pos Z position in local frame
+ * @param airspeed Airspeed, set to -1 if unknown
+ * @param vel_variance Variance of body velocity estimate
+ * @param pos_variance Variance in local position
+ * @param q The attitude, represented as Quaternion
+ * @param roll_rate Angular rate in roll axis
+ * @param pitch_rate Angular rate in pitch axis
+ * @param yaw_rate Angular rate in yaw axis
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_control_system_state_send(mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x_acc);
+	_mav_put_float(buf, 12, y_acc);
+	_mav_put_float(buf, 16, z_acc);
+	_mav_put_float(buf, 20, x_vel);
+	_mav_put_float(buf, 24, y_vel);
+	_mav_put_float(buf, 28, z_vel);
+	_mav_put_float(buf, 32, x_pos);
+	_mav_put_float(buf, 36, y_pos);
+	_mav_put_float(buf, 40, z_pos);
+	_mav_put_float(buf, 44, airspeed);
+	_mav_put_float(buf, 88, roll_rate);
+	_mav_put_float(buf, 92, pitch_rate);
+	_mav_put_float(buf, 96, yaw_rate);
+	_mav_put_float_array(buf, 48, vel_variance, 3);
+	_mav_put_float_array(buf, 60, pos_variance, 3);
+	_mav_put_float_array(buf, 72, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+#else
+	mavlink_control_system_state_t packet;
+	packet.time_usec = time_usec;
+	packet.x_acc = x_acc;
+	packet.y_acc = y_acc;
+	packet.z_acc = z_acc;
+	packet.x_vel = x_vel;
+	packet.y_vel = y_vel;
+	packet.z_vel = z_vel;
+	packet.x_pos = x_pos;
+	packet.y_pos = y_pos;
+	packet.z_pos = z_pos;
+	packet.airspeed = airspeed;
+	packet.roll_rate = roll_rate;
+	packet.pitch_rate = pitch_rate;
+	packet.yaw_rate = yaw_rate;
+	mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a control_system_state message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_control_system_state_send_struct(mavlink_channel_t chan, const mavlink_control_system_state_t* control_system_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_control_system_state_send(chan, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)control_system_state, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x_acc);
+	_mav_put_float(buf, 12, y_acc);
+	_mav_put_float(buf, 16, z_acc);
+	_mav_put_float(buf, 20, x_vel);
+	_mav_put_float(buf, 24, y_vel);
+	_mav_put_float(buf, 28, z_vel);
+	_mav_put_float(buf, 32, x_pos);
+	_mav_put_float(buf, 36, y_pos);
+	_mav_put_float(buf, 40, z_pos);
+	_mav_put_float(buf, 44, airspeed);
+	_mav_put_float(buf, 88, roll_rate);
+	_mav_put_float(buf, 92, pitch_rate);
+	_mav_put_float(buf, 96, yaw_rate);
+	_mav_put_float_array(buf, 48, vel_variance, 3);
+	_mav_put_float_array(buf, 60, pos_variance, 3);
+	_mav_put_float_array(buf, 72, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+#else
+	mavlink_control_system_state_t *packet = (mavlink_control_system_state_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->x_acc = x_acc;
+	packet->y_acc = y_acc;
+	packet->z_acc = z_acc;
+	packet->x_vel = x_vel;
+	packet->y_vel = y_vel;
+	packet->z_vel = z_vel;
+	packet->x_pos = x_pos;
+	packet->y_pos = y_pos;
+	packet->z_pos = z_pos;
+	packet->airspeed = airspeed;
+	packet->roll_rate = roll_rate;
+	packet->pitch_rate = pitch_rate;
+	packet->yaw_rate = yaw_rate;
+	mav_array_memcpy(packet->vel_variance, vel_variance, sizeof(float)*3);
+	mav_array_memcpy(packet->pos_variance, pos_variance, sizeof(float)*3);
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE CONTROL_SYSTEM_STATE UNPACKING
+
+
+/**
+ * @brief Get field time_usec from control_system_state message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x_acc from control_system_state message
+ *
+ * @return X acceleration in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y_acc from control_system_state message
+ *
+ * @return Y acceleration in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z_acc from control_system_state message
+ *
+ * @return Z acceleration in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field x_vel from control_system_state message
+ *
+ * @return X velocity in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field y_vel from control_system_state message
+ *
+ * @return Y velocity in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field z_vel from control_system_state message
+ *
+ * @return Z velocity in body frame
+ */
+static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field x_pos from control_system_state message
+ *
+ * @return X position in local frame
+ */
+static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field y_pos from control_system_state message
+ *
+ * @return Y position in local frame
+ */
+static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field z_pos from control_system_state message
+ *
+ * @return Z position in local frame
+ */
+static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field airspeed from control_system_state message
+ *
+ * @return Airspeed, set to -1 if unknown
+ */
+static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field vel_variance from control_system_state message
+ *
+ * @return Variance of body velocity estimate
+ */
+static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const mavlink_message_t* msg, float *vel_variance)
+{
+	return _MAV_RETURN_float_array(msg, vel_variance, 3,  48);
+}
+
+/**
+ * @brief Get field pos_variance from control_system_state message
+ *
+ * @return Variance in local position
+ */
+static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const mavlink_message_t* msg, float *pos_variance)
+{
+	return _MAV_RETURN_float_array(msg, pos_variance, 3,  60);
+}
+
+/**
+ * @brief Get field q from control_system_state message
+ *
+ * @return The attitude, represented as Quaternion
+ */
+static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  72);
+}
+
+/**
+ * @brief Get field roll_rate from control_system_state message
+ *
+ * @return Angular rate in roll axis
+ */
+static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  88);
+}
+
+/**
+ * @brief Get field pitch_rate from control_system_state message
+ *
+ * @return Angular rate in pitch axis
+ */
+static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  92);
+}
+
+/**
+ * @brief Get field yaw_rate from control_system_state message
+ *
+ * @return Angular rate in yaw axis
+ */
+static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  96);
+}
+
+/**
+ * @brief Decode a control_system_state message into a struct
+ *
+ * @param msg The message to decode
+ * @param control_system_state C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_control_system_state_decode(const mavlink_message_t* msg, mavlink_control_system_state_t* control_system_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	control_system_state->time_usec = mavlink_msg_control_system_state_get_time_usec(msg);
+	control_system_state->x_acc = mavlink_msg_control_system_state_get_x_acc(msg);
+	control_system_state->y_acc = mavlink_msg_control_system_state_get_y_acc(msg);
+	control_system_state->z_acc = mavlink_msg_control_system_state_get_z_acc(msg);
+	control_system_state->x_vel = mavlink_msg_control_system_state_get_x_vel(msg);
+	control_system_state->y_vel = mavlink_msg_control_system_state_get_y_vel(msg);
+	control_system_state->z_vel = mavlink_msg_control_system_state_get_z_vel(msg);
+	control_system_state->x_pos = mavlink_msg_control_system_state_get_x_pos(msg);
+	control_system_state->y_pos = mavlink_msg_control_system_state_get_y_pos(msg);
+	control_system_state->z_pos = mavlink_msg_control_system_state_get_z_pos(msg);
+	control_system_state->airspeed = mavlink_msg_control_system_state_get_airspeed(msg);
+	mavlink_msg_control_system_state_get_vel_variance(msg, control_system_state->vel_variance);
+	mavlink_msg_control_system_state_get_pos_variance(msg, control_system_state->pos_variance);
+	mavlink_msg_control_system_state_get_q(msg, control_system_state->q);
+	control_system_state->roll_rate = mavlink_msg_control_system_state_get_roll_rate(msg);
+	control_system_state->pitch_rate = mavlink_msg_control_system_state_get_pitch_rate(msg);
+	control_system_state->yaw_rate = mavlink_msg_control_system_state_get_yaw_rate(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN? msg->len : MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN;
+        memset(control_system_state, 0, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
+	memcpy(control_system_state, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_stream.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_stream.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_stream.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE DATA_STREAM PACKING
+
+#define MAVLINK_MSG_ID_DATA_STREAM 67
+
+typedef struct MAVLINK_PACKED __mavlink_data_stream_t
+{
+ uint16_t message_rate; /*< The message rate*/
+ uint8_t stream_id; /*< The ID of the requested data stream*/
+ uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/
+} mavlink_data_stream_t;
+
+#define MAVLINK_MSG_ID_DATA_STREAM_LEN 4
+#define MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN 4
+#define MAVLINK_MSG_ID_67_LEN 4
+#define MAVLINK_MSG_ID_67_MIN_LEN 4
+
+#define MAVLINK_MSG_ID_DATA_STREAM_CRC 21
+#define MAVLINK_MSG_ID_67_CRC 21
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
+	67, \
+	"DATA_STREAM", \
+	3, \
+	{  { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
+         { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
+         { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
+	"DATA_STREAM", \
+	3, \
+	{  { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
+         { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
+         { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a data_stream message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param stream_id The ID of the requested data stream
+ * @param message_rate The message rate
+ * @param on_off 1 stream is enabled, 0 stream is stopped.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, message_rate);
+	_mav_put_uint8_t(buf, 2, stream_id);
+	_mav_put_uint8_t(buf, 3, on_off);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
+#else
+	mavlink_data_stream_t packet;
+	packet.message_rate = message_rate;
+	packet.stream_id = stream_id;
+	packet.on_off = on_off;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+}
+
+/**
+ * @brief Pack a data_stream message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param stream_id The ID of the requested data stream
+ * @param message_rate The message rate
+ * @param on_off 1 stream is enabled, 0 stream is stopped.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t stream_id,uint16_t message_rate,uint8_t on_off)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, message_rate);
+	_mav_put_uint8_t(buf, 2, stream_id);
+	_mav_put_uint8_t(buf, 3, on_off);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
+#else
+	mavlink_data_stream_t packet;
+	packet.message_rate = message_rate;
+	packet.stream_id = stream_id;
+	packet.on_off = on_off;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+}
+
+/**
+ * @brief Encode a data_stream struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param data_stream C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
+{
+	return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
+}
+
+/**
+ * @brief Encode a data_stream struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param data_stream C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
+{
+	return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
+}
+
+/**
+ * @brief Send a data_stream message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param stream_id The ID of the requested data stream
+ * @param message_rate The message rate
+ * @param on_off 1 stream is enabled, 0 stream is stopped.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, message_rate);
+	_mav_put_uint8_t(buf, 2, stream_id);
+	_mav_put_uint8_t(buf, 3, on_off);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+#else
+	mavlink_data_stream_t packet;
+	packet.message_rate = message_rate;
+	packet.stream_id = stream_id;
+	packet.on_off = on_off;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+#endif
+}
+
+/**
+ * @brief Send a data_stream message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_data_stream_send_struct(mavlink_channel_t chan, const mavlink_data_stream_t* data_stream)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_data_stream_send(chan, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)data_stream, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_DATA_STREAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, message_rate);
+	_mav_put_uint8_t(buf, 2, stream_id);
+	_mav_put_uint8_t(buf, 3, on_off);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+#else
+	mavlink_data_stream_t *packet = (mavlink_data_stream_t *)msgbuf;
+	packet->message_rate = message_rate;
+	packet->stream_id = stream_id;
+	packet->on_off = on_off;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE DATA_STREAM UNPACKING
+
+
+/**
+ * @brief Get field stream_id from data_stream message
+ *
+ * @return The ID of the requested data stream
+ */
+static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field message_rate from data_stream message
+ *
+ * @return The message rate
+ */
+static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field on_off from data_stream message
+ *
+ * @return 1 stream is enabled, 0 stream is stopped.
+ */
+static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Decode a data_stream message into a struct
+ *
+ * @param msg The message to decode
+ * @param data_stream C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, mavlink_data_stream_t* data_stream)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg);
+	data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg);
+	data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_DATA_STREAM_LEN;
+        memset(data_stream, 0, MAVLINK_MSG_ID_DATA_STREAM_LEN);
+	memcpy(data_stream, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_transmission_handshake.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_transmission_handshake.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_data_transmission_handshake.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
+
+#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130
+
+typedef struct MAVLINK_PACKED __mavlink_data_transmission_handshake_t
+{
+ uint32_t size; /*< total data size in bytes (set on ACK only)*/
+ uint16_t width; /*< Width of a matrix or image*/
+ uint16_t height; /*< Height of a matrix or image*/
+ uint16_t packets; /*< number of packets beeing sent (set on ACK only)*/
+ uint8_t type; /*< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)*/
+ uint8_t payload; /*< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)*/
+ uint8_t jpg_quality; /*< JPEG quality out of [1,100]*/
+} mavlink_data_transmission_handshake_t;
+
+#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13
+#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN 13
+#define MAVLINK_MSG_ID_130_LEN 13
+#define MAVLINK_MSG_ID_130_MIN_LEN 13
+
+#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29
+#define MAVLINK_MSG_ID_130_CRC 29
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
+	130, \
+	"DATA_TRANSMISSION_HANDSHAKE", \
+	7, \
+	{  { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
+         { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
+         { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
+         { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
+         { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
+	"DATA_TRANSMISSION_HANDSHAKE", \
+	7, \
+	{  { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
+         { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
+         { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
+         { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
+         { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a data_transmission_handshake message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
+ * @param size total data size in bytes (set on ACK only)
+ * @param width Width of a matrix or image
+ * @param height Height of a matrix or image
+ * @param packets number of packets beeing sent (set on ACK only)
+ * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
+ * @param jpg_quality JPEG quality out of [1,100]
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
+	_mav_put_uint32_t(buf, 0, size);
+	_mav_put_uint16_t(buf, 4, width);
+	_mav_put_uint16_t(buf, 6, height);
+	_mav_put_uint16_t(buf, 8, packets);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, payload);
+	_mav_put_uint8_t(buf, 12, jpg_quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
+#else
+	mavlink_data_transmission_handshake_t packet;
+	packet.size = size;
+	packet.width = width;
+	packet.height = height;
+	packet.packets = packets;
+	packet.type = type;
+	packet.payload = payload;
+	packet.jpg_quality = jpg_quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+}
+
+/**
+ * @brief Pack a data_transmission_handshake message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
+ * @param size total data size in bytes (set on ACK only)
+ * @param width Width of a matrix or image
+ * @param height Height of a matrix or image
+ * @param packets number of packets beeing sent (set on ACK only)
+ * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
+ * @param jpg_quality JPEG quality out of [1,100]
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
+	_mav_put_uint32_t(buf, 0, size);
+	_mav_put_uint16_t(buf, 4, width);
+	_mav_put_uint16_t(buf, 6, height);
+	_mav_put_uint16_t(buf, 8, packets);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, payload);
+	_mav_put_uint8_t(buf, 12, jpg_quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
+#else
+	mavlink_data_transmission_handshake_t packet;
+	packet.size = size;
+	packet.width = width;
+	packet.height = height;
+	packet.packets = packets;
+	packet.type = type;
+	packet.payload = payload;
+	packet.jpg_quality = jpg_quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+}
+
+/**
+ * @brief Encode a data_transmission_handshake struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param data_transmission_handshake C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
+{
+	return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
+}
+
+/**
+ * @brief Encode a data_transmission_handshake struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param data_transmission_handshake C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
+{
+	return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
+}
+
+/**
+ * @brief Send a data_transmission_handshake message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
+ * @param size total data size in bytes (set on ACK only)
+ * @param width Width of a matrix or image
+ * @param height Height of a matrix or image
+ * @param packets number of packets beeing sent (set on ACK only)
+ * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
+ * @param jpg_quality JPEG quality out of [1,100]
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
+	_mav_put_uint32_t(buf, 0, size);
+	_mav_put_uint16_t(buf, 4, width);
+	_mav_put_uint16_t(buf, 6, height);
+	_mav_put_uint16_t(buf, 8, packets);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, payload);
+	_mav_put_uint8_t(buf, 12, jpg_quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+#else
+	mavlink_data_transmission_handshake_t packet;
+	packet.size = size;
+	packet.width = width;
+	packet.height = height;
+	packet.packets = packets;
+	packet.type = type;
+	packet.payload = payload;
+	packet.jpg_quality = jpg_quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a data_transmission_handshake message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_data_transmission_handshake_send_struct(mavlink_channel_t chan, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_data_transmission_handshake_send(chan, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)data_transmission_handshake, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, size);
+	_mav_put_uint16_t(buf, 4, width);
+	_mav_put_uint16_t(buf, 6, height);
+	_mav_put_uint16_t(buf, 8, packets);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, payload);
+	_mav_put_uint8_t(buf, 12, jpg_quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+#else
+	mavlink_data_transmission_handshake_t *packet = (mavlink_data_transmission_handshake_t *)msgbuf;
+	packet->size = size;
+	packet->width = width;
+	packet->height = height;
+	packet->packets = packets;
+	packet->type = type;
+	packet->payload = payload;
+	packet->jpg_quality = jpg_quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE DATA_TRANSMISSION_HANDSHAKE UNPACKING
+
+
+/**
+ * @brief Get field type from data_transmission_handshake message
+ *
+ * @return type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
+ */
+static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  10);
+}
+
+/**
+ * @brief Get field size from data_transmission_handshake message
+ *
+ * @return total data size in bytes (set on ACK only)
+ */
+static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field width from data_transmission_handshake message
+ *
+ * @return Width of a matrix or image
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field height from data_transmission_handshake message
+ *
+ * @return Height of a matrix or image
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field packets from data_transmission_handshake message
+ *
+ * @return number of packets beeing sent (set on ACK only)
+ */
+static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field payload from data_transmission_handshake message
+ *
+ * @return payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
+ */
+static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  11);
+}
+
+/**
+ * @brief Get field jpg_quality from data_transmission_handshake message
+ *
+ * @return JPEG quality out of [1,100]
+ */
+static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  12);
+}
+
+/**
+ * @brief Decode a data_transmission_handshake message into a struct
+ *
+ * @param msg The message to decode
+ * @param data_transmission_handshake C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg);
+	data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg);
+	data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg);
+	data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg);
+	data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg);
+	data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg);
+	data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN? msg->len : MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN;
+        memset(data_transmission_handshake, 0, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
+	memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE DEBUG PACKING
+
+#define MAVLINK_MSG_ID_DEBUG 254
+
+typedef struct MAVLINK_PACKED __mavlink_debug_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float value; /*< DEBUG value*/
+ uint8_t ind; /*< index of debug variable*/
+} mavlink_debug_t;
+
+#define MAVLINK_MSG_ID_DEBUG_LEN 9
+#define MAVLINK_MSG_ID_DEBUG_MIN_LEN 9
+#define MAVLINK_MSG_ID_254_LEN 9
+#define MAVLINK_MSG_ID_254_MIN_LEN 9
+
+#define MAVLINK_MSG_ID_DEBUG_CRC 46
+#define MAVLINK_MSG_ID_254_CRC 46
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_DEBUG { \
+	254, \
+	"DEBUG", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
+         { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_DEBUG { \
+	"DEBUG", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
+         { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a debug message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param ind index of debug variable
+ * @param value DEBUG value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t ind, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_uint8_t(buf, 8, ind);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
+#else
+	mavlink_debug_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	packet.ind = ind;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DEBUG;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+}
+
+/**
+ * @brief Pack a debug message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param ind index of debug variable
+ * @param value DEBUG value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t ind,float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_uint8_t(buf, 8, ind);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
+#else
+	mavlink_debug_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	packet.ind = ind;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DEBUG;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+}
+
+/**
+ * @brief Encode a debug struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param debug C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug)
+{
+	return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value);
+}
+
+/**
+ * @brief Encode a debug struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param debug C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_t* debug)
+{
+	return mavlink_msg_debug_pack_chan(system_id, component_id, chan, msg, debug->time_boot_ms, debug->ind, debug->value);
+}
+
+/**
+ * @brief Send a debug message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param ind index of debug variable
+ * @param value DEBUG value
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_uint8_t(buf, 8, ind);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+#else
+	mavlink_debug_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	packet.ind = ind;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+#endif
+}
+
+/**
+ * @brief Send a debug message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_debug_send_struct(mavlink_channel_t chan, const mavlink_debug_t* debug)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_debug_send(chan, debug->time_boot_ms, debug->ind, debug->value);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)debug, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t ind, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_uint8_t(buf, 8, ind);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+#else
+	mavlink_debug_t *packet = (mavlink_debug_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->value = value;
+	packet->ind = ind;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE DEBUG UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from debug message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field ind from debug message
+ *
+ * @return index of debug variable
+ */
+static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  8);
+}
+
+/**
+ * @brief Get field value from debug message
+ *
+ * @return DEBUG value
+ */
+static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Decode a debug message into a struct
+ *
+ * @param msg The message to decode
+ * @param debug C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg);
+	debug->value = mavlink_msg_debug_get_value(msg);
+	debug->ind = mavlink_msg_debug_get_ind(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_LEN;
+        memset(debug, 0, MAVLINK_MSG_ID_DEBUG_LEN);
+	memcpy(debug, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug_vect.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug_vect.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_debug_vect.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE DEBUG_VECT PACKING
+
+#define MAVLINK_MSG_ID_DEBUG_VECT 250
+
+typedef struct MAVLINK_PACKED __mavlink_debug_vect_t
+{
+ uint64_t time_usec; /*< Timestamp*/
+ float x; /*< x*/
+ float y; /*< y*/
+ float z; /*< z*/
+ char name[10]; /*< Name*/
+} mavlink_debug_vect_t;
+
+#define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30
+#define MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN 30
+#define MAVLINK_MSG_ID_250_LEN 30
+#define MAVLINK_MSG_ID_250_MIN_LEN 30
+
+#define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49
+#define MAVLINK_MSG_ID_250_CRC 49
+
+#define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
+	250, \
+	"DEBUG_VECT", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
+	"DEBUG_VECT", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a debug_vect message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param name Name
+ * @param time_usec Timestamp
+ * @param x x
+ * @param y y
+ * @param z z
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       const char *name, uint64_t time_usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_char_array(buf, 20, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
+#else
+	mavlink_debug_vect_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+}
+
+/**
+ * @brief Pack a debug_vect message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param name Name
+ * @param time_usec Timestamp
+ * @param x x
+ * @param y y
+ * @param z z
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           const char *name,uint64_t time_usec,float x,float y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_char_array(buf, 20, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
+#else
+	mavlink_debug_vect_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+}
+
+/**
+ * @brief Encode a debug_vect struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param debug_vect C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
+{
+	return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
+}
+
+/**
+ * @brief Encode a debug_vect struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param debug_vect C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
+{
+	return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
+}
+
+/**
+ * @brief Send a debug_vect message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param name Name
+ * @param time_usec Timestamp
+ * @param x x
+ * @param y y
+ * @param z z
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_char_array(buf, 20, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+#else
+	mavlink_debug_vect_t packet;
+	packet.time_usec = time_usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a debug_vect message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_debug_vect_send_struct(mavlink_channel_t chan, const mavlink_debug_vect_t* debug_vect)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_debug_vect_send(chan, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)debug_vect, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_DEBUG_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  const char *name, uint64_t time_usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_char_array(buf, 20, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+#else
+	mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	mav_array_memcpy(packet->name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE DEBUG_VECT UNPACKING
+
+
+/**
+ * @brief Get field name from debug_vect message
+ *
+ * @return Name
+ */
+static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name)
+{
+	return _MAV_RETURN_char_array(msg, name, 10,  20);
+}
+
+/**
+ * @brief Get field time_usec from debug_vect message
+ *
+ * @return Timestamp
+ */
+static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from debug_vect message
+ *
+ * @return x
+ */
+static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y from debug_vect message
+ *
+ * @return y
+ */
+static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z from debug_vect message
+ *
+ * @return z
+ */
+static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Decode a debug_vect message into a struct
+ *
+ * @param msg The message to decode
+ * @param debug_vect C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	debug_vect->time_usec = mavlink_msg_debug_vect_get_time_usec(msg);
+	debug_vect->x = mavlink_msg_debug_vect_get_x(msg);
+	debug_vect->y = mavlink_msg_debug_vect_get_y(msg);
+	debug_vect->z = mavlink_msg_debug_vect_get_z(msg);
+	mavlink_msg_debug_vect_get_name(msg, debug_vect->name);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_VECT_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_VECT_LEN;
+        memset(debug_vect, 0, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
+	memcpy(debug_vect, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_distance_sensor.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_distance_sensor.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_distance_sensor.h	(revision 209)
@@ -0,0 +1,387 @@
+// MESSAGE DISTANCE_SENSOR PACKING
+
+#define MAVLINK_MSG_ID_DISTANCE_SENSOR 132
+
+typedef struct MAVLINK_PACKED __mavlink_distance_sensor_t
+{
+ uint32_t time_boot_ms; /*< Time since system boot*/
+ uint16_t min_distance; /*< Minimum distance the sensor can measure in centimeters*/
+ uint16_t max_distance; /*< Maximum distance the sensor can measure in centimeters*/
+ uint16_t current_distance; /*< Current distance reading*/
+ uint8_t type; /*< Type from MAV_DISTANCE_SENSOR enum.*/
+ uint8_t id; /*< Onboard ID of the sensor*/
+ uint8_t orientation; /*< Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.*/
+ uint8_t covariance; /*< Measurement covariance in centimeters, 0 for unknown / invalid readings*/
+} mavlink_distance_sensor_t;
+
+#define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14
+#define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14
+#define MAVLINK_MSG_ID_132_LEN 14
+#define MAVLINK_MSG_ID_132_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85
+#define MAVLINK_MSG_ID_132_CRC 85
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
+	132, \
+	"DISTANCE_SENSOR", \
+	8, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
+         { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
+         { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
+         { "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
+         { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
+         { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
+	"DISTANCE_SENSOR", \
+	8, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
+         { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
+         { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
+         { "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
+         { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
+         { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a distance_sensor message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Time since system boot
+ * @param min_distance Minimum distance the sensor can measure in centimeters
+ * @param max_distance Maximum distance the sensor can measure in centimeters
+ * @param current_distance Current distance reading
+ * @param type Type from MAV_DISTANCE_SENSOR enum.
+ * @param id Onboard ID of the sensor
+ * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
+ * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, min_distance);
+	_mav_put_uint16_t(buf, 6, max_distance);
+	_mav_put_uint16_t(buf, 8, current_distance);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, id);
+	_mav_put_uint8_t(buf, 12, orientation);
+	_mav_put_uint8_t(buf, 13, covariance);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
+#else
+	mavlink_distance_sensor_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.min_distance = min_distance;
+	packet.max_distance = max_distance;
+	packet.current_distance = current_distance;
+	packet.type = type;
+	packet.id = id;
+	packet.orientation = orientation;
+	packet.covariance = covariance;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+}
+
+/**
+ * @brief Pack a distance_sensor message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Time since system boot
+ * @param min_distance Minimum distance the sensor can measure in centimeters
+ * @param max_distance Maximum distance the sensor can measure in centimeters
+ * @param current_distance Current distance reading
+ * @param type Type from MAV_DISTANCE_SENSOR enum.
+ * @param id Onboard ID of the sensor
+ * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
+ * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, min_distance);
+	_mav_put_uint16_t(buf, 6, max_distance);
+	_mav_put_uint16_t(buf, 8, current_distance);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, id);
+	_mav_put_uint8_t(buf, 12, orientation);
+	_mav_put_uint8_t(buf, 13, covariance);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
+#else
+	mavlink_distance_sensor_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.min_distance = min_distance;
+	packet.max_distance = max_distance;
+	packet.current_distance = current_distance;
+	packet.type = type;
+	packet.id = id;
+	packet.orientation = orientation;
+	packet.covariance = covariance;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+}
+
+/**
+ * @brief Encode a distance_sensor struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param distance_sensor C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
+{
+	return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
+}
+
+/**
+ * @brief Encode a distance_sensor struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param distance_sensor C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
+{
+	return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
+}
+
+/**
+ * @brief Send a distance_sensor message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Time since system boot
+ * @param min_distance Minimum distance the sensor can measure in centimeters
+ * @param max_distance Maximum distance the sensor can measure in centimeters
+ * @param current_distance Current distance reading
+ * @param type Type from MAV_DISTANCE_SENSOR enum.
+ * @param id Onboard ID of the sensor
+ * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
+ * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, min_distance);
+	_mav_put_uint16_t(buf, 6, max_distance);
+	_mav_put_uint16_t(buf, 8, current_distance);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, id);
+	_mav_put_uint8_t(buf, 12, orientation);
+	_mav_put_uint8_t(buf, 13, covariance);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+#else
+	mavlink_distance_sensor_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.min_distance = min_distance;
+	packet.max_distance = max_distance;
+	packet.current_distance = current_distance;
+	packet.type = type;
+	packet.id = id;
+	packet.orientation = orientation;
+	packet.covariance = covariance;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+#endif
+}
+
+/**
+ * @brief Send a distance_sensor message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t chan, const mavlink_distance_sensor_t* distance_sensor)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_distance_sensor_send(chan, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)distance_sensor, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, min_distance);
+	_mav_put_uint16_t(buf, 6, max_distance);
+	_mav_put_uint16_t(buf, 8, current_distance);
+	_mav_put_uint8_t(buf, 10, type);
+	_mav_put_uint8_t(buf, 11, id);
+	_mav_put_uint8_t(buf, 12, orientation);
+	_mav_put_uint8_t(buf, 13, covariance);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+#else
+	mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->min_distance = min_distance;
+	packet->max_distance = max_distance;
+	packet->current_distance = current_distance;
+	packet->type = type;
+	packet->id = id;
+	packet->orientation = orientation;
+	packet->covariance = covariance;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE DISTANCE_SENSOR UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from distance_sensor message
+ *
+ * @return Time since system boot
+ */
+static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field min_distance from distance_sensor message
+ *
+ * @return Minimum distance the sensor can measure in centimeters
+ */
+static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field max_distance from distance_sensor message
+ *
+ * @return Maximum distance the sensor can measure in centimeters
+ */
+static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field current_distance from distance_sensor message
+ *
+ * @return Current distance reading
+ */
+static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field type from distance_sensor message
+ *
+ * @return Type from MAV_DISTANCE_SENSOR enum.
+ */
+static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  10);
+}
+
+/**
+ * @brief Get field id from distance_sensor message
+ *
+ * @return Onboard ID of the sensor
+ */
+static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  11);
+}
+
+/**
+ * @brief Get field orientation from distance_sensor message
+ *
+ * @return Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
+ */
+static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  12);
+}
+
+/**
+ * @brief Get field covariance from distance_sensor message
+ *
+ * @return Measurement covariance in centimeters, 0 for unknown / invalid readings
+ */
+static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  13);
+}
+
+/**
+ * @brief Decode a distance_sensor message into a struct
+ *
+ * @param msg The message to decode
+ * @param distance_sensor C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* msg, mavlink_distance_sensor_t* distance_sensor)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	distance_sensor->time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg);
+	distance_sensor->min_distance = mavlink_msg_distance_sensor_get_min_distance(msg);
+	distance_sensor->max_distance = mavlink_msg_distance_sensor_get_max_distance(msg);
+	distance_sensor->current_distance = mavlink_msg_distance_sensor_get_current_distance(msg);
+	distance_sensor->type = mavlink_msg_distance_sensor_get_type(msg);
+	distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg);
+	distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg);
+	distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN;
+        memset(distance_sensor, 0, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
+	memcpy(distance_sensor, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_encapsulated_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_encapsulated_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_encapsulated_data.h	(revision 209)
@@ -0,0 +1,229 @@
+// MESSAGE ENCAPSULATED_DATA PACKING
+
+#define MAVLINK_MSG_ID_ENCAPSULATED_DATA 131
+
+typedef struct MAVLINK_PACKED __mavlink_encapsulated_data_t
+{
+ uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/
+ uint8_t data[253]; /*< image data bytes*/
+} mavlink_encapsulated_data_t;
+
+#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
+#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255
+#define MAVLINK_MSG_ID_131_LEN 255
+#define MAVLINK_MSG_ID_131_MIN_LEN 255
+
+#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC 223
+#define MAVLINK_MSG_ID_131_CRC 223
+
+#define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
+	131, \
+	"ENCAPSULATED_DATA", \
+	2, \
+	{  { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
+	"ENCAPSULATED_DATA", \
+	2, \
+	{  { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a encapsulated_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param seqnr sequence number (starting with 0 on every transmission)
+ * @param data image data bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t seqnr, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
+	_mav_put_uint16_t(buf, 0, seqnr);
+	_mav_put_uint8_t_array(buf, 2, data, 253);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
+#else
+	mavlink_encapsulated_data_t packet;
+	packet.seqnr = seqnr;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+}
+
+/**
+ * @brief Pack a encapsulated_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param seqnr sequence number (starting with 0 on every transmission)
+ * @param data image data bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t seqnr,const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
+	_mav_put_uint16_t(buf, 0, seqnr);
+	_mav_put_uint8_t_array(buf, 2, data, 253);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
+#else
+	mavlink_encapsulated_data_t packet;
+	packet.seqnr = seqnr;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+}
+
+/**
+ * @brief Encode a encapsulated_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param encapsulated_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
+{
+	return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data);
+}
+
+/**
+ * @brief Encode a encapsulated_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param encapsulated_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
+{
+	return mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, chan, msg, encapsulated_data->seqnr, encapsulated_data->data);
+}
+
+/**
+ * @brief Send a encapsulated_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param seqnr sequence number (starting with 0 on every transmission)
+ * @param data image data bytes
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
+	_mav_put_uint16_t(buf, 0, seqnr);
+	_mav_put_uint8_t_array(buf, 2, data, 253);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+#else
+	mavlink_encapsulated_data_t packet;
+	packet.seqnr = seqnr;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a encapsulated_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_encapsulated_data_send_struct(mavlink_channel_t chan, const mavlink_encapsulated_data_t* encapsulated_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_encapsulated_data_send(chan, encapsulated_data->seqnr, encapsulated_data->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)encapsulated_data, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t seqnr, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seqnr);
+	_mav_put_uint8_t_array(buf, 2, data, 253);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+#else
+	mavlink_encapsulated_data_t *packet = (mavlink_encapsulated_data_t *)msgbuf;
+	packet->seqnr = seqnr;
+	mav_array_memcpy(packet->data, data, sizeof(uint8_t)*253);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ENCAPSULATED_DATA UNPACKING
+
+
+/**
+ * @brief Get field seqnr from encapsulated_data message
+ *
+ * @return sequence number (starting with 0 on every transmission)
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field data from encapsulated_data message
+ *
+ * @return image data bytes
+ */
+static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data)
+{
+	return _MAV_RETURN_uint8_t_array(msg, data, 253,  2);
+}
+
+/**
+ * @brief Decode a encapsulated_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param encapsulated_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_encapsulated_data_decode(const mavlink_message_t* msg, mavlink_encapsulated_data_t* encapsulated_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg);
+	mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN? msg->len : MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN;
+        memset(encapsulated_data, 0, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
+	memcpy(encapsulated_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_estimator_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_estimator_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_estimator_status.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE ESTIMATOR_STATUS PACKING
+
+#define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
+
+typedef struct MAVLINK_PACKED __mavlink_estimator_status_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float vel_ratio; /*< Velocity innovation test ratio*/
+ float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
+ float pos_vert_ratio; /*< Vertical position innovation test ratio*/
+ float mag_ratio; /*< Magnetometer innovation test ratio*/
+ float hagl_ratio; /*< Height above terrain innovation test ratio*/
+ float tas_ratio; /*< True airspeed innovation test ratio*/
+ float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/
+ float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/
+ uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/
+} mavlink_estimator_status_t;
+
+#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
+#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42
+#define MAVLINK_MSG_ID_230_LEN 42
+#define MAVLINK_MSG_ID_230_MIN_LEN 42
+
+#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
+#define MAVLINK_MSG_ID_230_CRC 163
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
+	230, \
+	"ESTIMATOR_STATUS", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
+         { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
+         { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
+         { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
+         { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
+         { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
+         { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
+         { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
+         { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
+	"ESTIMATOR_STATUS", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
+         { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
+         { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
+         { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
+         { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
+         { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
+         { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
+         { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
+         { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a estimator_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
+ * @param vel_ratio Velocity innovation test ratio
+ * @param pos_horiz_ratio Horizontal position innovation test ratio
+ * @param pos_vert_ratio Vertical position innovation test ratio
+ * @param mag_ratio Magnetometer innovation test ratio
+ * @param hagl_ratio Height above terrain innovation test ratio
+ * @param tas_ratio True airspeed innovation test ratio
+ * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
+ * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vel_ratio);
+	_mav_put_float(buf, 12, pos_horiz_ratio);
+	_mav_put_float(buf, 16, pos_vert_ratio);
+	_mav_put_float(buf, 20, mag_ratio);
+	_mav_put_float(buf, 24, hagl_ratio);
+	_mav_put_float(buf, 28, tas_ratio);
+	_mav_put_float(buf, 32, pos_horiz_accuracy);
+	_mav_put_float(buf, 36, pos_vert_accuracy);
+	_mav_put_uint16_t(buf, 40, flags);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
+#else
+	mavlink_estimator_status_t packet;
+	packet.time_usec = time_usec;
+	packet.vel_ratio = vel_ratio;
+	packet.pos_horiz_ratio = pos_horiz_ratio;
+	packet.pos_vert_ratio = pos_vert_ratio;
+	packet.mag_ratio = mag_ratio;
+	packet.hagl_ratio = hagl_ratio;
+	packet.tas_ratio = tas_ratio;
+	packet.pos_horiz_accuracy = pos_horiz_accuracy;
+	packet.pos_vert_accuracy = pos_vert_accuracy;
+	packet.flags = flags;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a estimator_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
+ * @param vel_ratio Velocity innovation test ratio
+ * @param pos_horiz_ratio Horizontal position innovation test ratio
+ * @param pos_vert_ratio Vertical position innovation test ratio
+ * @param mag_ratio Magnetometer innovation test ratio
+ * @param hagl_ratio Height above terrain innovation test ratio
+ * @param tas_ratio True airspeed innovation test ratio
+ * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
+ * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vel_ratio);
+	_mav_put_float(buf, 12, pos_horiz_ratio);
+	_mav_put_float(buf, 16, pos_vert_ratio);
+	_mav_put_float(buf, 20, mag_ratio);
+	_mav_put_float(buf, 24, hagl_ratio);
+	_mav_put_float(buf, 28, tas_ratio);
+	_mav_put_float(buf, 32, pos_horiz_accuracy);
+	_mav_put_float(buf, 36, pos_vert_accuracy);
+	_mav_put_uint16_t(buf, 40, flags);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
+#else
+	mavlink_estimator_status_t packet;
+	packet.time_usec = time_usec;
+	packet.vel_ratio = vel_ratio;
+	packet.pos_horiz_ratio = pos_horiz_ratio;
+	packet.pos_vert_ratio = pos_vert_ratio;
+	packet.mag_ratio = mag_ratio;
+	packet.hagl_ratio = hagl_ratio;
+	packet.tas_ratio = tas_ratio;
+	packet.pos_horiz_accuracy = pos_horiz_accuracy;
+	packet.pos_vert_accuracy = pos_vert_accuracy;
+	packet.flags = flags;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a estimator_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param estimator_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
+{
+	return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
+}
+
+/**
+ * @brief Encode a estimator_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param estimator_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
+{
+	return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
+}
+
+/**
+ * @brief Send a estimator_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
+ * @param vel_ratio Velocity innovation test ratio
+ * @param pos_horiz_ratio Horizontal position innovation test ratio
+ * @param pos_vert_ratio Vertical position innovation test ratio
+ * @param mag_ratio Magnetometer innovation test ratio
+ * @param hagl_ratio Height above terrain innovation test ratio
+ * @param tas_ratio True airspeed innovation test ratio
+ * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
+ * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vel_ratio);
+	_mav_put_float(buf, 12, pos_horiz_ratio);
+	_mav_put_float(buf, 16, pos_vert_ratio);
+	_mav_put_float(buf, 20, mag_ratio);
+	_mav_put_float(buf, 24, hagl_ratio);
+	_mav_put_float(buf, 28, tas_ratio);
+	_mav_put_float(buf, 32, pos_horiz_accuracy);
+	_mav_put_float(buf, 36, pos_vert_accuracy);
+	_mav_put_uint16_t(buf, 40, flags);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+#else
+	mavlink_estimator_status_t packet;
+	packet.time_usec = time_usec;
+	packet.vel_ratio = vel_ratio;
+	packet.pos_horiz_ratio = pos_horiz_ratio;
+	packet.pos_vert_ratio = pos_vert_ratio;
+	packet.mag_ratio = mag_ratio;
+	packet.hagl_ratio = hagl_ratio;
+	packet.tas_ratio = tas_ratio;
+	packet.pos_horiz_accuracy = pos_horiz_accuracy;
+	packet.pos_vert_accuracy = pos_vert_accuracy;
+	packet.flags = flags;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a estimator_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vel_ratio);
+	_mav_put_float(buf, 12, pos_horiz_ratio);
+	_mav_put_float(buf, 16, pos_vert_ratio);
+	_mav_put_float(buf, 20, mag_ratio);
+	_mav_put_float(buf, 24, hagl_ratio);
+	_mav_put_float(buf, 28, tas_ratio);
+	_mav_put_float(buf, 32, pos_horiz_accuracy);
+	_mav_put_float(buf, 36, pos_vert_accuracy);
+	_mav_put_uint16_t(buf, 40, flags);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+#else
+	mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->vel_ratio = vel_ratio;
+	packet->pos_horiz_ratio = pos_horiz_ratio;
+	packet->pos_vert_ratio = pos_vert_ratio;
+	packet->mag_ratio = mag_ratio;
+	packet->hagl_ratio = hagl_ratio;
+	packet->tas_ratio = tas_ratio;
+	packet->pos_horiz_accuracy = pos_horiz_accuracy;
+	packet->pos_vert_accuracy = pos_vert_accuracy;
+	packet->flags = flags;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE ESTIMATOR_STATUS UNPACKING
+
+
+/**
+ * @brief Get field time_usec from estimator_status message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field flags from estimator_status message
+ *
+ * @return Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
+ */
+static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  40);
+}
+
+/**
+ * @brief Get field vel_ratio from estimator_status message
+ *
+ * @return Velocity innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field pos_horiz_ratio from estimator_status message
+ *
+ * @return Horizontal position innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field pos_vert_ratio from estimator_status message
+ *
+ * @return Vertical position innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field mag_ratio from estimator_status message
+ *
+ * @return Magnetometer innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field hagl_ratio from estimator_status message
+ *
+ * @return Height above terrain innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field tas_ratio from estimator_status message
+ *
+ * @return True airspeed innovation test ratio
+ */
+static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field pos_horiz_accuracy from estimator_status message
+ *
+ * @return Horizontal position 1-STD accuracy relative to the EKF local origin (m)
+ */
+static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field pos_vert_accuracy from estimator_status message
+ *
+ * @return Vertical position 1-STD accuracy relative to the EKF local origin (m)
+ */
+static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Decode a estimator_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param estimator_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
+	estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
+	estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg);
+	estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg);
+	estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
+	estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg);
+	estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
+	estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg);
+	estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg);
+	estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN;
+        memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
+	memcpy(estimator_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_extended_sys_state.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_extended_sys_state.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_extended_sys_state.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE EXTENDED_SYS_STATE PACKING
+
+#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE 245
+
+typedef struct MAVLINK_PACKED __mavlink_extended_sys_state_t
+{
+ uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/
+ uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/
+} mavlink_extended_sys_state_t;
+
+#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2
+#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2
+#define MAVLINK_MSG_ID_245_LEN 2
+#define MAVLINK_MSG_ID_245_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC 130
+#define MAVLINK_MSG_ID_245_CRC 130
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
+	245, \
+	"EXTENDED_SYS_STATE", \
+	2, \
+	{  { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
+         { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
+	"EXTENDED_SYS_STATE", \
+	2, \
+	{  { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
+         { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a extended_sys_state message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
+ * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t vtol_state, uint8_t landed_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
+	_mav_put_uint8_t(buf, 0, vtol_state);
+	_mav_put_uint8_t(buf, 1, landed_state);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
+#else
+	mavlink_extended_sys_state_t packet;
+	packet.vtol_state = vtol_state;
+	packet.landed_state = landed_state;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+}
+
+/**
+ * @brief Pack a extended_sys_state message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
+ * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t vtol_state,uint8_t landed_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
+	_mav_put_uint8_t(buf, 0, vtol_state);
+	_mav_put_uint8_t(buf, 1, landed_state);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
+#else
+	mavlink_extended_sys_state_t packet;
+	packet.vtol_state = vtol_state;
+	packet.landed_state = landed_state;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+}
+
+/**
+ * @brief Encode a extended_sys_state struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param extended_sys_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_extended_sys_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
+{
+	return mavlink_msg_extended_sys_state_pack(system_id, component_id, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
+}
+
+/**
+ * @brief Encode a extended_sys_state struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param extended_sys_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
+{
+	return mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, chan, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
+}
+
+/**
+ * @brief Send a extended_sys_state message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
+ * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_extended_sys_state_send(mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
+	_mav_put_uint8_t(buf, 0, vtol_state);
+	_mav_put_uint8_t(buf, 1, landed_state);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+#else
+	mavlink_extended_sys_state_t packet;
+	packet.vtol_state = vtol_state;
+	packet.landed_state = landed_state;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a extended_sys_state message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_extended_sys_state_send_struct(mavlink_channel_t chan, const mavlink_extended_sys_state_t* extended_sys_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_extended_sys_state_send(chan, extended_sys_state->vtol_state, extended_sys_state->landed_state);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)extended_sys_state, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t vtol_state, uint8_t landed_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, vtol_state);
+	_mav_put_uint8_t(buf, 1, landed_state);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+#else
+	mavlink_extended_sys_state_t *packet = (mavlink_extended_sys_state_t *)msgbuf;
+	packet->vtol_state = vtol_state;
+	packet->landed_state = landed_state;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE EXTENDED_SYS_STATE UNPACKING
+
+
+/**
+ * @brief Get field vtol_state from extended_sys_state message
+ *
+ * @return The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
+ */
+static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field landed_state from extended_sys_state message
+ *
+ * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
+ */
+static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a extended_sys_state message into a struct
+ *
+ * @param msg The message to decode
+ * @param extended_sys_state C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_extended_sys_state_decode(const mavlink_message_t* msg, mavlink_extended_sys_state_t* extended_sys_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	extended_sys_state->vtol_state = mavlink_msg_extended_sys_state_get_vtol_state(msg);
+	extended_sys_state->landed_state = mavlink_msg_extended_sys_state_get_landed_state(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN? msg->len : MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN;
+        memset(extended_sys_state, 0, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
+	memcpy(extended_sys_state, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_file_transfer_protocol.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_file_transfer_protocol.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_file_transfer_protocol.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE FILE_TRANSFER_PROTOCOL PACKING
+
+#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL 110
+
+typedef struct MAVLINK_PACKED __mavlink_file_transfer_protocol_t
+{
+ uint8_t target_network; /*< Network ID (0 for broadcast)*/
+ uint8_t target_system; /*< System ID (0 for broadcast)*/
+ uint8_t target_component; /*< Component ID (0 for broadcast)*/
+ uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/
+} mavlink_file_transfer_protocol_t;
+
+#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254
+#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254
+#define MAVLINK_MSG_ID_110_LEN 254
+#define MAVLINK_MSG_ID_110_MIN_LEN 254
+
+#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC 84
+#define MAVLINK_MSG_ID_110_CRC 84
+
+#define MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN 251
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
+	110, \
+	"FILE_TRANSFER_PROTOCOL", \
+	4, \
+	{  { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
+	"FILE_TRANSFER_PROTOCOL", \
+	4, \
+	{  { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a file_transfer_protocol message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
+	_mav_put_uint8_t(buf, 0, target_network);
+	_mav_put_uint8_t(buf, 1, target_system);
+	_mav_put_uint8_t(buf, 2, target_component);
+	_mav_put_uint8_t_array(buf, 3, payload, 251);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
+#else
+	mavlink_file_transfer_protocol_t packet;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+}
+
+/**
+ * @brief Pack a file_transfer_protocol message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_network,uint8_t target_system,uint8_t target_component,const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
+	_mav_put_uint8_t(buf, 0, target_network);
+	_mav_put_uint8_t(buf, 1, target_system);
+	_mav_put_uint8_t(buf, 2, target_component);
+	_mav_put_uint8_t_array(buf, 3, payload, 251);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
+#else
+	mavlink_file_transfer_protocol_t packet;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+}
+
+/**
+ * @brief Encode a file_transfer_protocol struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param file_transfer_protocol C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_file_transfer_protocol_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
+{
+	return mavlink_msg_file_transfer_protocol_pack(system_id, component_id, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
+}
+
+/**
+ * @brief Encode a file_transfer_protocol struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param file_transfer_protocol C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
+{
+	return mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, chan, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
+}
+
+/**
+ * @brief Send a file_transfer_protocol message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_file_transfer_protocol_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
+	_mav_put_uint8_t(buf, 0, target_network);
+	_mav_put_uint8_t(buf, 1, target_system);
+	_mav_put_uint8_t(buf, 2, target_component);
+	_mav_put_uint8_t_array(buf, 3, payload, 251);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+#else
+	mavlink_file_transfer_protocol_t packet;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a file_transfer_protocol message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_file_transfer_protocol_send_struct(mavlink_channel_t chan, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_file_transfer_protocol_send(chan, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)file_transfer_protocol, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_network);
+	_mav_put_uint8_t(buf, 1, target_system);
+	_mav_put_uint8_t(buf, 2, target_component);
+	_mav_put_uint8_t_array(buf, 3, payload, 251);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+#else
+	mavlink_file_transfer_protocol_t *packet = (mavlink_file_transfer_protocol_t *)msgbuf;
+	packet->target_network = target_network;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*251);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE FILE_TRANSFER_PROTOCOL UNPACKING
+
+
+/**
+ * @brief Get field target_network from file_transfer_protocol message
+ *
+ * @return Network ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_system from file_transfer_protocol message
+ *
+ * @return System ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field target_component from file_transfer_protocol message
+ *
+ * @return Component ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field payload from file_transfer_protocol message
+ *
+ * @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ */
+static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavlink_message_t* msg, uint8_t *payload)
+{
+	return _MAV_RETURN_uint8_t_array(msg, payload, 251,  3);
+}
+
+/**
+ * @brief Decode a file_transfer_protocol message into a struct
+ *
+ * @param msg The message to decode
+ * @param file_transfer_protocol C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_file_transfer_protocol_decode(const mavlink_message_t* msg, mavlink_file_transfer_protocol_t* file_transfer_protocol)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	file_transfer_protocol->target_network = mavlink_msg_file_transfer_protocol_get_target_network(msg);
+	file_transfer_protocol->target_system = mavlink_msg_file_transfer_protocol_get_target_system(msg);
+	file_transfer_protocol->target_component = mavlink_msg_file_transfer_protocol_get_target_component(msg);
+	mavlink_msg_file_transfer_protocol_get_payload(msg, file_transfer_protocol->payload);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN? msg->len : MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN;
+        memset(file_transfer_protocol, 0, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
+	memcpy(file_transfer_protocol, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_follow_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_follow_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_follow_target.h	(revision 209)
@@ -0,0 +1,458 @@
+// MESSAGE FOLLOW_TARGET PACKING
+
+#define MAVLINK_MSG_ID_FOLLOW_TARGET 144
+
+typedef struct MAVLINK_PACKED __mavlink_follow_target_t
+{
+ uint64_t timestamp; /*< Timestamp in milliseconds since system boot*/
+ uint64_t custom_state; /*< button states or switches of a tracker device*/
+ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
+ float alt; /*< AMSL, in meters*/
+ float vel[3]; /*< target velocity (0,0,0) for unknown*/
+ float acc[3]; /*< linear target acceleration (0,0,0) for unknown*/
+ float attitude_q[4]; /*< (1 0 0 0 for unknown)*/
+ float rates[3]; /*< (0 0 0 for unknown)*/
+ float position_cov[3]; /*< eph epv*/
+ uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/
+} mavlink_follow_target_t;
+
+#define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93
+#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93
+#define MAVLINK_MSG_ID_144_LEN 93
+#define MAVLINK_MSG_ID_144_MIN_LEN 93
+
+#define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127
+#define MAVLINK_MSG_ID_144_CRC 127
+
+#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_VEL_LEN 3
+#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ACC_LEN 3
+#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ATTITUDE_Q_LEN 4
+#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_RATES_LEN 3
+#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_POSITION_COV_LEN 3
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
+	144, \
+	"FOLLOW_TARGET", \
+	11, \
+	{  { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
+         { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
+         { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
+         { "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
+         { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
+         { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
+         { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
+         { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
+	"FOLLOW_TARGET", \
+	11, \
+	{  { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
+         { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
+         { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
+         { "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
+         { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
+         { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
+         { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
+         { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a follow_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param timestamp Timestamp in milliseconds since system boot
+ * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt AMSL, in meters
+ * @param vel target velocity (0,0,0) for unknown
+ * @param acc linear target acceleration (0,0,0) for unknown
+ * @param attitude_q (1 0 0 0 for unknown)
+ * @param rates (0 0 0 for unknown)
+ * @param position_cov eph epv
+ * @param custom_state button states or switches of a tracker device
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, timestamp);
+	_mav_put_uint64_t(buf, 8, custom_state);
+	_mav_put_int32_t(buf, 16, lat);
+	_mav_put_int32_t(buf, 20, lon);
+	_mav_put_float(buf, 24, alt);
+	_mav_put_uint8_t(buf, 92, est_capabilities);
+	_mav_put_float_array(buf, 28, vel, 3);
+	_mav_put_float_array(buf, 40, acc, 3);
+	_mav_put_float_array(buf, 52, attitude_q, 4);
+	_mav_put_float_array(buf, 68, rates, 3);
+	_mav_put_float_array(buf, 80, position_cov, 3);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
+#else
+	mavlink_follow_target_t packet;
+	packet.timestamp = timestamp;
+	packet.custom_state = custom_state;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.est_capabilities = est_capabilities;
+	mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
+	mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
+	mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
+	mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
+	mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a follow_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param timestamp Timestamp in milliseconds since system boot
+ * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt AMSL, in meters
+ * @param vel target velocity (0,0,0) for unknown
+ * @param acc linear target acceleration (0,0,0) for unknown
+ * @param attitude_q (1 0 0 0 for unknown)
+ * @param rates (0 0 0 for unknown)
+ * @param position_cov eph epv
+ * @param custom_state button states or switches of a tracker device
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, timestamp);
+	_mav_put_uint64_t(buf, 8, custom_state);
+	_mav_put_int32_t(buf, 16, lat);
+	_mav_put_int32_t(buf, 20, lon);
+	_mav_put_float(buf, 24, alt);
+	_mav_put_uint8_t(buf, 92, est_capabilities);
+	_mav_put_float_array(buf, 28, vel, 3);
+	_mav_put_float_array(buf, 40, acc, 3);
+	_mav_put_float_array(buf, 52, attitude_q, 4);
+	_mav_put_float_array(buf, 68, rates, 3);
+	_mav_put_float_array(buf, 80, position_cov, 3);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
+#else
+	mavlink_follow_target_t packet;
+	packet.timestamp = timestamp;
+	packet.custom_state = custom_state;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.est_capabilities = est_capabilities;
+	mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
+	mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
+	mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
+	mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
+	mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a follow_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param follow_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
+{
+	return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
+}
+
+/**
+ * @brief Encode a follow_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param follow_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
+{
+	return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
+}
+
+/**
+ * @brief Send a follow_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param timestamp Timestamp in milliseconds since system boot
+ * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt AMSL, in meters
+ * @param vel target velocity (0,0,0) for unknown
+ * @param acc linear target acceleration (0,0,0) for unknown
+ * @param attitude_q (1 0 0 0 for unknown)
+ * @param rates (0 0 0 for unknown)
+ * @param position_cov eph epv
+ * @param custom_state button states or switches of a tracker device
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, timestamp);
+	_mav_put_uint64_t(buf, 8, custom_state);
+	_mav_put_int32_t(buf, 16, lat);
+	_mav_put_int32_t(buf, 20, lon);
+	_mav_put_float(buf, 24, alt);
+	_mav_put_uint8_t(buf, 92, est_capabilities);
+	_mav_put_float_array(buf, 28, vel, 3);
+	_mav_put_float_array(buf, 40, acc, 3);
+	_mav_put_float_array(buf, 52, attitude_q, 4);
+	_mav_put_float_array(buf, 68, rates, 3);
+	_mav_put_float_array(buf, 80, position_cov, 3);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+#else
+	mavlink_follow_target_t packet;
+	packet.timestamp = timestamp;
+	packet.custom_state = custom_state;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.est_capabilities = est_capabilities;
+	mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
+	mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
+	mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
+	mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
+	mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a follow_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_follow_target_send_struct(mavlink_channel_t chan, const mavlink_follow_target_t* follow_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_follow_target_send(chan, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)follow_target, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_FOLLOW_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, timestamp);
+	_mav_put_uint64_t(buf, 8, custom_state);
+	_mav_put_int32_t(buf, 16, lat);
+	_mav_put_int32_t(buf, 20, lon);
+	_mav_put_float(buf, 24, alt);
+	_mav_put_uint8_t(buf, 92, est_capabilities);
+	_mav_put_float_array(buf, 28, vel, 3);
+	_mav_put_float_array(buf, 40, acc, 3);
+	_mav_put_float_array(buf, 52, attitude_q, 4);
+	_mav_put_float_array(buf, 68, rates, 3);
+	_mav_put_float_array(buf, 80, position_cov, 3);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+#else
+	mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf;
+	packet->timestamp = timestamp;
+	packet->custom_state = custom_state;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->est_capabilities = est_capabilities;
+	mav_array_memcpy(packet->vel, vel, sizeof(float)*3);
+	mav_array_memcpy(packet->acc, acc, sizeof(float)*3);
+	mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4);
+	mav_array_memcpy(packet->rates, rates, sizeof(float)*3);
+	mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE FOLLOW_TARGET UNPACKING
+
+
+/**
+ * @brief Get field timestamp from follow_target message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field est_capabilities from follow_target message
+ *
+ * @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
+ */
+static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  92);
+}
+
+/**
+ * @brief Get field lat from follow_target message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field lon from follow_target message
+ *
+ * @return Longitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  20);
+}
+
+/**
+ * @brief Get field alt from follow_target message
+ *
+ * @return AMSL, in meters
+ */
+static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field vel from follow_target message
+ *
+ * @return target velocity (0,0,0) for unknown
+ */
+static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel)
+{
+	return _MAV_RETURN_float_array(msg, vel, 3,  28);
+}
+
+/**
+ * @brief Get field acc from follow_target message
+ *
+ * @return linear target acceleration (0,0,0) for unknown
+ */
+static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc)
+{
+	return _MAV_RETURN_float_array(msg, acc, 3,  40);
+}
+
+/**
+ * @brief Get field attitude_q from follow_target message
+ *
+ * @return (1 0 0 0 for unknown)
+ */
+static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q)
+{
+	return _MAV_RETURN_float_array(msg, attitude_q, 4,  52);
+}
+
+/**
+ * @brief Get field rates from follow_target message
+ *
+ * @return (0 0 0 for unknown)
+ */
+static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates)
+{
+	return _MAV_RETURN_float_array(msg, rates, 3,  68);
+}
+
+/**
+ * @brief Get field position_cov from follow_target message
+ *
+ * @return eph epv
+ */
+static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov)
+{
+	return _MAV_RETURN_float_array(msg, position_cov, 3,  80);
+}
+
+/**
+ * @brief Get field custom_state from follow_target message
+ *
+ * @return button states or switches of a tracker device
+ */
+static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  8);
+}
+
+/**
+ * @brief Decode a follow_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param follow_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg, mavlink_follow_target_t* follow_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg);
+	follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
+	follow_target->lat = mavlink_msg_follow_target_get_lat(msg);
+	follow_target->lon = mavlink_msg_follow_target_get_lon(msg);
+	follow_target->alt = mavlink_msg_follow_target_get_alt(msg);
+	mavlink_msg_follow_target_get_vel(msg, follow_target->vel);
+	mavlink_msg_follow_target_get_acc(msg, follow_target->acc);
+	mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q);
+	mavlink_msg_follow_target_get_rates(msg, follow_target->rates);
+	mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov);
+	follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN;
+        memset(follow_target, 0, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
+	memcpy(follow_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int.h	(revision 209)
@@ -0,0 +1,412 @@
+// MESSAGE GLOBAL_POSITION_INT PACKING
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33
+
+typedef struct MAVLINK_PACKED __mavlink_global_position_int_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
+ int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
+ int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)*/
+ int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/
+ int16_t vx; /*< Ground X Speed (Latitude, positive north), expressed as m/s * 100*/
+ int16_t vy; /*< Ground Y Speed (Longitude, positive east), expressed as m/s * 100*/
+ int16_t vz; /*< Ground Z Speed (Altitude, positive down), expressed as m/s * 100*/
+ uint16_t hdg; /*< Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
+} mavlink_global_position_int_t;
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN 28
+#define MAVLINK_MSG_ID_33_LEN 28
+#define MAVLINK_MSG_ID_33_MIN_LEN 28
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104
+#define MAVLINK_MSG_ID_33_CRC 104
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
+	33, \
+	"GLOBAL_POSITION_INT", \
+	9, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
+         { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
+         { "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
+	"GLOBAL_POSITION_INT", \
+	9, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
+         { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
+         { "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a global_position_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
+ * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, alt);
+	_mav_put_int32_t(buf, 16, relative_alt);
+	_mav_put_int16_t(buf, 20, vx);
+	_mav_put_int16_t(buf, 22, vy);
+	_mav_put_int16_t(buf, 24, vz);
+	_mav_put_uint16_t(buf, 26, hdg);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
+#else
+	mavlink_global_position_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.hdg = hdg;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+}
+
+/**
+ * @brief Pack a global_position_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
+ * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, alt);
+	_mav_put_int32_t(buf, 16, relative_alt);
+	_mav_put_int16_t(buf, 20, vx);
+	_mav_put_int16_t(buf, 22, vy);
+	_mav_put_int16_t(buf, 24, vz);
+	_mav_put_uint16_t(buf, 26, hdg);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
+#else
+	mavlink_global_position_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.hdg = hdg;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+}
+
+/**
+ * @brief Encode a global_position_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param global_position_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
+{
+	return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
+}
+
+/**
+ * @brief Encode a global_position_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param global_position_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
+{
+	return mavlink_msg_global_position_int_pack_chan(system_id, component_id, chan, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
+}
+
+/**
+ * @brief Send a global_position_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
+ * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, alt);
+	_mav_put_int32_t(buf, 16, relative_alt);
+	_mav_put_int16_t(buf, 20, vx);
+	_mav_put_int16_t(buf, 22, vy);
+	_mav_put_int16_t(buf, 24, vz);
+	_mav_put_uint16_t(buf, 26, hdg);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+#else
+	mavlink_global_position_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.hdg = hdg;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a global_position_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_global_position_int_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_t* global_position_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_global_position_int_send(chan, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)global_position_int, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat);
+	_mav_put_int32_t(buf, 8, lon);
+	_mav_put_int32_t(buf, 12, alt);
+	_mav_put_int32_t(buf, 16, relative_alt);
+	_mav_put_int16_t(buf, 20, vx);
+	_mav_put_int16_t(buf, 22, vy);
+	_mav_put_int16_t(buf, 24, vz);
+	_mav_put_uint16_t(buf, 26, hdg);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+#else
+	mavlink_global_position_int_t *packet = (mavlink_global_position_int_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->relative_alt = relative_alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->hdg = hdg;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GLOBAL_POSITION_INT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from global_position_int message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field lat from global_position_int message
+ *
+ * @return Latitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field lon from global_position_int message
+ *
+ * @return Longitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field alt from global_position_int message
+ *
+ * @return Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
+ */
+static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field relative_alt from global_position_int message
+ *
+ * @return Altitude above ground in meters, expressed as * 1000 (millimeters)
+ */
+static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field vx from global_position_int message
+ *
+ * @return Ground X Speed (Latitude, positive north), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Get field vy from global_position_int message
+ *
+ * @return Ground Y Speed (Longitude, positive east), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  22);
+}
+
+/**
+ * @brief Get field vz from global_position_int message
+ *
+ * @return Ground Z Speed (Altitude, positive down), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  24);
+}
+
+/**
+ * @brief Get field hdg from global_position_int message
+ *
+ * @return Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Decode a global_position_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param global_position_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_global_position_int_decode(const mavlink_message_t* msg, mavlink_global_position_int_t* global_position_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	global_position_int->time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(msg);
+	global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg);
+	global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg);
+	global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg);
+	global_position_int->relative_alt = mavlink_msg_global_position_int_get_relative_alt(msg);
+	global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg);
+	global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg);
+	global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg);
+	global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN;
+        memset(global_position_int, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
+	memcpy(global_position_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int_cov.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int_cov.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_position_int_cov.h	(revision 209)
@@ -0,0 +1,454 @@
+// MESSAGE GLOBAL_POSITION_INT_COV PACKING
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
+
+typedef struct MAVLINK_PACKED __mavlink_global_position_int_cov_t
+{
+ uint64_t time_utc; /*< Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.*/
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
+ int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
+ int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), above MSL*/
+ int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/
+ float vx; /*< Ground X Speed (Latitude), expressed as m/s*/
+ float vy; /*< Ground Y Speed (Longitude), expressed as m/s*/
+ float vz; /*< Ground Z Speed (Altitude), expressed as m/s*/
+ float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/
+ uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
+} mavlink_global_position_int_cov_t;
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 185
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 185
+#define MAVLINK_MSG_ID_63_LEN 185
+#define MAVLINK_MSG_ID_63_MIN_LEN 185
+
+#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 51
+#define MAVLINK_MSG_ID_63_CRC 51
+
+#define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
+	63, \
+	"GLOBAL_POSITION_INT_COV", \
+	11, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_utc) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, time_boot_ms) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, alt) }, \
+         { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_global_position_int_cov_t, vz) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 40, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
+         { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
+	"GLOBAL_POSITION_INT_COV", \
+	11, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_utc) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, time_boot_ms) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, alt) }, \
+         { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_global_position_int_cov_t, vz) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 40, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
+         { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a global_position_int_cov message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s
+ * @param vy Ground Y Speed (Longitude), expressed as m/s
+ * @param vz Ground Z Speed (Altitude), expressed as m/s
+ * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_int32_t(buf, 12, lat);
+	_mav_put_int32_t(buf, 16, lon);
+	_mav_put_int32_t(buf, 20, alt);
+	_mav_put_int32_t(buf, 24, relative_alt);
+	_mav_put_float(buf, 28, vx);
+	_mav_put_float(buf, 32, vy);
+	_mav_put_float(buf, 36, vz);
+	_mav_put_uint8_t(buf, 184, estimator_type);
+	_mav_put_float_array(buf, 40, covariance, 36);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
+#else
+	mavlink_global_position_int_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+}
+
+/**
+ * @brief Pack a global_position_int_cov message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s
+ * @param vy Ground Y Speed (Longitude), expressed as m/s
+ * @param vz Ground Z Speed (Altitude), expressed as m/s
+ * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_int32_t(buf, 12, lat);
+	_mav_put_int32_t(buf, 16, lon);
+	_mav_put_int32_t(buf, 20, alt);
+	_mav_put_int32_t(buf, 24, relative_alt);
+	_mav_put_float(buf, 28, vx);
+	_mav_put_float(buf, 32, vy);
+	_mav_put_float(buf, 36, vz);
+	_mav_put_uint8_t(buf, 184, estimator_type);
+	_mav_put_float_array(buf, 40, covariance, 36);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
+#else
+	mavlink_global_position_int_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+}
+
+/**
+ * @brief Encode a global_position_int_cov struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param global_position_int_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
+{
+	return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
+}
+
+/**
+ * @brief Encode a global_position_int_cov struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param global_position_int_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
+{
+	return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
+}
+
+/**
+ * @brief Send a global_position_int_cov message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param lat Latitude, expressed as degrees * 1E7
+ * @param lon Longitude, expressed as degrees * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
+ * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s
+ * @param vy Ground Y Speed (Longitude), expressed as m/s
+ * @param vz Ground Z Speed (Altitude), expressed as m/s
+ * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_int32_t(buf, 12, lat);
+	_mav_put_int32_t(buf, 16, lon);
+	_mav_put_int32_t(buf, 20, alt);
+	_mav_put_int32_t(buf, 24, relative_alt);
+	_mav_put_float(buf, 28, vx);
+	_mav_put_float(buf, 32, vy);
+	_mav_put_float(buf, 36, vz);
+	_mav_put_uint8_t(buf, 184, estimator_type);
+	_mav_put_float_array(buf, 40, covariance, 36);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+#else
+	mavlink_global_position_int_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.relative_alt = relative_alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+#endif
+}
+
+/**
+ * @brief Send a global_position_int_cov message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_global_position_int_cov_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_cov_t* global_position_int_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_global_position_int_cov_send(chan, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)global_position_int_cov, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_int32_t(buf, 12, lat);
+	_mav_put_int32_t(buf, 16, lon);
+	_mav_put_int32_t(buf, 20, alt);
+	_mav_put_int32_t(buf, 24, relative_alt);
+	_mav_put_float(buf, 28, vx);
+	_mav_put_float(buf, 32, vy);
+	_mav_put_float(buf, 36, vz);
+	_mav_put_uint8_t(buf, 184, estimator_type);
+	_mav_put_float_array(buf, 40, covariance, 36);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+#else
+	mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf;
+	packet->time_utc = time_utc;
+	packet->time_boot_ms = time_boot_ms;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->relative_alt = relative_alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->estimator_type = estimator_type;
+	mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GLOBAL_POSITION_INT_COV UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from global_position_int_cov message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_global_position_int_cov_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field time_utc from global_position_int_cov message
+ *
+ * @return Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ */
+static inline uint64_t mavlink_msg_global_position_int_cov_get_time_utc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field estimator_type from global_position_int_cov message
+ *
+ * @return Class id of the estimator this estimate originated from.
+ */
+static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  184);
+}
+
+/**
+ * @brief Get field lat from global_position_int_cov message
+ *
+ * @return Latitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field lon from global_position_int_cov message
+ *
+ * @return Longitude, expressed as degrees * 1E7
+ */
+static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field alt from global_position_int_cov message
+ *
+ * @return Altitude in meters, expressed as * 1000 (millimeters), above MSL
+ */
+static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  20);
+}
+
+/**
+ * @brief Get field relative_alt from global_position_int_cov message
+ *
+ * @return Altitude above ground in meters, expressed as * 1000 (millimeters)
+ */
+static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  24);
+}
+
+/**
+ * @brief Get field vx from global_position_int_cov message
+ *
+ * @return Ground X Speed (Latitude), expressed as m/s
+ */
+static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field vy from global_position_int_cov message
+ *
+ * @return Ground Y Speed (Longitude), expressed as m/s
+ */
+static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field vz from global_position_int_cov message
+ *
+ * @return Ground Z Speed (Altitude), expressed as m/s
+ */
+static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field covariance from global_position_int_cov message
+ *
+ * @return Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
+ */
+static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
+{
+	return _MAV_RETURN_float_array(msg, covariance, 36,  40);
+}
+
+/**
+ * @brief Decode a global_position_int_cov message into a struct
+ *
+ * @param msg The message to decode
+ * @param global_position_int_cov C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	global_position_int_cov->time_utc = mavlink_msg_global_position_int_cov_get_time_utc(msg);
+	global_position_int_cov->time_boot_ms = mavlink_msg_global_position_int_cov_get_time_boot_ms(msg);
+	global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg);
+	global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg);
+	global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg);
+	global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg);
+	global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg);
+	global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg);
+	global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg);
+	mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance);
+	global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN;
+        memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
+	memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_vision_position_estimate.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_vision_position_estimate.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_global_vision_position_estimate.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING
+
+#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101
+
+typedef struct MAVLINK_PACKED __mavlink_global_vision_position_estimate_t
+{
+ uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float x; /*< Global X position*/
+ float y; /*< Global Y position*/
+ float z; /*< Global Z position*/
+ float roll; /*< Roll angle in rad*/
+ float pitch; /*< Pitch angle in rad*/
+ float yaw; /*< Yaw angle in rad*/
+} mavlink_global_vision_position_estimate_t;
+
+#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32
+#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32
+#define MAVLINK_MSG_ID_101_LEN 32
+#define MAVLINK_MSG_ID_101_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102
+#define MAVLINK_MSG_ID_101_CRC 102
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
+	101, \
+	"GLOBAL_VISION_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
+	"GLOBAL_VISION_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a global_vision_position_estimate message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_global_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Pack a global_vision_position_estimate message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_global_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Encode a global_vision_position_estimate struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param global_vision_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
+{
+	return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
+}
+
+/**
+ * @brief Encode a global_vision_position_estimate struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param global_vision_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
+{
+	return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
+}
+
+/**
+ * @brief Send a global_vision_position_estimate message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_global_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a global_vision_position_estimate message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_global_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_global_vision_position_estimate_send(chan, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)global_vision_position_estimate, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf;
+	packet->usec = usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE UNPACKING
+
+
+/**
+ * @brief Get field usec from global_vision_position_estimate message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from global_vision_position_estimate message
+ *
+ * @return Global X position
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y from global_vision_position_estimate message
+ *
+ * @return Global Y position
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z from global_vision_position_estimate message
+ *
+ * @return Global Z position
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field roll from global_vision_position_estimate message
+ *
+ * @return Roll angle in rad
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitch from global_vision_position_estimate message
+ *
+ * @return Pitch angle in rad
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yaw from global_vision_position_estimate message
+ *
+ * @return Yaw angle in rad
+ */
+static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Decode a global_vision_position_estimate message into a struct
+ *
+ * @param msg The message to decode
+ * @param global_vision_position_estimate C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg);
+	global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg);
+	global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg);
+	global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg);
+	global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg);
+	global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg);
+	global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN;
+        memset(global_vision_position_estimate, 0, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
+	memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_raw.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_raw.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_raw.h	(revision 209)
@@ -0,0 +1,487 @@
+// MESSAGE GPS2_RAW PACKING
+
+#define MAVLINK_MSG_ID_GPS2_RAW 124
+
+typedef struct MAVLINK_PACKED __mavlink_gps2_raw_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
+ int32_t alt; /*< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)*/
+ uint32_t dgps_age; /*< Age of DGPS info*/
+ uint16_t eph; /*< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/
+ uint16_t epv; /*< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/
+ uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/
+ uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
+ uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/
+ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
+ uint8_t dgps_numch; /*< Number of DGPS satellites*/
+} mavlink_gps2_raw_t;
+
+#define MAVLINK_MSG_ID_GPS2_RAW_LEN 35
+#define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 35
+#define MAVLINK_MSG_ID_124_LEN 35
+#define MAVLINK_MSG_ID_124_MIN_LEN 35
+
+#define MAVLINK_MSG_ID_GPS2_RAW_CRC 87
+#define MAVLINK_MSG_ID_124_CRC 87
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
+	124, \
+	"GPS2_RAW", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
+         { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
+         { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
+	"GPS2_RAW", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
+         { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
+         { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps2_raw message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @param dgps_numch Number of DGPS satellites
+ * @param dgps_age Age of DGPS info
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint32_t(buf, 20, dgps_age);
+	_mav_put_uint16_t(buf, 24, eph);
+	_mav_put_uint16_t(buf, 26, epv);
+	_mav_put_uint16_t(buf, 28, vel);
+	_mav_put_uint16_t(buf, 30, cog);
+	_mav_put_uint8_t(buf, 32, fix_type);
+	_mav_put_uint8_t(buf, 33, satellites_visible);
+	_mav_put_uint8_t(buf, 34, dgps_numch);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
+#else
+	mavlink_gps2_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.dgps_age = dgps_age;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+	packet.dgps_numch = dgps_numch;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+}
+
+/**
+ * @brief Pack a gps2_raw message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @param dgps_numch Number of DGPS satellites
+ * @param dgps_age Age of DGPS info
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint32_t(buf, 20, dgps_age);
+	_mav_put_uint16_t(buf, 24, eph);
+	_mav_put_uint16_t(buf, 26, epv);
+	_mav_put_uint16_t(buf, 28, vel);
+	_mav_put_uint16_t(buf, 30, cog);
+	_mav_put_uint8_t(buf, 32, fix_type);
+	_mav_put_uint8_t(buf, 33, satellites_visible);
+	_mav_put_uint8_t(buf, 34, dgps_numch);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
+#else
+	mavlink_gps2_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.dgps_age = dgps_age;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+	packet.dgps_numch = dgps_numch;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+}
+
+/**
+ * @brief Encode a gps2_raw struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps2_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
+{
+	return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
+}
+
+/**
+ * @brief Encode a gps2_raw struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps2_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
+{
+	return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
+}
+
+/**
+ * @brief Send a gps2_raw message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @param dgps_numch Number of DGPS satellites
+ * @param dgps_age Age of DGPS info
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint32_t(buf, 20, dgps_age);
+	_mav_put_uint16_t(buf, 24, eph);
+	_mav_put_uint16_t(buf, 26, epv);
+	_mav_put_uint16_t(buf, 28, vel);
+	_mav_put_uint16_t(buf, 30, cog);
+	_mav_put_uint8_t(buf, 32, fix_type);
+	_mav_put_uint8_t(buf, 33, satellites_visible);
+	_mav_put_uint8_t(buf, 34, dgps_numch);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+#else
+	mavlink_gps2_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.dgps_age = dgps_age;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+	packet.dgps_numch = dgps_numch;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps2_raw message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, const mavlink_gps2_raw_t* gps2_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)gps2_raw, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS2_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint32_t(buf, 20, dgps_age);
+	_mav_put_uint16_t(buf, 24, eph);
+	_mav_put_uint16_t(buf, 26, epv);
+	_mav_put_uint16_t(buf, 28, vel);
+	_mav_put_uint16_t(buf, 30, cog);
+	_mav_put_uint8_t(buf, 32, fix_type);
+	_mav_put_uint8_t(buf, 33, satellites_visible);
+	_mav_put_uint8_t(buf, 34, dgps_numch);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+#else
+	mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->dgps_age = dgps_age;
+	packet->eph = eph;
+	packet->epv = epv;
+	packet->vel = vel;
+	packet->cog = cog;
+	packet->fix_type = fix_type;
+	packet->satellites_visible = satellites_visible;
+	packet->dgps_numch = dgps_numch;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS2_RAW UNPACKING
+
+
+/**
+ * @brief Get field time_usec from gps2_raw message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field fix_type from gps2_raw message
+ *
+ * @return 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ */
+static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field lat from gps2_raw message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field lon from gps2_raw message
+ *
+ * @return Longitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field alt from gps2_raw message
+ *
+ * @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field eph from gps2_raw message
+ *
+ * @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field epv from gps2_raw message
+ *
+ * @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Get field vel from gps2_raw message
+ *
+ * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field cog from gps2_raw message
+ *
+ * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  30);
+}
+
+/**
+ * @brief Get field satellites_visible from gps2_raw message
+ *
+ * @return Number of satellites visible. If unknown, set to 255
+ */
+static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field dgps_numch from gps2_raw message
+ *
+ * @return Number of DGPS satellites
+ */
+static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field dgps_age from gps2_raw message
+ *
+ * @return Age of DGPS info
+ */
+static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  20);
+}
+
+/**
+ * @brief Decode a gps2_raw message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps2_raw C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mavlink_gps2_raw_t* gps2_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg);
+	gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg);
+	gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg);
+	gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg);
+	gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg);
+	gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg);
+	gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg);
+	gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg);
+	gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg);
+	gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg);
+	gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg);
+	gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RAW_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RAW_LEN;
+        memset(gps2_raw, 0, MAVLINK_MSG_ID_GPS2_RAW_LEN);
+	memcpy(gps2_raw, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_rtk.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_rtk.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps2_rtk.h	(revision 209)
@@ -0,0 +1,512 @@
+// MESSAGE GPS2_RTK PACKING
+
+#define MAVLINK_MSG_ID_GPS2_RTK 128
+
+typedef struct MAVLINK_PACKED __mavlink_gps2_rtk_t
+{
+ uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/
+ uint32_t tow; /*< GPS Time of Week of last baseline*/
+ int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/
+ int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/
+ int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/
+ uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
+ int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
+ uint16_t wn; /*< GPS Week Number of last baseline*/
+ uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
+ uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
+ uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/
+ uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
+ uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/
+} mavlink_gps2_rtk_t;
+
+#define MAVLINK_MSG_ID_GPS2_RTK_LEN 35
+#define MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN 35
+#define MAVLINK_MSG_ID_128_LEN 35
+#define MAVLINK_MSG_ID_128_MIN_LEN 35
+
+#define MAVLINK_MSG_ID_GPS2_RTK_CRC 226
+#define MAVLINK_MSG_ID_128_CRC 226
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
+	128, \
+	"GPS2_RTK", \
+	13, \
+	{  { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
+         { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
+         { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
+         { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
+         { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
+         { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
+         { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
+         { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
+         { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
+         { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
+         { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
+         { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
+         { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
+	"GPS2_RTK", \
+	13, \
+	{  { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
+         { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
+         { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
+         { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
+         { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
+         { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
+         { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
+         { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
+         { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
+         { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
+         { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
+         { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
+         { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps2_rtk message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
+#else
+	mavlink_gps2_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+}
+
+/**
+ * @brief Pack a gps2_rtk message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
+#else
+	mavlink_gps2_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+}
+
+/**
+ * @brief Encode a gps2_rtk struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps2_rtk C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps2_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
+{
+	return mavlink_msg_gps2_rtk_pack(system_id, component_id, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
+}
+
+/**
+ * @brief Encode a gps2_rtk struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps2_rtk C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
+{
+	return mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, chan, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
+}
+
+/**
+ * @brief Send a gps2_rtk message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps2_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+#else
+	mavlink_gps2_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps2_rtk message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps2_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps2_rtk_t* gps2_rtk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps2_rtk_send(chan, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)gps2_rtk, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS2_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+#else
+	mavlink_gps2_rtk_t *packet = (mavlink_gps2_rtk_t *)msgbuf;
+	packet->time_last_baseline_ms = time_last_baseline_ms;
+	packet->tow = tow;
+	packet->baseline_a_mm = baseline_a_mm;
+	packet->baseline_b_mm = baseline_b_mm;
+	packet->baseline_c_mm = baseline_c_mm;
+	packet->accuracy = accuracy;
+	packet->iar_num_hypotheses = iar_num_hypotheses;
+	packet->wn = wn;
+	packet->rtk_receiver_id = rtk_receiver_id;
+	packet->rtk_health = rtk_health;
+	packet->rtk_rate = rtk_rate;
+	packet->nsats = nsats;
+	packet->baseline_coords_type = baseline_coords_type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS2_RTK UNPACKING
+
+
+/**
+ * @brief Get field time_last_baseline_ms from gps2_rtk message
+ *
+ * @return Time since boot of last baseline message received in ms.
+ */
+static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field rtk_receiver_id from gps2_rtk message
+ *
+ * @return Identification of connected RTK receiver.
+ */
+static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  30);
+}
+
+/**
+ * @brief Get field wn from gps2_rtk message
+ *
+ * @return GPS Week Number of last baseline
+ */
+static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field tow from gps2_rtk message
+ *
+ * @return GPS Time of Week of last baseline
+ */
+static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  4);
+}
+
+/**
+ * @brief Get field rtk_health from gps2_rtk message
+ *
+ * @return GPS-specific health report for RTK data.
+ */
+static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  31);
+}
+
+/**
+ * @brief Get field rtk_rate from gps2_rtk message
+ *
+ * @return Rate of baseline messages being received by GPS, in HZ
+ */
+static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field nsats from gps2_rtk message
+ *
+ * @return Current number of sats used for RTK calculation.
+ */
+static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field baseline_coords_type from gps2_rtk message
+ *
+ * @return Coordinate system of baseline. 0 == ECEF, 1 == NED
+ */
+static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field baseline_a_mm from gps2_rtk message
+ *
+ * @return Current baseline in ECEF x or NED north component in mm.
+ */
+static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field baseline_b_mm from gps2_rtk message
+ *
+ * @return Current baseline in ECEF y or NED east component in mm.
+ */
+static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field baseline_c_mm from gps2_rtk message
+ *
+ * @return Current baseline in ECEF z or NED down component in mm.
+ */
+static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field accuracy from gps2_rtk message
+ *
+ * @return Current estimate of baseline accuracy.
+ */
+static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  20);
+}
+
+/**
+ * @brief Get field iar_num_hypotheses from gps2_rtk message
+ *
+ * @return Current number of integer ambiguity hypotheses.
+ */
+static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  24);
+}
+
+/**
+ * @brief Decode a gps2_rtk message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps2_rtk C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps2_rtk_decode(const mavlink_message_t* msg, mavlink_gps2_rtk_t* gps2_rtk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps2_rtk->time_last_baseline_ms = mavlink_msg_gps2_rtk_get_time_last_baseline_ms(msg);
+	gps2_rtk->tow = mavlink_msg_gps2_rtk_get_tow(msg);
+	gps2_rtk->baseline_a_mm = mavlink_msg_gps2_rtk_get_baseline_a_mm(msg);
+	gps2_rtk->baseline_b_mm = mavlink_msg_gps2_rtk_get_baseline_b_mm(msg);
+	gps2_rtk->baseline_c_mm = mavlink_msg_gps2_rtk_get_baseline_c_mm(msg);
+	gps2_rtk->accuracy = mavlink_msg_gps2_rtk_get_accuracy(msg);
+	gps2_rtk->iar_num_hypotheses = mavlink_msg_gps2_rtk_get_iar_num_hypotheses(msg);
+	gps2_rtk->wn = mavlink_msg_gps2_rtk_get_wn(msg);
+	gps2_rtk->rtk_receiver_id = mavlink_msg_gps2_rtk_get_rtk_receiver_id(msg);
+	gps2_rtk->rtk_health = mavlink_msg_gps2_rtk_get_rtk_health(msg);
+	gps2_rtk->rtk_rate = mavlink_msg_gps2_rtk_get_rtk_rate(msg);
+	gps2_rtk->nsats = mavlink_msg_gps2_rtk_get_nsats(msg);
+	gps2_rtk->baseline_coords_type = mavlink_msg_gps2_rtk_get_baseline_coords_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RTK_LEN;
+        memset(gps2_rtk, 0, MAVLINK_MSG_ID_GPS2_RTK_LEN);
+	memcpy(gps2_rtk, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_global_origin.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_global_origin.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_global_origin.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE GPS_GLOBAL_ORIGIN PACKING
+
+#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49
+
+typedef struct MAVLINK_PACKED __mavlink_gps_global_origin_t
+{
+ int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t longitude; /*< Longitude (WGS84), in degrees * 1E7*/
+ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
+} mavlink_gps_global_origin_t;
+
+#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12
+#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN 12
+#define MAVLINK_MSG_ID_49_LEN 12
+#define MAVLINK_MSG_ID_49_MIN_LEN 12
+
+#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39
+#define MAVLINK_MSG_ID_49_CRC 39
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
+	49, \
+	"GPS_GLOBAL_ORIGIN", \
+	3, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
+	"GPS_GLOBAL_ORIGIN", \
+	3, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_global_origin message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84), in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
+#else
+	mavlink_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+}
+
+/**
+ * @brief Pack a gps_global_origin message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84), in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t latitude,int32_t longitude,int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
+#else
+	mavlink_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+}
+
+/**
+ * @brief Encode a gps_global_origin struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_global_origin C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
+{
+	return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
+}
+
+/**
+ * @brief Encode a gps_global_origin struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_global_origin C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
+{
+	return mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, chan, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
+}
+
+/**
+ * @brief Send a gps_global_origin message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84), in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+#else
+	mavlink_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_global_origin message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_gps_global_origin_t* gps_global_origin)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_global_origin_send(chan, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)gps_global_origin, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+#else
+	mavlink_gps_global_origin_t *packet = (mavlink_gps_global_origin_t *)msgbuf;
+	packet->latitude = latitude;
+	packet->longitude = longitude;
+	packet->altitude = altitude;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_GLOBAL_ORIGIN UNPACKING
+
+
+/**
+ * @brief Get field latitude from gps_global_origin message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field longitude from gps_global_origin message
+ *
+ * @return Longitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field altitude from gps_global_origin message
+ *
+ * @return Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Decode a gps_global_origin message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_global_origin C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_global_origin_t* gps_global_origin)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg);
+	gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg);
+	gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN;
+        memset(gps_global_origin, 0, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
+	memcpy(gps_global_origin, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_inject_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_inject_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_inject_data.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE GPS_INJECT_DATA PACKING
+
+#define MAVLINK_MSG_ID_GPS_INJECT_DATA 123
+
+typedef struct MAVLINK_PACKED __mavlink_gps_inject_data_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t len; /*< data length*/
+ uint8_t data[110]; /*< raw data (110 is enough for 12 satellites of RTCMv2)*/
+} mavlink_gps_inject_data_t;
+
+#define MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113
+#define MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN 113
+#define MAVLINK_MSG_ID_123_LEN 113
+#define MAVLINK_MSG_ID_123_MIN_LEN 113
+
+#define MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC 250
+#define MAVLINK_MSG_ID_123_CRC 250
+
+#define MAVLINK_MSG_GPS_INJECT_DATA_FIELD_DATA_LEN 110
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
+	123, \
+	"GPS_INJECT_DATA", \
+	4, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
+         { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
+	"GPS_INJECT_DATA", \
+	4, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
+         { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_inject_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param len data length
+ * @param data raw data (110 is enough for 12 satellites of RTCMv2)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, len);
+	_mav_put_uint8_t_array(buf, 3, data, 110);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
+#else
+	mavlink_gps_inject_data_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+}
+
+/**
+ * @brief Pack a gps_inject_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param len data length
+ * @param data raw data (110 is enough for 12 satellites of RTCMv2)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint8_t len,const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, len);
+	_mav_put_uint8_t_array(buf, 3, data, 110);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
+#else
+	mavlink_gps_inject_data_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+}
+
+/**
+ * @brief Encode a gps_inject_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_inject_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_inject_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
+{
+	return mavlink_msg_gps_inject_data_pack(system_id, component_id, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
+}
+
+/**
+ * @brief Encode a gps_inject_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_inject_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
+{
+	return mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, chan, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
+}
+
+/**
+ * @brief Send a gps_inject_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param len data length
+ * @param data raw data (110 is enough for 12 satellites of RTCMv2)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_inject_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, len);
+	_mav_put_uint8_t_array(buf, 3, data, 110);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+#else
+	mavlink_gps_inject_data_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_inject_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_inject_data_send_struct(mavlink_channel_t chan, const mavlink_gps_inject_data_t* gps_inject_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_inject_data_send(chan, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)gps_inject_data, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, len);
+	_mav_put_uint8_t_array(buf, 3, data, 110);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+#else
+	mavlink_gps_inject_data_t *packet = (mavlink_gps_inject_data_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->len = len;
+	mav_array_memcpy(packet->data, data, sizeof(uint8_t)*110);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_INJECT_DATA UNPACKING
+
+
+/**
+ * @brief Get field target_system from gps_inject_data message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from gps_inject_data message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field len from gps_inject_data message
+ *
+ * @return data length
+ */
+static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field data from gps_inject_data message
+ *
+ * @return raw data (110 is enough for 12 satellites of RTCMv2)
+ */
+static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_message_t* msg, uint8_t *data)
+{
+	return _MAV_RETURN_uint8_t_array(msg, data, 110,  3);
+}
+
+/**
+ * @brief Decode a gps_inject_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_inject_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_inject_data_decode(const mavlink_message_t* msg, mavlink_gps_inject_data_t* gps_inject_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_inject_data->target_system = mavlink_msg_gps_inject_data_get_target_system(msg);
+	gps_inject_data->target_component = mavlink_msg_gps_inject_data_get_target_component(msg);
+	gps_inject_data->len = mavlink_msg_gps_inject_data_get_len(msg);
+	mavlink_msg_gps_inject_data_get_data(msg, gps_inject_data->data);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN;
+        memset(gps_inject_data, 0, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
+	memcpy(gps_inject_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_raw_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_raw_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_raw_int.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE GPS_RAW_INT PACKING
+
+#define MAVLINK_MSG_ID_GPS_RAW_INT 24
+
+typedef struct MAVLINK_PACKED __mavlink_gps_raw_int_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
+ int32_t alt; /*< Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.*/
+ uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
+ uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/
+ uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/
+ uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
+ uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/
+ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
+} mavlink_gps_raw_int_t;
+
+#define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30
+#define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30
+#define MAVLINK_MSG_ID_24_LEN 30
+#define MAVLINK_MSG_ID_24_MIN_LEN 30
+
+#define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24
+#define MAVLINK_MSG_ID_24_CRC 24
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
+	24, \
+	"GPS_RAW_INT", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
+	"GPS_RAW_INT", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_raw_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
+ * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_uint16_t(buf, 26, cog);
+	_mav_put_uint8_t(buf, 28, fix_type);
+	_mav_put_uint8_t(buf, 29, satellites_visible);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
+#else
+	mavlink_gps_raw_int_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+}
+
+/**
+ * @brief Pack a gps_raw_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
+ * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_uint16_t(buf, 26, cog);
+	_mav_put_uint8_t(buf, 28, fix_type);
+	_mav_put_uint8_t(buf, 29, satellites_visible);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
+#else
+	mavlink_gps_raw_int_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+}
+
+/**
+ * @brief Encode a gps_raw_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_raw_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
+{
+	return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
+}
+
+/**
+ * @brief Encode a gps_raw_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_raw_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
+{
+	return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
+}
+
+/**
+ * @brief Send a gps_raw_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
+ * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_uint16_t(buf, 26, cog);
+	_mav_put_uint8_t(buf, 28, fix_type);
+	_mav_put_uint8_t(buf, 29, satellites_visible);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+#else
+	mavlink_gps_raw_int_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_raw_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_raw_int_send_struct(mavlink_channel_t chan, const mavlink_gps_raw_int_t* gps_raw_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_raw_int_send(chan, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)gps_raw_int, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_RAW_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_uint16_t(buf, 26, cog);
+	_mav_put_uint8_t(buf, 28, fix_type);
+	_mav_put_uint8_t(buf, 29, satellites_visible);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+#else
+	mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->eph = eph;
+	packet->epv = epv;
+	packet->vel = vel;
+	packet->cog = cog;
+	packet->fix_type = fix_type;
+	packet->satellites_visible = satellites_visible;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_RAW_INT UNPACKING
+
+
+/**
+ * @brief Get field time_usec from gps_raw_int message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field fix_type from gps_raw_int message
+ *
+ * @return 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ */
+static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  28);
+}
+
+/**
+ * @brief Get field lat from gps_raw_int message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field lon from gps_raw_int message
+ *
+ * @return Longitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field alt from gps_raw_int message
+ *
+ * @return Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
+ */
+static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field eph from gps_raw_int message
+ *
+ * @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Get field epv from gps_raw_int message
+ *
+ * @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field vel from gps_raw_int message
+ *
+ * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field cog from gps_raw_int message
+ *
+ * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
+ */
+static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Get field satellites_visible from gps_raw_int message
+ *
+ * @return Number of satellites visible. If unknown, set to 255
+ */
+static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  29);
+}
+
+/**
+ * @brief Decode a gps_raw_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_raw_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg);
+	gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg);
+	gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg);
+	gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg);
+	gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg);
+	gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg);
+	gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg);
+	gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg);
+	gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg);
+	gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RAW_INT_LEN? msg->len : MAVLINK_MSG_ID_GPS_RAW_INT_LEN;
+        memset(gps_raw_int, 0, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
+	memcpy(gps_raw_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtcm_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtcm_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtcm_data.h	(revision 209)
@@ -0,0 +1,254 @@
+// MESSAGE GPS_RTCM_DATA PACKING
+
+#define MAVLINK_MSG_ID_GPS_RTCM_DATA 233
+
+typedef struct MAVLINK_PACKED __mavlink_gps_rtcm_data_t
+{
+ uint8_t flags; /*< LSB: 1 means message is fragmented*/
+ uint8_t len; /*< data length*/
+ uint8_t data[180]; /*< RTCM message (may be fragmented)*/
+} mavlink_gps_rtcm_data_t;
+
+#define MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN 182
+#define MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN 182
+#define MAVLINK_MSG_ID_233_LEN 182
+#define MAVLINK_MSG_ID_233_MIN_LEN 182
+
+#define MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC 35
+#define MAVLINK_MSG_ID_233_CRC 35
+
+#define MAVLINK_MSG_GPS_RTCM_DATA_FIELD_DATA_LEN 180
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
+	233, \
+	"GPS_RTCM_DATA", \
+	3, \
+	{  { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
+         { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
+	"GPS_RTCM_DATA", \
+	3, \
+	{  { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
+         { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_rtcm_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param flags LSB: 1 means message is fragmented
+ * @param len data length
+ * @param data RTCM message (may be fragmented)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_rtcm_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t flags, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, flags);
+	_mav_put_uint8_t(buf, 1, len);
+	_mav_put_uint8_t_array(buf, 2, data, 180);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
+#else
+	mavlink_gps_rtcm_data_t packet;
+	packet.flags = flags;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+}
+
+/**
+ * @brief Pack a gps_rtcm_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param flags LSB: 1 means message is fragmented
+ * @param len data length
+ * @param data RTCM message (may be fragmented)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_rtcm_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t flags,uint8_t len,const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, flags);
+	_mav_put_uint8_t(buf, 1, len);
+	_mav_put_uint8_t_array(buf, 2, data, 180);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
+#else
+	mavlink_gps_rtcm_data_t packet;
+	packet.flags = flags;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+}
+
+/**
+ * @brief Encode a gps_rtcm_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_rtcm_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_rtcm_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
+{
+	return mavlink_msg_gps_rtcm_data_pack(system_id, component_id, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
+}
+
+/**
+ * @brief Encode a gps_rtcm_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_rtcm_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_rtcm_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
+{
+	return mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, chan, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
+}
+
+/**
+ * @brief Send a gps_rtcm_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param flags LSB: 1 means message is fragmented
+ * @param len data length
+ * @param data RTCM message (may be fragmented)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_rtcm_data_send(mavlink_channel_t chan, uint8_t flags, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
+	_mav_put_uint8_t(buf, 0, flags);
+	_mav_put_uint8_t(buf, 1, len);
+	_mav_put_uint8_t_array(buf, 2, data, 180);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+#else
+	mavlink_gps_rtcm_data_t packet;
+	packet.flags = flags;
+	packet.len = len;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_rtcm_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_rtcm_data_send_struct(mavlink_channel_t chan, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_rtcm_data_send(chan, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)gps_rtcm_data, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_rtcm_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t flags, uint8_t len, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, flags);
+	_mav_put_uint8_t(buf, 1, len);
+	_mav_put_uint8_t_array(buf, 2, data, 180);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+#else
+	mavlink_gps_rtcm_data_t *packet = (mavlink_gps_rtcm_data_t *)msgbuf;
+	packet->flags = flags;
+	packet->len = len;
+	mav_array_memcpy(packet->data, data, sizeof(uint8_t)*180);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_RTCM_DATA UNPACKING
+
+
+/**
+ * @brief Get field flags from gps_rtcm_data message
+ *
+ * @return LSB: 1 means message is fragmented
+ */
+static inline uint8_t mavlink_msg_gps_rtcm_data_get_flags(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field len from gps_rtcm_data message
+ *
+ * @return data length
+ */
+static inline uint8_t mavlink_msg_gps_rtcm_data_get_len(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field data from gps_rtcm_data message
+ *
+ * @return RTCM message (may be fragmented)
+ */
+static inline uint16_t mavlink_msg_gps_rtcm_data_get_data(const mavlink_message_t* msg, uint8_t *data)
+{
+	return _MAV_RETURN_uint8_t_array(msg, data, 180,  2);
+}
+
+/**
+ * @brief Decode a gps_rtcm_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_rtcm_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_rtcm_data_decode(const mavlink_message_t* msg, mavlink_gps_rtcm_data_t* gps_rtcm_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_rtcm_data->flags = mavlink_msg_gps_rtcm_data_get_flags(msg);
+	gps_rtcm_data->len = mavlink_msg_gps_rtcm_data_get_len(msg);
+	mavlink_msg_gps_rtcm_data_get_data(msg, gps_rtcm_data->data);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN;
+        memset(gps_rtcm_data, 0, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
+	memcpy(gps_rtcm_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtk.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtk.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_rtk.h	(revision 209)
@@ -0,0 +1,512 @@
+// MESSAGE GPS_RTK PACKING
+
+#define MAVLINK_MSG_ID_GPS_RTK 127
+
+typedef struct MAVLINK_PACKED __mavlink_gps_rtk_t
+{
+ uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/
+ uint32_t tow; /*< GPS Time of Week of last baseline*/
+ int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/
+ int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/
+ int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/
+ uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
+ int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
+ uint16_t wn; /*< GPS Week Number of last baseline*/
+ uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
+ uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
+ uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/
+ uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
+ uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/
+} mavlink_gps_rtk_t;
+
+#define MAVLINK_MSG_ID_GPS_RTK_LEN 35
+#define MAVLINK_MSG_ID_GPS_RTK_MIN_LEN 35
+#define MAVLINK_MSG_ID_127_LEN 35
+#define MAVLINK_MSG_ID_127_MIN_LEN 35
+
+#define MAVLINK_MSG_ID_GPS_RTK_CRC 25
+#define MAVLINK_MSG_ID_127_CRC 25
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
+	127, \
+	"GPS_RTK", \
+	13, \
+	{  { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
+         { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
+         { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
+         { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
+         { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
+         { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
+         { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
+         { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
+         { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
+         { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
+         { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
+         { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
+         { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
+	"GPS_RTK", \
+	13, \
+	{  { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
+         { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
+         { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
+         { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
+         { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
+         { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
+         { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
+         { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
+         { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
+         { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
+         { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
+         { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
+         { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_rtk message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
+#else
+	mavlink_gps_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+}
+
+/**
+ * @brief Pack a gps_rtk message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
+#else
+	mavlink_gps_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+}
+
+/**
+ * @brief Encode a gps_rtk struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_rtk C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
+{
+	return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
+}
+
+/**
+ * @brief Encode a gps_rtk struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_rtk C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
+{
+	return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
+}
+
+/**
+ * @brief Send a gps_rtk message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_last_baseline_ms Time since boot of last baseline message received in ms.
+ * @param rtk_receiver_id Identification of connected RTK receiver.
+ * @param wn GPS Week Number of last baseline
+ * @param tow GPS Time of Week of last baseline
+ * @param rtk_health GPS-specific health report for RTK data.
+ * @param rtk_rate Rate of baseline messages being received by GPS, in HZ
+ * @param nsats Current number of sats used for RTK calculation.
+ * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
+ * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
+ * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
+ * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
+ * @param accuracy Current estimate of baseline accuracy.
+ * @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+#else
+	mavlink_gps_rtk_t packet;
+	packet.time_last_baseline_ms = time_last_baseline_ms;
+	packet.tow = tow;
+	packet.baseline_a_mm = baseline_a_mm;
+	packet.baseline_b_mm = baseline_b_mm;
+	packet.baseline_c_mm = baseline_c_mm;
+	packet.accuracy = accuracy;
+	packet.iar_num_hypotheses = iar_num_hypotheses;
+	packet.wn = wn;
+	packet.rtk_receiver_id = rtk_receiver_id;
+	packet.rtk_health = rtk_health;
+	packet.rtk_rate = rtk_rate;
+	packet.nsats = nsats;
+	packet.baseline_coords_type = baseline_coords_type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_rtk message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps_rtk_t* gps_rtk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_rtk_send(chan, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)gps_rtk, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
+	_mav_put_uint32_t(buf, 4, tow);
+	_mav_put_int32_t(buf, 8, baseline_a_mm);
+	_mav_put_int32_t(buf, 12, baseline_b_mm);
+	_mav_put_int32_t(buf, 16, baseline_c_mm);
+	_mav_put_uint32_t(buf, 20, accuracy);
+	_mav_put_int32_t(buf, 24, iar_num_hypotheses);
+	_mav_put_uint16_t(buf, 28, wn);
+	_mav_put_uint8_t(buf, 30, rtk_receiver_id);
+	_mav_put_uint8_t(buf, 31, rtk_health);
+	_mav_put_uint8_t(buf, 32, rtk_rate);
+	_mav_put_uint8_t(buf, 33, nsats);
+	_mav_put_uint8_t(buf, 34, baseline_coords_type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+#else
+	mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf;
+	packet->time_last_baseline_ms = time_last_baseline_ms;
+	packet->tow = tow;
+	packet->baseline_a_mm = baseline_a_mm;
+	packet->baseline_b_mm = baseline_b_mm;
+	packet->baseline_c_mm = baseline_c_mm;
+	packet->accuracy = accuracy;
+	packet->iar_num_hypotheses = iar_num_hypotheses;
+	packet->wn = wn;
+	packet->rtk_receiver_id = rtk_receiver_id;
+	packet->rtk_health = rtk_health;
+	packet->rtk_rate = rtk_rate;
+	packet->nsats = nsats;
+	packet->baseline_coords_type = baseline_coords_type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_RTK UNPACKING
+
+
+/**
+ * @brief Get field time_last_baseline_ms from gps_rtk message
+ *
+ * @return Time since boot of last baseline message received in ms.
+ */
+static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field rtk_receiver_id from gps_rtk message
+ *
+ * @return Identification of connected RTK receiver.
+ */
+static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  30);
+}
+
+/**
+ * @brief Get field wn from gps_rtk message
+ *
+ * @return GPS Week Number of last baseline
+ */
+static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field tow from gps_rtk message
+ *
+ * @return GPS Time of Week of last baseline
+ */
+static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  4);
+}
+
+/**
+ * @brief Get field rtk_health from gps_rtk message
+ *
+ * @return GPS-specific health report for RTK data.
+ */
+static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  31);
+}
+
+/**
+ * @brief Get field rtk_rate from gps_rtk message
+ *
+ * @return Rate of baseline messages being received by GPS, in HZ
+ */
+static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field nsats from gps_rtk message
+ *
+ * @return Current number of sats used for RTK calculation.
+ */
+static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field baseline_coords_type from gps_rtk message
+ *
+ * @return Coordinate system of baseline. 0 == ECEF, 1 == NED
+ */
+static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field baseline_a_mm from gps_rtk message
+ *
+ * @return Current baseline in ECEF x or NED north component in mm.
+ */
+static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field baseline_b_mm from gps_rtk message
+ *
+ * @return Current baseline in ECEF y or NED east component in mm.
+ */
+static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field baseline_c_mm from gps_rtk message
+ *
+ * @return Current baseline in ECEF z or NED down component in mm.
+ */
+static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field accuracy from gps_rtk message
+ *
+ * @return Current estimate of baseline accuracy.
+ */
+static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  20);
+}
+
+/**
+ * @brief Get field iar_num_hypotheses from gps_rtk message
+ *
+ * @return Current number of integer ambiguity hypotheses.
+ */
+static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  24);
+}
+
+/**
+ * @brief Decode a gps_rtk message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_rtk C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t* msg, mavlink_gps_rtk_t* gps_rtk)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg);
+	gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg);
+	gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg);
+	gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg);
+	gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg);
+	gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg);
+	gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg);
+	gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg);
+	gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg);
+	gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg);
+	gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg);
+	gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg);
+	gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTK_LEN;
+        memset(gps_rtk, 0, MAVLINK_MSG_ID_GPS_RTK_LEN);
+	memcpy(gps_rtk, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_gps_status.h	(revision 209)
@@ -0,0 +1,333 @@
+// MESSAGE GPS_STATUS PACKING
+
+#define MAVLINK_MSG_ID_GPS_STATUS 25
+
+typedef struct MAVLINK_PACKED __mavlink_gps_status_t
+{
+ uint8_t satellites_visible; /*< Number of satellites visible*/
+ uint8_t satellite_prn[20]; /*< Global satellite ID*/
+ uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/
+ uint8_t satellite_elevation[20]; /*< Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/
+ uint8_t satellite_azimuth[20]; /*< Direction of satellite, 0: 0 deg, 255: 360 deg.*/
+ uint8_t satellite_snr[20]; /*< Signal to noise ratio of satellite*/
+} mavlink_gps_status_t;
+
+#define MAVLINK_MSG_ID_GPS_STATUS_LEN 101
+#define MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN 101
+#define MAVLINK_MSG_ID_25_LEN 101
+#define MAVLINK_MSG_ID_25_MIN_LEN 101
+
+#define MAVLINK_MSG_ID_GPS_STATUS_CRC 23
+#define MAVLINK_MSG_ID_25_CRC 23
+
+#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_PRN_LEN 20
+#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_USED_LEN 20
+#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_ELEVATION_LEN 20
+#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_AZIMUTH_LEN 20
+#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_SNR_LEN 20
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
+	25, \
+	"GPS_STATUS", \
+	6, \
+	{  { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
+         { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
+         { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
+         { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
+         { "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
+         { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
+	"GPS_STATUS", \
+	6, \
+	{  { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
+         { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
+         { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
+         { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
+         { "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
+         { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a gps_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param satellites_visible Number of satellites visible
+ * @param satellite_prn Global satellite ID
+ * @param satellite_used 0: Satellite not used, 1: used for localization
+ * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite
+ * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg.
+ * @param satellite_snr Signal to noise ratio of satellite
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
+	_mav_put_uint8_t(buf, 0, satellites_visible);
+	_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
+	_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
+	_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
+	_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
+	_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
+#else
+	mavlink_gps_status_t packet;
+	packet.satellites_visible = satellites_visible;
+	mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a gps_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param satellites_visible Number of satellites visible
+ * @param satellite_prn Global satellite ID
+ * @param satellite_used 0: Satellite not used, 1: used for localization
+ * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite
+ * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg.
+ * @param satellite_snr Signal to noise ratio of satellite
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
+	_mav_put_uint8_t(buf, 0, satellites_visible);
+	_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
+	_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
+	_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
+	_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
+	_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
+#else
+	mavlink_gps_status_t packet;
+	packet.satellites_visible = satellites_visible;
+	mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a gps_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
+{
+	return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
+}
+
+/**
+ * @brief Encode a gps_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param gps_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
+{
+	return mavlink_msg_gps_status_pack_chan(system_id, component_id, chan, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
+}
+
+/**
+ * @brief Send a gps_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param satellites_visible Number of satellites visible
+ * @param satellite_prn Global satellite ID
+ * @param satellite_used 0: Satellite not used, 1: used for localization
+ * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite
+ * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg.
+ * @param satellite_snr Signal to noise ratio of satellite
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
+	_mav_put_uint8_t(buf, 0, satellites_visible);
+	_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
+	_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
+	_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
+	_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
+	_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+#else
+	mavlink_gps_status_t packet;
+	packet.satellites_visible = satellites_visible;
+	mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a gps_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_gps_status_send_struct(mavlink_channel_t chan, const mavlink_gps_status_t* gps_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_gps_status_send(chan, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)gps_status, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_GPS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, satellites_visible);
+	_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
+	_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
+	_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
+	_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
+	_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+#else
+	mavlink_gps_status_t *packet = (mavlink_gps_status_t *)msgbuf;
+	packet->satellites_visible = satellites_visible;
+	mav_array_memcpy(packet->satellite_prn, satellite_prn, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet->satellite_used, satellite_used, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet->satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet->satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
+	mav_array_memcpy(packet->satellite_snr, satellite_snr, sizeof(uint8_t)*20);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE GPS_STATUS UNPACKING
+
+
+/**
+ * @brief Get field satellites_visible from gps_status message
+ *
+ * @return Number of satellites visible
+ */
+static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field satellite_prn from gps_status message
+ *
+ * @return Global satellite ID
+ */
+static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, uint8_t *satellite_prn)
+{
+	return _MAV_RETURN_uint8_t_array(msg, satellite_prn, 20,  1);
+}
+
+/**
+ * @brief Get field satellite_used from gps_status message
+ *
+ * @return 0: Satellite not used, 1: used for localization
+ */
+static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, uint8_t *satellite_used)
+{
+	return _MAV_RETURN_uint8_t_array(msg, satellite_used, 20,  21);
+}
+
+/**
+ * @brief Get field satellite_elevation from gps_status message
+ *
+ * @return Elevation (0: right on top of receiver, 90: on the horizon) of satellite
+ */
+static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, uint8_t *satellite_elevation)
+{
+	return _MAV_RETURN_uint8_t_array(msg, satellite_elevation, 20,  41);
+}
+
+/**
+ * @brief Get field satellite_azimuth from gps_status message
+ *
+ * @return Direction of satellite, 0: 0 deg, 255: 360 deg.
+ */
+static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, uint8_t *satellite_azimuth)
+{
+	return _MAV_RETURN_uint8_t_array(msg, satellite_azimuth, 20,  61);
+}
+
+/**
+ * @brief Get field satellite_snr from gps_status message
+ *
+ * @return Signal to noise ratio of satellite
+ */
+static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, uint8_t *satellite_snr)
+{
+	return _MAV_RETURN_uint8_t_array(msg, satellite_snr, 20,  81);
+}
+
+/**
+ * @brief Decode a gps_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param gps_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, mavlink_gps_status_t* gps_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg);
+	mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn);
+	mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used);
+	mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation);
+	mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth);
+	mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_GPS_STATUS_LEN;
+        memset(gps_status, 0, MAVLINK_MSG_ID_GPS_STATUS_LEN);
+	memcpy(gps_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_heartbeat.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_heartbeat.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_heartbeat.h	(revision 209)
@@ -0,0 +1,334 @@
+// MESSAGE HEARTBEAT PACKING
+
+#define MAVLINK_MSG_ID_HEARTBEAT 0
+
+typedef struct MAVLINK_PACKED __mavlink_heartbeat_t
+{
+ uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/
+ uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)*/
+ uint8_t autopilot; /*< Autopilot type / class. defined in MAV_AUTOPILOT ENUM*/
+ uint8_t base_mode; /*< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h*/
+ uint8_t system_status; /*< System status flag, see MAV_STATE ENUM*/
+ uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/
+} mavlink_heartbeat_t;
+
+#define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
+#define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 9
+#define MAVLINK_MSG_ID_0_LEN 9
+#define MAVLINK_MSG_ID_0_MIN_LEN 9
+
+#define MAVLINK_MSG_ID_HEARTBEAT_CRC 50
+#define MAVLINK_MSG_ID_0_CRC 50
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
+	0, \
+	"HEARTBEAT", \
+	6, \
+	{  { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
+         { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
+         { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
+         { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
+         { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
+	"HEARTBEAT", \
+	6, \
+	{  { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
+         { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
+         { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
+         { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
+         { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a heartbeat message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
+ * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
+ * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
+ * @param custom_mode A bitfield for use for autopilot-specific flags.
+ * @param system_status System status flag, see MAV_STATE ENUM
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, type);
+	_mav_put_uint8_t(buf, 5, autopilot);
+	_mav_put_uint8_t(buf, 6, base_mode);
+	_mav_put_uint8_t(buf, 7, system_status);
+	_mav_put_uint8_t(buf, 8, 3);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
+#else
+	mavlink_heartbeat_t packet;
+	packet.custom_mode = custom_mode;
+	packet.type = type;
+	packet.autopilot = autopilot;
+	packet.base_mode = base_mode;
+	packet.system_status = system_status;
+	packet.mavlink_version = 3;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+}
+
+/**
+ * @brief Pack a heartbeat message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
+ * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
+ * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
+ * @param custom_mode A bitfield for use for autopilot-specific flags.
+ * @param system_status System status flag, see MAV_STATE ENUM
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, type);
+	_mav_put_uint8_t(buf, 5, autopilot);
+	_mav_put_uint8_t(buf, 6, base_mode);
+	_mav_put_uint8_t(buf, 7, system_status);
+	_mav_put_uint8_t(buf, 8, 3);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
+#else
+	mavlink_heartbeat_t packet;
+	packet.custom_mode = custom_mode;
+	packet.type = type;
+	packet.autopilot = autopilot;
+	packet.base_mode = base_mode;
+	packet.system_status = system_status;
+	packet.mavlink_version = 3;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+}
+
+/**
+ * @brief Encode a heartbeat struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param heartbeat C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
+{
+	return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
+}
+
+/**
+ * @brief Encode a heartbeat struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param heartbeat C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
+{
+	return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
+}
+
+/**
+ * @brief Send a heartbeat message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
+ * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
+ * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
+ * @param custom_mode A bitfield for use for autopilot-specific flags.
+ * @param system_status System status flag, see MAV_STATE ENUM
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, type);
+	_mav_put_uint8_t(buf, 5, autopilot);
+	_mav_put_uint8_t(buf, 6, base_mode);
+	_mav_put_uint8_t(buf, 7, system_status);
+	_mav_put_uint8_t(buf, 8, 3);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+#else
+	mavlink_heartbeat_t packet;
+	packet.custom_mode = custom_mode;
+	packet.type = type;
+	packet.autopilot = autopilot;
+	packet.base_mode = base_mode;
+	packet.system_status = system_status;
+	packet.mavlink_version = 3;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a heartbeat message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_heartbeat_t* heartbeat)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_heartbeat_send(chan, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)heartbeat, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, type);
+	_mav_put_uint8_t(buf, 5, autopilot);
+	_mav_put_uint8_t(buf, 6, base_mode);
+	_mav_put_uint8_t(buf, 7, system_status);
+	_mav_put_uint8_t(buf, 8, 3);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+#else
+	mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf;
+	packet->custom_mode = custom_mode;
+	packet->type = type;
+	packet->autopilot = autopilot;
+	packet->base_mode = base_mode;
+	packet->system_status = system_status;
+	packet->mavlink_version = 3;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HEARTBEAT UNPACKING
+
+
+/**
+ * @brief Get field type from heartbeat message
+ *
+ * @return Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
+ */
+static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field autopilot from heartbeat message
+ *
+ * @return Autopilot type / class. defined in MAV_AUTOPILOT ENUM
+ */
+static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field base_mode from heartbeat message
+ *
+ * @return System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
+ */
+static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  6);
+}
+
+/**
+ * @brief Get field custom_mode from heartbeat message
+ *
+ * @return A bitfield for use for autopilot-specific flags.
+ */
+static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field system_status from heartbeat message
+ *
+ * @return System status flag, see MAV_STATE ENUM
+ */
+static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  7);
+}
+
+/**
+ * @brief Get field mavlink_version from heartbeat message
+ *
+ * @return MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
+ */
+static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  8);
+}
+
+/**
+ * @brief Decode a heartbeat message into a struct
+ *
+ * @param msg The message to decode
+ * @param heartbeat C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg);
+	heartbeat->type = mavlink_msg_heartbeat_get_type(msg);
+	heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg);
+	heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg);
+	heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg);
+	heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_HEARTBEAT_LEN;
+        memset(heartbeat, 0, MAVLINK_MSG_ID_HEARTBEAT_LEN);
+	memcpy(heartbeat, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_highres_imu.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_highres_imu.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_highres_imu.h	(revision 209)
@@ -0,0 +1,562 @@
+// MESSAGE HIGHRES_IMU PACKING
+
+#define MAVLINK_MSG_ID_HIGHRES_IMU 105
+
+typedef struct MAVLINK_PACKED __mavlink_highres_imu_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float xacc; /*< X acceleration (m/s^2)*/
+ float yacc; /*< Y acceleration (m/s^2)*/
+ float zacc; /*< Z acceleration (m/s^2)*/
+ float xgyro; /*< Angular speed around X axis (rad / sec)*/
+ float ygyro; /*< Angular speed around Y axis (rad / sec)*/
+ float zgyro; /*< Angular speed around Z axis (rad / sec)*/
+ float xmag; /*< X Magnetic field (Gauss)*/
+ float ymag; /*< Y Magnetic field (Gauss)*/
+ float zmag; /*< Z Magnetic field (Gauss)*/
+ float abs_pressure; /*< Absolute pressure in millibar*/
+ float diff_pressure; /*< Differential pressure in millibar*/
+ float pressure_alt; /*< Altitude calculated from pressure*/
+ float temperature; /*< Temperature in degrees celsius*/
+ uint16_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/
+} mavlink_highres_imu_t;
+
+#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
+#define MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN 62
+#define MAVLINK_MSG_ID_105_LEN 62
+#define MAVLINK_MSG_ID_105_MIN_LEN 62
+
+#define MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93
+#define MAVLINK_MSG_ID_105_CRC 93
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
+	105, \
+	"HIGHRES_IMU", \
+	15, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
+         { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
+         { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
+         { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
+         { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
+         { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
+	"HIGHRES_IMU", \
+	15, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
+         { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
+         { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
+         { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
+         { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
+         { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a highres_imu message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis (rad / sec)
+ * @param ygyro Angular speed around Y axis (rad / sec)
+ * @param zgyro Angular speed around Z axis (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint16_t(buf, 60, fields_updated);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
+#else
+	mavlink_highres_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+}
+
+/**
+ * @brief Pack a highres_imu message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis (rad / sec)
+ * @param ygyro Angular speed around Y axis (rad / sec)
+ * @param zgyro Angular speed around Z axis (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint16_t(buf, 60, fields_updated);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
+#else
+	mavlink_highres_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+}
+
+/**
+ * @brief Encode a highres_imu struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param highres_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
+{
+	return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
+}
+
+/**
+ * @brief Encode a highres_imu struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param highres_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
+{
+	return mavlink_msg_highres_imu_pack_chan(system_id, component_id, chan, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
+}
+
+/**
+ * @brief Send a highres_imu message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis (rad / sec)
+ * @param ygyro Angular speed around Y axis (rad / sec)
+ * @param zgyro Angular speed around Z axis (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint16_t(buf, 60, fields_updated);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+#else
+	mavlink_highres_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+#endif
+}
+
+/**
+ * @brief Send a highres_imu message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_highres_imu_send_struct(mavlink_channel_t chan, const mavlink_highres_imu_t* highres_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_highres_imu_send(chan, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)highres_imu, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIGHRES_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint16_t(buf, 60, fields_updated);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+#else
+	mavlink_highres_imu_t *packet = (mavlink_highres_imu_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+	packet->abs_pressure = abs_pressure;
+	packet->diff_pressure = diff_pressure;
+	packet->pressure_alt = pressure_alt;
+	packet->temperature = temperature;
+	packet->fields_updated = fields_updated;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIGHRES_IMU UNPACKING
+
+
+/**
+ * @brief Get field time_usec from highres_imu message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from highres_imu message
+ *
+ * @return X acceleration (m/s^2)
+ */
+static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field yacc from highres_imu message
+ *
+ * @return Y acceleration (m/s^2)
+ */
+static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field zacc from highres_imu message
+ *
+ * @return Z acceleration (m/s^2)
+ */
+static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field xgyro from highres_imu message
+ *
+ * @return Angular speed around X axis (rad / sec)
+ */
+static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field ygyro from highres_imu message
+ *
+ * @return Angular speed around Y axis (rad / sec)
+ */
+static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field zgyro from highres_imu message
+ *
+ * @return Angular speed around Z axis (rad / sec)
+ */
+static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field xmag from highres_imu message
+ *
+ * @return X Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field ymag from highres_imu message
+ *
+ * @return Y Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field zmag from highres_imu message
+ *
+ * @return Z Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field abs_pressure from highres_imu message
+ *
+ * @return Absolute pressure in millibar
+ */
+static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field diff_pressure from highres_imu message
+ *
+ * @return Differential pressure in millibar
+ */
+static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  48);
+}
+
+/**
+ * @brief Get field pressure_alt from highres_imu message
+ *
+ * @return Altitude calculated from pressure
+ */
+static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  52);
+}
+
+/**
+ * @brief Get field temperature from highres_imu message
+ *
+ * @return Temperature in degrees celsius
+ */
+static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  56);
+}
+
+/**
+ * @brief Get field fields_updated from highres_imu message
+ *
+ * @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
+ */
+static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  60);
+}
+
+/**
+ * @brief Decode a highres_imu message into a struct
+ *
+ * @param msg The message to decode
+ * @param highres_imu C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
+	highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
+	highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
+	highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
+	highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg);
+	highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg);
+	highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg);
+	highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg);
+	highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg);
+	highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg);
+	highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg);
+	highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
+	highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
+	highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
+	highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIGHRES_IMU_LEN? msg->len : MAVLINK_MSG_ID_HIGHRES_IMU_LEN;
+        memset(highres_imu, 0, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
+	memcpy(highres_imu, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_controls.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_controls.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_controls.h	(revision 209)
@@ -0,0 +1,462 @@
+// MESSAGE HIL_CONTROLS PACKING
+
+#define MAVLINK_MSG_ID_HIL_CONTROLS 91
+
+typedef struct MAVLINK_PACKED __mavlink_hil_controls_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ float roll_ailerons; /*< Control output -1 .. 1*/
+ float pitch_elevator; /*< Control output -1 .. 1*/
+ float yaw_rudder; /*< Control output -1 .. 1*/
+ float throttle; /*< Throttle 0 .. 1*/
+ float aux1; /*< Aux 1, -1 .. 1*/
+ float aux2; /*< Aux 2, -1 .. 1*/
+ float aux3; /*< Aux 3, -1 .. 1*/
+ float aux4; /*< Aux 4, -1 .. 1*/
+ uint8_t mode; /*< System mode (MAV_MODE)*/
+ uint8_t nav_mode; /*< Navigation mode (MAV_NAV_MODE)*/
+} mavlink_hil_controls_t;
+
+#define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42
+#define MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN 42
+#define MAVLINK_MSG_ID_91_LEN 42
+#define MAVLINK_MSG_ID_91_MIN_LEN 42
+
+#define MAVLINK_MSG_ID_HIL_CONTROLS_CRC 63
+#define MAVLINK_MSG_ID_91_CRC 63
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \
+	91, \
+	"HIL_CONTROLS", \
+	11, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \
+         { "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \
+         { "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \
+         { "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \
+         { "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \
+         { "aux1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_controls_t, aux1) }, \
+         { "aux2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_controls_t, aux2) }, \
+         { "aux3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_controls_t, aux3) }, \
+         { "aux4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_controls_t, aux4) }, \
+         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_hil_controls_t, mode) }, \
+         { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \
+	"HIL_CONTROLS", \
+	11, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \
+         { "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \
+         { "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \
+         { "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \
+         { "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \
+         { "aux1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_controls_t, aux1) }, \
+         { "aux2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_controls_t, aux2) }, \
+         { "aux3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_controls_t, aux3) }, \
+         { "aux4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_controls_t, aux4) }, \
+         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_hil_controls_t, mode) }, \
+         { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_controls message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll_ailerons Control output -1 .. 1
+ * @param pitch_elevator Control output -1 .. 1
+ * @param yaw_rudder Control output -1 .. 1
+ * @param throttle Throttle 0 .. 1
+ * @param aux1 Aux 1, -1 .. 1
+ * @param aux2 Aux 2, -1 .. 1
+ * @param aux3 Aux 3, -1 .. 1
+ * @param aux4 Aux 4, -1 .. 1
+ * @param mode System mode (MAV_MODE)
+ * @param nav_mode Navigation mode (MAV_NAV_MODE)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll_ailerons);
+	_mav_put_float(buf, 12, pitch_elevator);
+	_mav_put_float(buf, 16, yaw_rudder);
+	_mav_put_float(buf, 20, throttle);
+	_mav_put_float(buf, 24, aux1);
+	_mav_put_float(buf, 28, aux2);
+	_mav_put_float(buf, 32, aux3);
+	_mav_put_float(buf, 36, aux4);
+	_mav_put_uint8_t(buf, 40, mode);
+	_mav_put_uint8_t(buf, 41, nav_mode);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
+#else
+	mavlink_hil_controls_t packet;
+	packet.time_usec = time_usec;
+	packet.roll_ailerons = roll_ailerons;
+	packet.pitch_elevator = pitch_elevator;
+	packet.yaw_rudder = yaw_rudder;
+	packet.throttle = throttle;
+	packet.aux1 = aux1;
+	packet.aux2 = aux2;
+	packet.aux3 = aux3;
+	packet.aux4 = aux4;
+	packet.mode = mode;
+	packet.nav_mode = nav_mode;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+}
+
+/**
+ * @brief Pack a hil_controls message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll_ailerons Control output -1 .. 1
+ * @param pitch_elevator Control output -1 .. 1
+ * @param yaw_rudder Control output -1 .. 1
+ * @param throttle Throttle 0 .. 1
+ * @param aux1 Aux 1, -1 .. 1
+ * @param aux2 Aux 2, -1 .. 1
+ * @param aux3 Aux 3, -1 .. 1
+ * @param aux4 Aux 4, -1 .. 1
+ * @param mode System mode (MAV_MODE)
+ * @param nav_mode Navigation mode (MAV_NAV_MODE)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,float aux1,float aux2,float aux3,float aux4,uint8_t mode,uint8_t nav_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll_ailerons);
+	_mav_put_float(buf, 12, pitch_elevator);
+	_mav_put_float(buf, 16, yaw_rudder);
+	_mav_put_float(buf, 20, throttle);
+	_mav_put_float(buf, 24, aux1);
+	_mav_put_float(buf, 28, aux2);
+	_mav_put_float(buf, 32, aux3);
+	_mav_put_float(buf, 36, aux4);
+	_mav_put_uint8_t(buf, 40, mode);
+	_mav_put_uint8_t(buf, 41, nav_mode);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
+#else
+	mavlink_hil_controls_t packet;
+	packet.time_usec = time_usec;
+	packet.roll_ailerons = roll_ailerons;
+	packet.pitch_elevator = pitch_elevator;
+	packet.yaw_rudder = yaw_rudder;
+	packet.throttle = throttle;
+	packet.aux1 = aux1;
+	packet.aux2 = aux2;
+	packet.aux3 = aux3;
+	packet.aux4 = aux4;
+	packet.mode = mode;
+	packet.nav_mode = nav_mode;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+}
+
+/**
+ * @brief Encode a hil_controls struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_controls C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls)
+{
+	return mavlink_msg_hil_controls_pack(system_id, component_id, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
+}
+
+/**
+ * @brief Encode a hil_controls struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_controls C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_controls_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls)
+{
+	return mavlink_msg_hil_controls_pack_chan(system_id, component_id, chan, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
+}
+
+/**
+ * @brief Send a hil_controls message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll_ailerons Control output -1 .. 1
+ * @param pitch_elevator Control output -1 .. 1
+ * @param yaw_rudder Control output -1 .. 1
+ * @param throttle Throttle 0 .. 1
+ * @param aux1 Aux 1, -1 .. 1
+ * @param aux2 Aux 2, -1 .. 1
+ * @param aux3 Aux 3, -1 .. 1
+ * @param aux4 Aux 4, -1 .. 1
+ * @param mode System mode (MAV_MODE)
+ * @param nav_mode Navigation mode (MAV_NAV_MODE)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll_ailerons);
+	_mav_put_float(buf, 12, pitch_elevator);
+	_mav_put_float(buf, 16, yaw_rudder);
+	_mav_put_float(buf, 20, throttle);
+	_mav_put_float(buf, 24, aux1);
+	_mav_put_float(buf, 28, aux2);
+	_mav_put_float(buf, 32, aux3);
+	_mav_put_float(buf, 36, aux4);
+	_mav_put_uint8_t(buf, 40, mode);
+	_mav_put_uint8_t(buf, 41, nav_mode);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+#else
+	mavlink_hil_controls_t packet;
+	packet.time_usec = time_usec;
+	packet.roll_ailerons = roll_ailerons;
+	packet.pitch_elevator = pitch_elevator;
+	packet.yaw_rudder = yaw_rudder;
+	packet.throttle = throttle;
+	packet.aux1 = aux1;
+	packet.aux2 = aux2;
+	packet.aux3 = aux3;
+	packet.aux4 = aux4;
+	packet.mode = mode;
+	packet.nav_mode = nav_mode;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_controls message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_controls_send_struct(mavlink_channel_t chan, const mavlink_hil_controls_t* hil_controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_controls_send(chan, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)hil_controls, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_CONTROLS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_controls_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll_ailerons);
+	_mav_put_float(buf, 12, pitch_elevator);
+	_mav_put_float(buf, 16, yaw_rudder);
+	_mav_put_float(buf, 20, throttle);
+	_mav_put_float(buf, 24, aux1);
+	_mav_put_float(buf, 28, aux2);
+	_mav_put_float(buf, 32, aux3);
+	_mav_put_float(buf, 36, aux4);
+	_mav_put_uint8_t(buf, 40, mode);
+	_mav_put_uint8_t(buf, 41, nav_mode);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+#else
+	mavlink_hil_controls_t *packet = (mavlink_hil_controls_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->roll_ailerons = roll_ailerons;
+	packet->pitch_elevator = pitch_elevator;
+	packet->yaw_rudder = yaw_rudder;
+	packet->throttle = throttle;
+	packet->aux1 = aux1;
+	packet->aux2 = aux2;
+	packet->aux3 = aux3;
+	packet->aux4 = aux4;
+	packet->mode = mode;
+	packet->nav_mode = nav_mode;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_CONTROLS UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_controls message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field roll_ailerons from hil_controls message
+ *
+ * @return Control output -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field pitch_elevator from hil_controls message
+ *
+ * @return Control output -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field yaw_rudder from hil_controls message
+ *
+ * @return Control output -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field throttle from hil_controls message
+ *
+ * @return Throttle 0 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field aux1 from hil_controls message
+ *
+ * @return Aux 1, -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field aux2 from hil_controls message
+ *
+ * @return Aux 2, -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field aux3 from hil_controls message
+ *
+ * @return Aux 3, -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field aux4 from hil_controls message
+ *
+ * @return Aux 4, -1 .. 1
+ */
+static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field mode from hil_controls message
+ *
+ * @return System mode (MAV_MODE)
+ */
+static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  40);
+}
+
+/**
+ * @brief Get field nav_mode from hil_controls message
+ *
+ * @return Navigation mode (MAV_NAV_MODE)
+ */
+static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  41);
+}
+
+/**
+ * @brief Decode a hil_controls message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_controls C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_controls_decode(const mavlink_message_t* msg, mavlink_hil_controls_t* hil_controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_controls->time_usec = mavlink_msg_hil_controls_get_time_usec(msg);
+	hil_controls->roll_ailerons = mavlink_msg_hil_controls_get_roll_ailerons(msg);
+	hil_controls->pitch_elevator = mavlink_msg_hil_controls_get_pitch_elevator(msg);
+	hil_controls->yaw_rudder = mavlink_msg_hil_controls_get_yaw_rudder(msg);
+	hil_controls->throttle = mavlink_msg_hil_controls_get_throttle(msg);
+	hil_controls->aux1 = mavlink_msg_hil_controls_get_aux1(msg);
+	hil_controls->aux2 = mavlink_msg_hil_controls_get_aux2(msg);
+	hil_controls->aux3 = mavlink_msg_hil_controls_get_aux3(msg);
+	hil_controls->aux4 = mavlink_msg_hil_controls_get_aux4(msg);
+	hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg);
+	hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_CONTROLS_LEN? msg->len : MAVLINK_MSG_ID_HIL_CONTROLS_LEN;
+        memset(hil_controls, 0, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
+	memcpy(hil_controls, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_gps.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_gps.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_gps.h	(revision 209)
@@ -0,0 +1,512 @@
+// MESSAGE HIL_GPS PACKING
+
+#define MAVLINK_MSG_ID_HIL_GPS 113
+
+typedef struct MAVLINK_PACKED __mavlink_hil_gps_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
+ int32_t alt; /*< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)*/
+ uint16_t eph; /*< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535*/
+ uint16_t epv; /*< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535*/
+ uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: 65535*/
+ int16_t vn; /*< GPS velocity in cm/s in NORTH direction in earth-fixed NED frame*/
+ int16_t ve; /*< GPS velocity in cm/s in EAST direction in earth-fixed NED frame*/
+ int16_t vd; /*< GPS velocity in cm/s in DOWN direction in earth-fixed NED frame*/
+ uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535*/
+ uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/
+ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
+} mavlink_hil_gps_t;
+
+#define MAVLINK_MSG_ID_HIL_GPS_LEN 36
+#define MAVLINK_MSG_ID_HIL_GPS_MIN_LEN 36
+#define MAVLINK_MSG_ID_113_LEN 36
+#define MAVLINK_MSG_ID_113_MIN_LEN 36
+
+#define MAVLINK_MSG_ID_HIL_GPS_CRC 124
+#define MAVLINK_MSG_ID_113_CRC 124
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
+	113, \
+	"HIL_GPS", \
+	13, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
+         { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
+         { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
+         { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
+	"HIL_GPS", \
+	13, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
+         { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
+         { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
+         { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
+         { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
+         { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
+         { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
+         { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
+         { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
+         { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_gps message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
+ * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
+ * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
+ * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_int16_t(buf, 26, vn);
+	_mav_put_int16_t(buf, 28, ve);
+	_mav_put_int16_t(buf, 30, vd);
+	_mav_put_uint16_t(buf, 32, cog);
+	_mav_put_uint8_t(buf, 34, fix_type);
+	_mav_put_uint8_t(buf, 35, satellites_visible);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
+#else
+	mavlink_hil_gps_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+}
+
+/**
+ * @brief Pack a hil_gps message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
+ * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
+ * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
+ * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,int16_t vn,int16_t ve,int16_t vd,uint16_t cog,uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_int16_t(buf, 26, vn);
+	_mav_put_int16_t(buf, 28, ve);
+	_mav_put_int16_t(buf, 30, vd);
+	_mav_put_uint16_t(buf, 32, cog);
+	_mav_put_uint8_t(buf, 34, fix_type);
+	_mav_put_uint8_t(buf, 35, satellites_visible);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
+#else
+	mavlink_hil_gps_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+}
+
+/**
+ * @brief Encode a hil_gps struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_gps C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_gps_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps)
+{
+	return mavlink_msg_hil_gps_pack(system_id, component_id, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
+}
+
+/**
+ * @brief Encode a hil_gps struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_gps C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps)
+{
+	return mavlink_msg_hil_gps_pack_chan(system_id, component_id, chan, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
+}
+
+/**
+ * @brief Send a hil_gps message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ * @param lat Latitude (WGS84), in degrees * 1E7
+ * @param lon Longitude (WGS84), in degrees * 1E7
+ * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
+ * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
+ * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
+ * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
+ * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame
+ * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
+ * @param satellites_visible Number of satellites visible. If unknown, set to 255
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_gps_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_int16_t(buf, 26, vn);
+	_mav_put_int16_t(buf, 28, ve);
+	_mav_put_int16_t(buf, 30, vd);
+	_mav_put_uint16_t(buf, 32, cog);
+	_mav_put_uint8_t(buf, 34, fix_type);
+	_mav_put_uint8_t(buf, 35, satellites_visible);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+#else
+	mavlink_hil_gps_t packet;
+	packet.time_usec = time_usec;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.eph = eph;
+	packet.epv = epv;
+	packet.vel = vel;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+	packet.cog = cog;
+	packet.fix_type = fix_type;
+	packet.satellites_visible = satellites_visible;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_gps message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_gps_send_struct(mavlink_channel_t chan, const mavlink_hil_gps_t* hil_gps)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_gps_send(chan, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)hil_gps, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_GPS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_gps_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_int32_t(buf, 16, alt);
+	_mav_put_uint16_t(buf, 20, eph);
+	_mav_put_uint16_t(buf, 22, epv);
+	_mav_put_uint16_t(buf, 24, vel);
+	_mav_put_int16_t(buf, 26, vn);
+	_mav_put_int16_t(buf, 28, ve);
+	_mav_put_int16_t(buf, 30, vd);
+	_mav_put_uint16_t(buf, 32, cog);
+	_mav_put_uint8_t(buf, 34, fix_type);
+	_mav_put_uint8_t(buf, 35, satellites_visible);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+#else
+	mavlink_hil_gps_t *packet = (mavlink_hil_gps_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->eph = eph;
+	packet->epv = epv;
+	packet->vel = vel;
+	packet->vn = vn;
+	packet->ve = ve;
+	packet->vd = vd;
+	packet->cog = cog;
+	packet->fix_type = fix_type;
+	packet->satellites_visible = satellites_visible;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_GPS UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_gps message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field fix_type from hil_gps message
+ *
+ * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
+ */
+static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field lat from hil_gps message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field lon from hil_gps message
+ *
+ * @return Longitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field alt from hil_gps message
+ *
+ * @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field eph from hil_gps message
+ *
+ * @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
+ */
+static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Get field epv from hil_gps message
+ *
+ * @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
+ */
+static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field vel from hil_gps message
+ *
+ * @return GPS ground speed (m/s * 100). If unknown, set to: 65535
+ */
+static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field vn from hil_gps message
+ *
+ * @return GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
+ */
+static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  26);
+}
+
+/**
+ * @brief Get field ve from hil_gps message
+ *
+ * @return GPS velocity in cm/s in EAST direction in earth-fixed NED frame
+ */
+static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  28);
+}
+
+/**
+ * @brief Get field vd from hil_gps message
+ *
+ * @return GPS velocity in cm/s in DOWN direction in earth-fixed NED frame
+ */
+static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  30);
+}
+
+/**
+ * @brief Get field cog from hil_gps message
+ *
+ * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
+ */
+static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  32);
+}
+
+/**
+ * @brief Get field satellites_visible from hil_gps message
+ *
+ * @return Number of satellites visible. If unknown, set to 255
+ */
+static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  35);
+}
+
+/**
+ * @brief Decode a hil_gps message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_gps C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_gps_decode(const mavlink_message_t* msg, mavlink_hil_gps_t* hil_gps)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_gps->time_usec = mavlink_msg_hil_gps_get_time_usec(msg);
+	hil_gps->lat = mavlink_msg_hil_gps_get_lat(msg);
+	hil_gps->lon = mavlink_msg_hil_gps_get_lon(msg);
+	hil_gps->alt = mavlink_msg_hil_gps_get_alt(msg);
+	hil_gps->eph = mavlink_msg_hil_gps_get_eph(msg);
+	hil_gps->epv = mavlink_msg_hil_gps_get_epv(msg);
+	hil_gps->vel = mavlink_msg_hil_gps_get_vel(msg);
+	hil_gps->vn = mavlink_msg_hil_gps_get_vn(msg);
+	hil_gps->ve = mavlink_msg_hil_gps_get_ve(msg);
+	hil_gps->vd = mavlink_msg_hil_gps_get_vd(msg);
+	hil_gps->cog = mavlink_msg_hil_gps_get_cog(msg);
+	hil_gps->fix_type = mavlink_msg_hil_gps_get_fix_type(msg);
+	hil_gps->satellites_visible = mavlink_msg_hil_gps_get_satellites_visible(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_GPS_LEN? msg->len : MAVLINK_MSG_ID_HIL_GPS_LEN;
+        memset(hil_gps, 0, MAVLINK_MSG_ID_HIL_GPS_LEN);
+	memcpy(hil_gps, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_optical_flow.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_optical_flow.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_optical_flow.h	(revision 209)
@@ -0,0 +1,487 @@
+// MESSAGE HIL_OPTICAL_FLOW PACKING
+
+#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114
+
+typedef struct MAVLINK_PACKED __mavlink_hil_optical_flow_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/
+ float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/
+ float integrated_y; /*< Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/
+ float integrated_xgyro; /*< RH rotation around X axis (rad)*/
+ float integrated_ygyro; /*< RH rotation around Y axis (rad)*/
+ float integrated_zgyro; /*< RH rotation around Z axis (rad)*/
+ uint32_t time_delta_distance_us; /*< Time in microseconds since the distance was sampled.*/
+ float distance; /*< Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.*/
+ int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/
+ uint8_t sensor_id; /*< Sensor ID*/
+ uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/
+} mavlink_hil_optical_flow_t;
+
+#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 44
+#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN 44
+#define MAVLINK_MSG_ID_114_LEN 44
+#define MAVLINK_MSG_ID_114_MIN_LEN 44
+
+#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC 237
+#define MAVLINK_MSG_ID_114_CRC 237
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
+	114, \
+	"HIL_OPTICAL_FLOW", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
+         { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
+         { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
+         { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
+         { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
+         { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
+         { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
+         { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
+	"HIL_OPTICAL_FLOW", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
+         { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
+         { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
+         { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
+         { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
+         { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
+         { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
+         { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_optical_flow message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
+#else
+	mavlink_hil_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+}
+
+/**
+ * @brief Pack a hil_optical_flow message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
+#else
+	mavlink_hil_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+}
+
+/**
+ * @brief Encode a hil_optical_flow struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_optical_flow C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
+{
+	return mavlink_msg_hil_optical_flow_pack(system_id, component_id, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
+}
+
+/**
+ * @brief Encode a hil_optical_flow struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_optical_flow C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
+{
+	return mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, chan, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
+}
+
+/**
+ * @brief Send a hil_optical_flow message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+#else
+	mavlink_hil_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_optical_flow message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_hil_optical_flow_t* hil_optical_flow)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_optical_flow_send(chan, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)hil_optical_flow, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+#else
+	mavlink_hil_optical_flow_t *packet = (mavlink_hil_optical_flow_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->integration_time_us = integration_time_us;
+	packet->integrated_x = integrated_x;
+	packet->integrated_y = integrated_y;
+	packet->integrated_xgyro = integrated_xgyro;
+	packet->integrated_ygyro = integrated_ygyro;
+	packet->integrated_zgyro = integrated_zgyro;
+	packet->time_delta_distance_us = time_delta_distance_us;
+	packet->distance = distance;
+	packet->temperature = temperature;
+	packet->sensor_id = sensor_id;
+	packet->quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_OPTICAL_FLOW UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_optical_flow message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field sensor_id from hil_optical_flow message
+ *
+ * @return Sensor ID
+ */
+static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  42);
+}
+
+/**
+ * @brief Get field integration_time_us from hil_optical_flow message
+ *
+ * @return Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ */
+static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field integrated_x from hil_optical_flow message
+ *
+ * @return Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ */
+static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field integrated_y from hil_optical_flow message
+ *
+ * @return Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ */
+static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field integrated_xgyro from hil_optical_flow message
+ *
+ * @return RH rotation around X axis (rad)
+ */
+static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field integrated_ygyro from hil_optical_flow message
+ *
+ * @return RH rotation around Y axis (rad)
+ */
+static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field integrated_zgyro from hil_optical_flow message
+ *
+ * @return RH rotation around Z axis (rad)
+ */
+static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field temperature from hil_optical_flow message
+ *
+ * @return Temperature * 100 in centi-degrees Celsius
+ */
+static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  40);
+}
+
+/**
+ * @brief Get field quality from hil_optical_flow message
+ *
+ * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ */
+static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  43);
+}
+
+/**
+ * @brief Get field time_delta_distance_us from hil_optical_flow message
+ *
+ * @return Time in microseconds since the distance was sampled.
+ */
+static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  32);
+}
+
+/**
+ * @brief Get field distance from hil_optical_flow message
+ *
+ * @return Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ */
+static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Decode a hil_optical_flow message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_optical_flow C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_optical_flow_decode(const mavlink_message_t* msg, mavlink_hil_optical_flow_t* hil_optical_flow)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_optical_flow->time_usec = mavlink_msg_hil_optical_flow_get_time_usec(msg);
+	hil_optical_flow->integration_time_us = mavlink_msg_hil_optical_flow_get_integration_time_us(msg);
+	hil_optical_flow->integrated_x = mavlink_msg_hil_optical_flow_get_integrated_x(msg);
+	hil_optical_flow->integrated_y = mavlink_msg_hil_optical_flow_get_integrated_y(msg);
+	hil_optical_flow->integrated_xgyro = mavlink_msg_hil_optical_flow_get_integrated_xgyro(msg);
+	hil_optical_flow->integrated_ygyro = mavlink_msg_hil_optical_flow_get_integrated_ygyro(msg);
+	hil_optical_flow->integrated_zgyro = mavlink_msg_hil_optical_flow_get_integrated_zgyro(msg);
+	hil_optical_flow->time_delta_distance_us = mavlink_msg_hil_optical_flow_get_time_delta_distance_us(msg);
+	hil_optical_flow->distance = mavlink_msg_hil_optical_flow_get_distance(msg);
+	hil_optical_flow->temperature = mavlink_msg_hil_optical_flow_get_temperature(msg);
+	hil_optical_flow->sensor_id = mavlink_msg_hil_optical_flow_get_sensor_id(msg);
+	hil_optical_flow->quality = mavlink_msg_hil_optical_flow_get_quality(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN;
+        memset(hil_optical_flow, 0, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
+	memcpy(hil_optical_flow, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_rc_inputs_raw.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_rc_inputs_raw.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_rc_inputs_raw.h	(revision 209)
@@ -0,0 +1,537 @@
+// MESSAGE HIL_RC_INPUTS_RAW PACKING
+
+#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92
+
+typedef struct MAVLINK_PACKED __mavlink_hil_rc_inputs_raw_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds*/
+ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds*/
+ uint16_t chan3_raw; /*< RC channel 3 value, in microseconds*/
+ uint16_t chan4_raw; /*< RC channel 4 value, in microseconds*/
+ uint16_t chan5_raw; /*< RC channel 5 value, in microseconds*/
+ uint16_t chan6_raw; /*< RC channel 6 value, in microseconds*/
+ uint16_t chan7_raw; /*< RC channel 7 value, in microseconds*/
+ uint16_t chan8_raw; /*< RC channel 8 value, in microseconds*/
+ uint16_t chan9_raw; /*< RC channel 9 value, in microseconds*/
+ uint16_t chan10_raw; /*< RC channel 10 value, in microseconds*/
+ uint16_t chan11_raw; /*< RC channel 11 value, in microseconds*/
+ uint16_t chan12_raw; /*< RC channel 12 value, in microseconds*/
+ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 255: 100%*/
+} mavlink_hil_rc_inputs_raw_t;
+
+#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33
+#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33
+#define MAVLINK_MSG_ID_92_LEN 33
+#define MAVLINK_MSG_ID_92_MIN_LEN 33
+
+#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54
+#define MAVLINK_MSG_ID_92_CRC 54
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
+	92, \
+	"HIL_RC_INPUTS_RAW", \
+	14, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
+         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
+         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
+         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
+         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
+	"HIL_RC_INPUTS_RAW", \
+	14, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
+         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
+         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
+         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
+         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_rc_inputs_raw message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param chan1_raw RC channel 1 value, in microseconds
+ * @param chan2_raw RC channel 2 value, in microseconds
+ * @param chan3_raw RC channel 3 value, in microseconds
+ * @param chan4_raw RC channel 4 value, in microseconds
+ * @param chan5_raw RC channel 5 value, in microseconds
+ * @param chan6_raw RC channel 6 value, in microseconds
+ * @param chan7_raw RC channel 7 value, in microseconds
+ * @param chan8_raw RC channel 8 value, in microseconds
+ * @param chan9_raw RC channel 9 value, in microseconds
+ * @param chan10_raw RC channel 10 value, in microseconds
+ * @param chan11_raw RC channel 11 value, in microseconds
+ * @param chan12_raw RC channel 12 value, in microseconds
+ * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 8, chan1_raw);
+	_mav_put_uint16_t(buf, 10, chan2_raw);
+	_mav_put_uint16_t(buf, 12, chan3_raw);
+	_mav_put_uint16_t(buf, 14, chan4_raw);
+	_mav_put_uint16_t(buf, 16, chan5_raw);
+	_mav_put_uint16_t(buf, 18, chan6_raw);
+	_mav_put_uint16_t(buf, 20, chan7_raw);
+	_mav_put_uint16_t(buf, 22, chan8_raw);
+	_mav_put_uint16_t(buf, 24, chan9_raw);
+	_mav_put_uint16_t(buf, 26, chan10_raw);
+	_mav_put_uint16_t(buf, 28, chan11_raw);
+	_mav_put_uint16_t(buf, 30, chan12_raw);
+	_mav_put_uint8_t(buf, 32, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
+#else
+	mavlink_hil_rc_inputs_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+}
+
+/**
+ * @brief Pack a hil_rc_inputs_raw message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param chan1_raw RC channel 1 value, in microseconds
+ * @param chan2_raw RC channel 2 value, in microseconds
+ * @param chan3_raw RC channel 3 value, in microseconds
+ * @param chan4_raw RC channel 4 value, in microseconds
+ * @param chan5_raw RC channel 5 value, in microseconds
+ * @param chan6_raw RC channel 6 value, in microseconds
+ * @param chan7_raw RC channel 7 value, in microseconds
+ * @param chan8_raw RC channel 8 value, in microseconds
+ * @param chan9_raw RC channel 9 value, in microseconds
+ * @param chan10_raw RC channel 10 value, in microseconds
+ * @param chan11_raw RC channel 11 value, in microseconds
+ * @param chan12_raw RC channel 12 value, in microseconds
+ * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 8, chan1_raw);
+	_mav_put_uint16_t(buf, 10, chan2_raw);
+	_mav_put_uint16_t(buf, 12, chan3_raw);
+	_mav_put_uint16_t(buf, 14, chan4_raw);
+	_mav_put_uint16_t(buf, 16, chan5_raw);
+	_mav_put_uint16_t(buf, 18, chan6_raw);
+	_mav_put_uint16_t(buf, 20, chan7_raw);
+	_mav_put_uint16_t(buf, 22, chan8_raw);
+	_mav_put_uint16_t(buf, 24, chan9_raw);
+	_mav_put_uint16_t(buf, 26, chan10_raw);
+	_mav_put_uint16_t(buf, 28, chan11_raw);
+	_mav_put_uint16_t(buf, 30, chan12_raw);
+	_mav_put_uint8_t(buf, 32, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
+#else
+	mavlink_hil_rc_inputs_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+}
+
+/**
+ * @brief Encode a hil_rc_inputs_raw struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_rc_inputs_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
+{
+	return mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
+}
+
+/**
+ * @brief Encode a hil_rc_inputs_raw struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_rc_inputs_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
+{
+	return mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, chan, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
+}
+
+/**
+ * @brief Send a hil_rc_inputs_raw message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param chan1_raw RC channel 1 value, in microseconds
+ * @param chan2_raw RC channel 2 value, in microseconds
+ * @param chan3_raw RC channel 3 value, in microseconds
+ * @param chan4_raw RC channel 4 value, in microseconds
+ * @param chan5_raw RC channel 5 value, in microseconds
+ * @param chan6_raw RC channel 6 value, in microseconds
+ * @param chan7_raw RC channel 7 value, in microseconds
+ * @param chan8_raw RC channel 8 value, in microseconds
+ * @param chan9_raw RC channel 9 value, in microseconds
+ * @param chan10_raw RC channel 10 value, in microseconds
+ * @param chan11_raw RC channel 11 value, in microseconds
+ * @param chan12_raw RC channel 12 value, in microseconds
+ * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 8, chan1_raw);
+	_mav_put_uint16_t(buf, 10, chan2_raw);
+	_mav_put_uint16_t(buf, 12, chan3_raw);
+	_mav_put_uint16_t(buf, 14, chan4_raw);
+	_mav_put_uint16_t(buf, 16, chan5_raw);
+	_mav_put_uint16_t(buf, 18, chan6_raw);
+	_mav_put_uint16_t(buf, 20, chan7_raw);
+	_mav_put_uint16_t(buf, 22, chan8_raw);
+	_mav_put_uint16_t(buf, 24, chan9_raw);
+	_mav_put_uint16_t(buf, 26, chan10_raw);
+	_mav_put_uint16_t(buf, 28, chan11_raw);
+	_mav_put_uint16_t(buf, 30, chan12_raw);
+	_mav_put_uint8_t(buf, 32, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+#else
+	mavlink_hil_rc_inputs_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_rc_inputs_raw message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_rc_inputs_raw_send_struct(mavlink_channel_t chan, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_rc_inputs_raw_send(chan, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)hil_rc_inputs_raw, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 8, chan1_raw);
+	_mav_put_uint16_t(buf, 10, chan2_raw);
+	_mav_put_uint16_t(buf, 12, chan3_raw);
+	_mav_put_uint16_t(buf, 14, chan4_raw);
+	_mav_put_uint16_t(buf, 16, chan5_raw);
+	_mav_put_uint16_t(buf, 18, chan6_raw);
+	_mav_put_uint16_t(buf, 20, chan7_raw);
+	_mav_put_uint16_t(buf, 22, chan8_raw);
+	_mav_put_uint16_t(buf, 24, chan9_raw);
+	_mav_put_uint16_t(buf, 26, chan10_raw);
+	_mav_put_uint16_t(buf, 28, chan11_raw);
+	_mav_put_uint16_t(buf, 30, chan12_raw);
+	_mav_put_uint8_t(buf, 32, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+#else
+	mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->chan1_raw = chan1_raw;
+	packet->chan2_raw = chan2_raw;
+	packet->chan3_raw = chan3_raw;
+	packet->chan4_raw = chan4_raw;
+	packet->chan5_raw = chan5_raw;
+	packet->chan6_raw = chan6_raw;
+	packet->chan7_raw = chan7_raw;
+	packet->chan8_raw = chan8_raw;
+	packet->chan9_raw = chan9_raw;
+	packet->chan10_raw = chan10_raw;
+	packet->chan11_raw = chan11_raw;
+	packet->chan12_raw = chan12_raw;
+	packet->rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_RC_INPUTS_RAW UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_rc_inputs_raw message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field chan1_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 1 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field chan2_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 2 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field chan3_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 3 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field chan4_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 4 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Get field chan5_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 5 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field chan6_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 6 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field chan7_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 7 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Get field chan8_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 8 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field chan9_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 9 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field chan10_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 10 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Get field chan11_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 11 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field chan12_raw from hil_rc_inputs_raw message
+ *
+ * @return RC channel 12 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  30);
+}
+
+/**
+ * @brief Get field rssi from hil_rc_inputs_raw message
+ *
+ * @return Receive signal strength indicator, 0: 0%, 255: 100%
+ */
+static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Decode a hil_rc_inputs_raw message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_rc_inputs_raw C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* msg, mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg);
+	hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg);
+	hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg);
+	hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg);
+	hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg);
+	hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg);
+	hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg);
+	hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg);
+	hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg);
+	hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg);
+	hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg);
+	hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg);
+	hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg);
+	hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN? msg->len : MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN;
+        memset(hil_rc_inputs_raw, 0, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
+	memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_sensor.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_sensor.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_sensor.h	(revision 209)
@@ -0,0 +1,562 @@
+// MESSAGE HIL_SENSOR PACKING
+
+#define MAVLINK_MSG_ID_HIL_SENSOR 107
+
+typedef struct MAVLINK_PACKED __mavlink_hil_sensor_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float xacc; /*< X acceleration (m/s^2)*/
+ float yacc; /*< Y acceleration (m/s^2)*/
+ float zacc; /*< Z acceleration (m/s^2)*/
+ float xgyro; /*< Angular speed around X axis in body frame (rad / sec)*/
+ float ygyro; /*< Angular speed around Y axis in body frame (rad / sec)*/
+ float zgyro; /*< Angular speed around Z axis in body frame (rad / sec)*/
+ float xmag; /*< X Magnetic field (Gauss)*/
+ float ymag; /*< Y Magnetic field (Gauss)*/
+ float zmag; /*< Z Magnetic field (Gauss)*/
+ float abs_pressure; /*< Absolute pressure in millibar*/
+ float diff_pressure; /*< Differential pressure (airspeed) in millibar*/
+ float pressure_alt; /*< Altitude calculated from pressure*/
+ float temperature; /*< Temperature in degrees celsius*/
+ uint32_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.*/
+} mavlink_hil_sensor_t;
+
+#define MAVLINK_MSG_ID_HIL_SENSOR_LEN 64
+#define MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN 64
+#define MAVLINK_MSG_ID_107_LEN 64
+#define MAVLINK_MSG_ID_107_MIN_LEN 64
+
+#define MAVLINK_MSG_ID_HIL_SENSOR_CRC 108
+#define MAVLINK_MSG_ID_107_CRC 108
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \
+	107, \
+	"HIL_SENSOR", \
+	15, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_sensor_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_sensor_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_sensor_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_sensor_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_sensor_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_hil_sensor_t, zmag) }, \
+         { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_hil_sensor_t, abs_pressure) }, \
+         { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_hil_sensor_t, diff_pressure) }, \
+         { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_hil_sensor_t, pressure_alt) }, \
+         { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_hil_sensor_t, temperature) }, \
+         { "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \
+	"HIL_SENSOR", \
+	15, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_sensor_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_sensor_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_sensor_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_sensor_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_sensor_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_hil_sensor_t, zmag) }, \
+         { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_hil_sensor_t, abs_pressure) }, \
+         { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_hil_sensor_t, diff_pressure) }, \
+         { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_hil_sensor_t, pressure_alt) }, \
+         { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_hil_sensor_t, temperature) }, \
+         { "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_sensor message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis in body frame (rad / sec)
+ * @param ygyro Angular speed around Y axis in body frame (rad / sec)
+ * @param zgyro Angular speed around Z axis in body frame (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure (airspeed) in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint32_t(buf, 60, fields_updated);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
+#else
+	mavlink_hil_sensor_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+}
+
+/**
+ * @brief Pack a hil_sensor message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis in body frame (rad / sec)
+ * @param ygyro Angular speed around Y axis in body frame (rad / sec)
+ * @param zgyro Angular speed around Z axis in body frame (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure (airspeed) in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint32_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint32_t(buf, 60, fields_updated);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
+#else
+	mavlink_hil_sensor_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+}
+
+/**
+ * @brief Encode a hil_sensor struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_sensor C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor)
+{
+	return mavlink_msg_hil_sensor_pack(system_id, component_id, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
+}
+
+/**
+ * @brief Encode a hil_sensor struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_sensor C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor)
+{
+	return mavlink_msg_hil_sensor_pack_chan(system_id, component_id, chan, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
+}
+
+/**
+ * @brief Send a hil_sensor message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param xacc X acceleration (m/s^2)
+ * @param yacc Y acceleration (m/s^2)
+ * @param zacc Z acceleration (m/s^2)
+ * @param xgyro Angular speed around X axis in body frame (rad / sec)
+ * @param ygyro Angular speed around Y axis in body frame (rad / sec)
+ * @param zgyro Angular speed around Z axis in body frame (rad / sec)
+ * @param xmag X Magnetic field (Gauss)
+ * @param ymag Y Magnetic field (Gauss)
+ * @param zmag Z Magnetic field (Gauss)
+ * @param abs_pressure Absolute pressure in millibar
+ * @param diff_pressure Differential pressure (airspeed) in millibar
+ * @param pressure_alt Altitude calculated from pressure
+ * @param temperature Temperature in degrees celsius
+ * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_sensor_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint32_t(buf, 60, fields_updated);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+#else
+	mavlink_hil_sensor_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+	packet.abs_pressure = abs_pressure;
+	packet.diff_pressure = diff_pressure;
+	packet.pressure_alt = pressure_alt;
+	packet.temperature = temperature;
+	packet.fields_updated = fields_updated;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_sensor message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_sensor_send_struct(mavlink_channel_t chan, const mavlink_hil_sensor_t* hil_sensor)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_sensor_send(chan, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)hil_sensor, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, xacc);
+	_mav_put_float(buf, 12, yacc);
+	_mav_put_float(buf, 16, zacc);
+	_mav_put_float(buf, 20, xgyro);
+	_mav_put_float(buf, 24, ygyro);
+	_mav_put_float(buf, 28, zgyro);
+	_mav_put_float(buf, 32, xmag);
+	_mav_put_float(buf, 36, ymag);
+	_mav_put_float(buf, 40, zmag);
+	_mav_put_float(buf, 44, abs_pressure);
+	_mav_put_float(buf, 48, diff_pressure);
+	_mav_put_float(buf, 52, pressure_alt);
+	_mav_put_float(buf, 56, temperature);
+	_mav_put_uint32_t(buf, 60, fields_updated);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+#else
+	mavlink_hil_sensor_t *packet = (mavlink_hil_sensor_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+	packet->abs_pressure = abs_pressure;
+	packet->diff_pressure = diff_pressure;
+	packet->pressure_alt = pressure_alt;
+	packet->temperature = temperature;
+	packet->fields_updated = fields_updated;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_SENSOR UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_sensor message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from hil_sensor message
+ *
+ * @return X acceleration (m/s^2)
+ */
+static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field yacc from hil_sensor message
+ *
+ * @return Y acceleration (m/s^2)
+ */
+static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field zacc from hil_sensor message
+ *
+ * @return Z acceleration (m/s^2)
+ */
+static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field xgyro from hil_sensor message
+ *
+ * @return Angular speed around X axis in body frame (rad / sec)
+ */
+static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field ygyro from hil_sensor message
+ *
+ * @return Angular speed around Y axis in body frame (rad / sec)
+ */
+static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field zgyro from hil_sensor message
+ *
+ * @return Angular speed around Z axis in body frame (rad / sec)
+ */
+static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field xmag from hil_sensor message
+ *
+ * @return X Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field ymag from hil_sensor message
+ *
+ * @return Y Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field zmag from hil_sensor message
+ *
+ * @return Z Magnetic field (Gauss)
+ */
+static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field abs_pressure from hil_sensor message
+ *
+ * @return Absolute pressure in millibar
+ */
+static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field diff_pressure from hil_sensor message
+ *
+ * @return Differential pressure (airspeed) in millibar
+ */
+static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  48);
+}
+
+/**
+ * @brief Get field pressure_alt from hil_sensor message
+ *
+ * @return Altitude calculated from pressure
+ */
+static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  52);
+}
+
+/**
+ * @brief Get field temperature from hil_sensor message
+ *
+ * @return Temperature in degrees celsius
+ */
+static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  56);
+}
+
+/**
+ * @brief Get field fields_updated from hil_sensor message
+ *
+ * @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
+ */
+static inline uint32_t mavlink_msg_hil_sensor_get_fields_updated(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  60);
+}
+
+/**
+ * @brief Decode a hil_sensor message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_sensor C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_sensor_decode(const mavlink_message_t* msg, mavlink_hil_sensor_t* hil_sensor)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_sensor->time_usec = mavlink_msg_hil_sensor_get_time_usec(msg);
+	hil_sensor->xacc = mavlink_msg_hil_sensor_get_xacc(msg);
+	hil_sensor->yacc = mavlink_msg_hil_sensor_get_yacc(msg);
+	hil_sensor->zacc = mavlink_msg_hil_sensor_get_zacc(msg);
+	hil_sensor->xgyro = mavlink_msg_hil_sensor_get_xgyro(msg);
+	hil_sensor->ygyro = mavlink_msg_hil_sensor_get_ygyro(msg);
+	hil_sensor->zgyro = mavlink_msg_hil_sensor_get_zgyro(msg);
+	hil_sensor->xmag = mavlink_msg_hil_sensor_get_xmag(msg);
+	hil_sensor->ymag = mavlink_msg_hil_sensor_get_ymag(msg);
+	hil_sensor->zmag = mavlink_msg_hil_sensor_get_zmag(msg);
+	hil_sensor->abs_pressure = mavlink_msg_hil_sensor_get_abs_pressure(msg);
+	hil_sensor->diff_pressure = mavlink_msg_hil_sensor_get_diff_pressure(msg);
+	hil_sensor->pressure_alt = mavlink_msg_hil_sensor_get_pressure_alt(msg);
+	hil_sensor->temperature = mavlink_msg_hil_sensor_get_temperature(msg);
+	hil_sensor->fields_updated = mavlink_msg_hil_sensor_get_fields_updated(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_HIL_SENSOR_LEN;
+        memset(hil_sensor, 0, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
+	memcpy(hil_sensor, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state.h	(revision 209)
@@ -0,0 +1,587 @@
+// MESSAGE HIL_STATE PACKING
+
+#define MAVLINK_MSG_ID_HIL_STATE 90
+
+typedef struct MAVLINK_PACKED __mavlink_hil_state_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ float roll; /*< Roll angle (rad)*/
+ float pitch; /*< Pitch angle (rad)*/
+ float yaw; /*< Yaw angle (rad)*/
+ float rollspeed; /*< Body frame roll / phi angular speed (rad/s)*/
+ float pitchspeed; /*< Body frame pitch / theta angular speed (rad/s)*/
+ float yawspeed; /*< Body frame yaw / psi angular speed (rad/s)*/
+ int32_t lat; /*< Latitude, expressed as * 1E7*/
+ int32_t lon; /*< Longitude, expressed as * 1E7*/
+ int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters)*/
+ int16_t vx; /*< Ground X Speed (Latitude), expressed as m/s * 100*/
+ int16_t vy; /*< Ground Y Speed (Longitude), expressed as m/s * 100*/
+ int16_t vz; /*< Ground Z Speed (Altitude), expressed as m/s * 100*/
+ int16_t xacc; /*< X acceleration (mg)*/
+ int16_t yacc; /*< Y acceleration (mg)*/
+ int16_t zacc; /*< Z acceleration (mg)*/
+} mavlink_hil_state_t;
+
+#define MAVLINK_MSG_ID_HIL_STATE_LEN 56
+#define MAVLINK_MSG_ID_HIL_STATE_MIN_LEN 56
+#define MAVLINK_MSG_ID_90_LEN 56
+#define MAVLINK_MSG_ID_90_MIN_LEN 56
+
+#define MAVLINK_MSG_ID_HIL_STATE_CRC 183
+#define MAVLINK_MSG_ID_90_CRC 183
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_STATE { \
+	90, \
+	"HIL_STATE", \
+	16, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_STATE { \
+	"HIL_STATE", \
+	16, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_state message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll Roll angle (rad)
+ * @param pitch Pitch angle (rad)
+ * @param yaw Yaw angle (rad)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll);
+	_mav_put_float(buf, 12, pitch);
+	_mav_put_float(buf, 16, yaw);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_int32_t(buf, 32, lat);
+	_mav_put_int32_t(buf, 36, lon);
+	_mav_put_int32_t(buf, 40, alt);
+	_mav_put_int16_t(buf, 44, vx);
+	_mav_put_int16_t(buf, 46, vy);
+	_mav_put_int16_t(buf, 48, vz);
+	_mav_put_int16_t(buf, 50, xacc);
+	_mav_put_int16_t(buf, 52, yacc);
+	_mav_put_int16_t(buf, 54, zacc);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
+#else
+	mavlink_hil_state_t packet;
+	packet.time_usec = time_usec;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+}
+
+/**
+ * @brief Pack a hil_state message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll Roll angle (rad)
+ * @param pitch Pitch angle (rad)
+ * @param yaw Yaw angle (rad)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll);
+	_mav_put_float(buf, 12, pitch);
+	_mav_put_float(buf, 16, yaw);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_int32_t(buf, 32, lat);
+	_mav_put_int32_t(buf, 36, lon);
+	_mav_put_int32_t(buf, 40, alt);
+	_mav_put_int16_t(buf, 44, vx);
+	_mav_put_int16_t(buf, 46, vy);
+	_mav_put_int16_t(buf, 48, vz);
+	_mav_put_int16_t(buf, 50, xacc);
+	_mav_put_int16_t(buf, 52, yacc);
+	_mav_put_int16_t(buf, 54, zacc);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
+#else
+	mavlink_hil_state_t packet;
+	packet.time_usec = time_usec;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+}
+
+/**
+ * @brief Encode a hil_state struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
+{
+	return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
+}
+
+/**
+ * @brief Encode a hil_state struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
+{
+	return mavlink_msg_hil_state_pack_chan(system_id, component_id, chan, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
+}
+
+/**
+ * @brief Send a hil_state message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param roll Roll angle (rad)
+ * @param pitch Pitch angle (rad)
+ * @param yaw Yaw angle (rad)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll);
+	_mav_put_float(buf, 12, pitch);
+	_mav_put_float(buf, 16, yaw);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_int32_t(buf, 32, lat);
+	_mav_put_int32_t(buf, 36, lon);
+	_mav_put_int32_t(buf, 40, alt);
+	_mav_put_int16_t(buf, 44, vx);
+	_mav_put_int16_t(buf, 46, vy);
+	_mav_put_int16_t(buf, 48, vz);
+	_mav_put_int16_t(buf, 50, xacc);
+	_mav_put_int16_t(buf, 52, yacc);
+	_mav_put_int16_t(buf, 54, zacc);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+#else
+	mavlink_hil_state_t packet;
+	packet.time_usec = time_usec;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_state message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_state_send_struct(mavlink_channel_t chan, const mavlink_hil_state_t* hil_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_state_send(chan, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)hil_state, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, roll);
+	_mav_put_float(buf, 12, pitch);
+	_mav_put_float(buf, 16, yaw);
+	_mav_put_float(buf, 20, rollspeed);
+	_mav_put_float(buf, 24, pitchspeed);
+	_mav_put_float(buf, 28, yawspeed);
+	_mav_put_int32_t(buf, 32, lat);
+	_mav_put_int32_t(buf, 36, lon);
+	_mav_put_int32_t(buf, 40, alt);
+	_mav_put_int16_t(buf, 44, vx);
+	_mav_put_int16_t(buf, 46, vy);
+	_mav_put_int16_t(buf, 48, vz);
+	_mav_put_int16_t(buf, 50, xacc);
+	_mav_put_int16_t(buf, 52, yacc);
+	_mav_put_int16_t(buf, 54, zacc);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+#else
+	mavlink_hil_state_t *packet = (mavlink_hil_state_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+	packet->rollspeed = rollspeed;
+	packet->pitchspeed = pitchspeed;
+	packet->yawspeed = yawspeed;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_STATE UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_state message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field roll from hil_state message
+ *
+ * @return Roll angle (rad)
+ */
+static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field pitch from hil_state message
+ *
+ * @return Pitch angle (rad)
+ */
+static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field yaw from hil_state message
+ *
+ * @return Yaw angle (rad)
+ */
+static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field rollspeed from hil_state message
+ *
+ * @return Body frame roll / phi angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitchspeed from hil_state message
+ *
+ * @return Body frame pitch / theta angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yawspeed from hil_state message
+ *
+ * @return Body frame yaw / psi angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field lat from hil_state message
+ *
+ * @return Latitude, expressed as * 1E7
+ */
+static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  32);
+}
+
+/**
+ * @brief Get field lon from hil_state message
+ *
+ * @return Longitude, expressed as * 1E7
+ */
+static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  36);
+}
+
+/**
+ * @brief Get field alt from hil_state message
+ *
+ * @return Altitude in meters, expressed as * 1000 (millimeters)
+ */
+static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  40);
+}
+
+/**
+ * @brief Get field vx from hil_state message
+ *
+ * @return Ground X Speed (Latitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  44);
+}
+
+/**
+ * @brief Get field vy from hil_state message
+ *
+ * @return Ground Y Speed (Longitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  46);
+}
+
+/**
+ * @brief Get field vz from hil_state message
+ *
+ * @return Ground Z Speed (Altitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  48);
+}
+
+/**
+ * @brief Get field xacc from hil_state message
+ *
+ * @return X acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  50);
+}
+
+/**
+ * @brief Get field yacc from hil_state message
+ *
+ * @return Y acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  52);
+}
+
+/**
+ * @brief Get field zacc from hil_state message
+ *
+ * @return Z acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  54);
+}
+
+/**
+ * @brief Decode a hil_state message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_state C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, mavlink_hil_state_t* hil_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_state->time_usec = mavlink_msg_hil_state_get_time_usec(msg);
+	hil_state->roll = mavlink_msg_hil_state_get_roll(msg);
+	hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg);
+	hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg);
+	hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg);
+	hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg);
+	hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg);
+	hil_state->lat = mavlink_msg_hil_state_get_lat(msg);
+	hil_state->lon = mavlink_msg_hil_state_get_lon(msg);
+	hil_state->alt = mavlink_msg_hil_state_get_alt(msg);
+	hil_state->vx = mavlink_msg_hil_state_get_vx(msg);
+	hil_state->vy = mavlink_msg_hil_state_get_vy(msg);
+	hil_state->vz = mavlink_msg_hil_state_get_vz(msg);
+	hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg);
+	hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg);
+	hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_LEN;
+        memset(hil_state, 0, MAVLINK_MSG_ID_HIL_STATE_LEN);
+	memcpy(hil_state, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state_quaternion.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state_quaternion.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_state_quaternion.h	(revision 209)
@@ -0,0 +1,579 @@
+// MESSAGE HIL_STATE_QUATERNION PACKING
+
+#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION 115
+
+typedef struct MAVLINK_PACKED __mavlink_hil_state_quaternion_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ float attitude_quaternion[4]; /*< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)*/
+ float rollspeed; /*< Body frame roll / phi angular speed (rad/s)*/
+ float pitchspeed; /*< Body frame pitch / theta angular speed (rad/s)*/
+ float yawspeed; /*< Body frame yaw / psi angular speed (rad/s)*/
+ int32_t lat; /*< Latitude, expressed as * 1E7*/
+ int32_t lon; /*< Longitude, expressed as * 1E7*/
+ int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters)*/
+ int16_t vx; /*< Ground X Speed (Latitude), expressed as m/s * 100*/
+ int16_t vy; /*< Ground Y Speed (Longitude), expressed as m/s * 100*/
+ int16_t vz; /*< Ground Z Speed (Altitude), expressed as m/s * 100*/
+ uint16_t ind_airspeed; /*< Indicated airspeed, expressed as m/s * 100*/
+ uint16_t true_airspeed; /*< True airspeed, expressed as m/s * 100*/
+ int16_t xacc; /*< X acceleration (mg)*/
+ int16_t yacc; /*< Y acceleration (mg)*/
+ int16_t zacc; /*< Z acceleration (mg)*/
+} mavlink_hil_state_quaternion_t;
+
+#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN 64
+#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN 64
+#define MAVLINK_MSG_ID_115_LEN 64
+#define MAVLINK_MSG_ID_115_MIN_LEN 64
+
+#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC 4
+#define MAVLINK_MSG_ID_115_CRC 4
+
+#define MAVLINK_MSG_HIL_STATE_QUATERNION_FIELD_ATTITUDE_QUATERNION_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \
+	115, \
+	"HIL_STATE_QUATERNION", \
+	16, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \
+         { "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_state_quaternion_t, yawspeed) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_quaternion_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_quaternion_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_hil_state_quaternion_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_quaternion_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_quaternion_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_quaternion_t, vz) }, \
+         { "ind_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 54, offsetof(mavlink_hil_state_quaternion_t, ind_airspeed) }, \
+         { "true_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_hil_state_quaternion_t, true_airspeed) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 58, offsetof(mavlink_hil_state_quaternion_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 60, offsetof(mavlink_hil_state_quaternion_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \
+	"HIL_STATE_QUATERNION", \
+	16, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \
+         { "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \
+         { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \
+         { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \
+         { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_state_quaternion_t, yawspeed) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_quaternion_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_quaternion_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_hil_state_quaternion_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_quaternion_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_quaternion_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_quaternion_t, vz) }, \
+         { "ind_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 54, offsetof(mavlink_hil_state_quaternion_t, ind_airspeed) }, \
+         { "true_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_hil_state_quaternion_t, true_airspeed) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 58, offsetof(mavlink_hil_state_quaternion_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 60, offsetof(mavlink_hil_state_quaternion_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a hil_state_quaternion message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param ind_airspeed Indicated airspeed, expressed as m/s * 100
+ * @param true_airspeed True airspeed, expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, rollspeed);
+	_mav_put_float(buf, 28, pitchspeed);
+	_mav_put_float(buf, 32, yawspeed);
+	_mav_put_int32_t(buf, 36, lat);
+	_mav_put_int32_t(buf, 40, lon);
+	_mav_put_int32_t(buf, 44, alt);
+	_mav_put_int16_t(buf, 48, vx);
+	_mav_put_int16_t(buf, 50, vy);
+	_mav_put_int16_t(buf, 52, vz);
+	_mav_put_uint16_t(buf, 54, ind_airspeed);
+	_mav_put_uint16_t(buf, 56, true_airspeed);
+	_mav_put_int16_t(buf, 58, xacc);
+	_mav_put_int16_t(buf, 60, yacc);
+	_mav_put_int16_t(buf, 62, zacc);
+	_mav_put_float_array(buf, 8, attitude_quaternion, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
+#else
+	mavlink_hil_state_quaternion_t packet;
+	packet.time_usec = time_usec;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ind_airspeed = ind_airspeed;
+	packet.true_airspeed = true_airspeed;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+}
+
+/**
+ * @brief Pack a hil_state_quaternion message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param ind_airspeed Indicated airspeed, expressed as m/s * 100
+ * @param true_airspeed True airspeed, expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,const float *attitude_quaternion,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,uint16_t ind_airspeed,uint16_t true_airspeed,int16_t xacc,int16_t yacc,int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, rollspeed);
+	_mav_put_float(buf, 28, pitchspeed);
+	_mav_put_float(buf, 32, yawspeed);
+	_mav_put_int32_t(buf, 36, lat);
+	_mav_put_int32_t(buf, 40, lon);
+	_mav_put_int32_t(buf, 44, alt);
+	_mav_put_int16_t(buf, 48, vx);
+	_mav_put_int16_t(buf, 50, vy);
+	_mav_put_int16_t(buf, 52, vz);
+	_mav_put_uint16_t(buf, 54, ind_airspeed);
+	_mav_put_uint16_t(buf, 56, true_airspeed);
+	_mav_put_int16_t(buf, 58, xacc);
+	_mav_put_int16_t(buf, 60, yacc);
+	_mav_put_int16_t(buf, 62, zacc);
+	_mav_put_float_array(buf, 8, attitude_quaternion, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
+#else
+	mavlink_hil_state_quaternion_t packet;
+	packet.time_usec = time_usec;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ind_airspeed = ind_airspeed;
+	packet.true_airspeed = true_airspeed;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+}
+
+/**
+ * @brief Encode a hil_state_quaternion struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_state_quaternion C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
+{
+	return mavlink_msg_hil_state_quaternion_pack(system_id, component_id, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
+}
+
+/**
+ * @brief Encode a hil_state_quaternion struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param hil_state_quaternion C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
+{
+	return mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, chan, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
+}
+
+/**
+ * @brief Send a hil_state_quaternion message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
+ * @param rollspeed Body frame roll / phi angular speed (rad/s)
+ * @param pitchspeed Body frame pitch / theta angular speed (rad/s)
+ * @param yawspeed Body frame yaw / psi angular speed (rad/s)
+ * @param lat Latitude, expressed as * 1E7
+ * @param lon Longitude, expressed as * 1E7
+ * @param alt Altitude in meters, expressed as * 1000 (millimeters)
+ * @param vx Ground X Speed (Latitude), expressed as m/s * 100
+ * @param vy Ground Y Speed (Longitude), expressed as m/s * 100
+ * @param vz Ground Z Speed (Altitude), expressed as m/s * 100
+ * @param ind_airspeed Indicated airspeed, expressed as m/s * 100
+ * @param true_airspeed True airspeed, expressed as m/s * 100
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_hil_state_quaternion_send(mavlink_channel_t chan, uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, rollspeed);
+	_mav_put_float(buf, 28, pitchspeed);
+	_mav_put_float(buf, 32, yawspeed);
+	_mav_put_int32_t(buf, 36, lat);
+	_mav_put_int32_t(buf, 40, lon);
+	_mav_put_int32_t(buf, 44, alt);
+	_mav_put_int16_t(buf, 48, vx);
+	_mav_put_int16_t(buf, 50, vy);
+	_mav_put_int16_t(buf, 52, vz);
+	_mav_put_uint16_t(buf, 54, ind_airspeed);
+	_mav_put_uint16_t(buf, 56, true_airspeed);
+	_mav_put_int16_t(buf, 58, xacc);
+	_mav_put_int16_t(buf, 60, yacc);
+	_mav_put_int16_t(buf, 62, zacc);
+	_mav_put_float_array(buf, 8, attitude_quaternion, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+#else
+	mavlink_hil_state_quaternion_t packet;
+	packet.time_usec = time_usec;
+	packet.rollspeed = rollspeed;
+	packet.pitchspeed = pitchspeed;
+	packet.yawspeed = yawspeed;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ind_airspeed = ind_airspeed;
+	packet.true_airspeed = true_airspeed;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a hil_state_quaternion message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_hil_state_quaternion_send_struct(mavlink_channel_t chan, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_hil_state_quaternion_send(chan, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)hil_state_quaternion, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_hil_state_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 24, rollspeed);
+	_mav_put_float(buf, 28, pitchspeed);
+	_mav_put_float(buf, 32, yawspeed);
+	_mav_put_int32_t(buf, 36, lat);
+	_mav_put_int32_t(buf, 40, lon);
+	_mav_put_int32_t(buf, 44, alt);
+	_mav_put_int16_t(buf, 48, vx);
+	_mav_put_int16_t(buf, 50, vy);
+	_mav_put_int16_t(buf, 52, vz);
+	_mav_put_uint16_t(buf, 54, ind_airspeed);
+	_mav_put_uint16_t(buf, 56, true_airspeed);
+	_mav_put_int16_t(buf, 58, xacc);
+	_mav_put_int16_t(buf, 60, yacc);
+	_mav_put_int16_t(buf, 62, zacc);
+	_mav_put_float_array(buf, 8, attitude_quaternion, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+#else
+	mavlink_hil_state_quaternion_t *packet = (mavlink_hil_state_quaternion_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->rollspeed = rollspeed;
+	packet->pitchspeed = pitchspeed;
+	packet->yawspeed = yawspeed;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->ind_airspeed = ind_airspeed;
+	packet->true_airspeed = true_airspeed;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	mav_array_memcpy(packet->attitude_quaternion, attitude_quaternion, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HIL_STATE_QUATERNION UNPACKING
+
+
+/**
+ * @brief Get field time_usec from hil_state_quaternion message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field attitude_quaternion from hil_state_quaternion message
+ *
+ * @return Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion(const mavlink_message_t* msg, float *attitude_quaternion)
+{
+	return _MAV_RETURN_float_array(msg, attitude_quaternion, 4,  8);
+}
+
+/**
+ * @brief Get field rollspeed from hil_state_quaternion message
+ *
+ * @return Body frame roll / phi angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field pitchspeed from hil_state_quaternion message
+ *
+ * @return Body frame pitch / theta angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field yawspeed from hil_state_quaternion message
+ *
+ * @return Body frame yaw / psi angular speed (rad/s)
+ */
+static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field lat from hil_state_quaternion message
+ *
+ * @return Latitude, expressed as * 1E7
+ */
+static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  36);
+}
+
+/**
+ * @brief Get field lon from hil_state_quaternion message
+ *
+ * @return Longitude, expressed as * 1E7
+ */
+static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  40);
+}
+
+/**
+ * @brief Get field alt from hil_state_quaternion message
+ *
+ * @return Altitude in meters, expressed as * 1000 (millimeters)
+ */
+static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  44);
+}
+
+/**
+ * @brief Get field vx from hil_state_quaternion message
+ *
+ * @return Ground X Speed (Latitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  48);
+}
+
+/**
+ * @brief Get field vy from hil_state_quaternion message
+ *
+ * @return Ground Y Speed (Longitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  50);
+}
+
+/**
+ * @brief Get field vz from hil_state_quaternion message
+ *
+ * @return Ground Z Speed (Altitude), expressed as m/s * 100
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  52);
+}
+
+/**
+ * @brief Get field ind_airspeed from hil_state_quaternion message
+ *
+ * @return Indicated airspeed, expressed as m/s * 100
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  54);
+}
+
+/**
+ * @brief Get field true_airspeed from hil_state_quaternion message
+ *
+ * @return True airspeed, expressed as m/s * 100
+ */
+static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  56);
+}
+
+/**
+ * @brief Get field xacc from hil_state_quaternion message
+ *
+ * @return X acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  58);
+}
+
+/**
+ * @brief Get field yacc from hil_state_quaternion message
+ *
+ * @return Y acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  60);
+}
+
+/**
+ * @brief Get field zacc from hil_state_quaternion message
+ *
+ * @return Z acceleration (mg)
+ */
+static inline int16_t mavlink_msg_hil_state_quaternion_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  62);
+}
+
+/**
+ * @brief Decode a hil_state_quaternion message into a struct
+ *
+ * @param msg The message to decode
+ * @param hil_state_quaternion C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_hil_state_quaternion_decode(const mavlink_message_t* msg, mavlink_hil_state_quaternion_t* hil_state_quaternion)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	hil_state_quaternion->time_usec = mavlink_msg_hil_state_quaternion_get_time_usec(msg);
+	mavlink_msg_hil_state_quaternion_get_attitude_quaternion(msg, hil_state_quaternion->attitude_quaternion);
+	hil_state_quaternion->rollspeed = mavlink_msg_hil_state_quaternion_get_rollspeed(msg);
+	hil_state_quaternion->pitchspeed = mavlink_msg_hil_state_quaternion_get_pitchspeed(msg);
+	hil_state_quaternion->yawspeed = mavlink_msg_hil_state_quaternion_get_yawspeed(msg);
+	hil_state_quaternion->lat = mavlink_msg_hil_state_quaternion_get_lat(msg);
+	hil_state_quaternion->lon = mavlink_msg_hil_state_quaternion_get_lon(msg);
+	hil_state_quaternion->alt = mavlink_msg_hil_state_quaternion_get_alt(msg);
+	hil_state_quaternion->vx = mavlink_msg_hil_state_quaternion_get_vx(msg);
+	hil_state_quaternion->vy = mavlink_msg_hil_state_quaternion_get_vy(msg);
+	hil_state_quaternion->vz = mavlink_msg_hil_state_quaternion_get_vz(msg);
+	hil_state_quaternion->ind_airspeed = mavlink_msg_hil_state_quaternion_get_ind_airspeed(msg);
+	hil_state_quaternion->true_airspeed = mavlink_msg_hil_state_quaternion_get_true_airspeed(msg);
+	hil_state_quaternion->xacc = mavlink_msg_hil_state_quaternion_get_xacc(msg);
+	hil_state_quaternion->yacc = mavlink_msg_hil_state_quaternion_get_yacc(msg);
+	hil_state_quaternion->zacc = mavlink_msg_hil_state_quaternion_get_zacc(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN;
+        memset(hil_state_quaternion, 0, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
+	memcpy(hil_state_quaternion, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_home_position.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_home_position.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_home_position.h	(revision 209)
@@ -0,0 +1,429 @@
+// MESSAGE HOME_POSITION PACKING
+
+#define MAVLINK_MSG_ID_HOME_POSITION 242
+
+typedef struct MAVLINK_PACKED __mavlink_home_position_t
+{
+ int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/
+ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
+ float x; /*< Local X position of this position in the local coordinate frame*/
+ float y; /*< Local Y position of this position in the local coordinate frame*/
+ float z; /*< Local Z position of this position in the local coordinate frame*/
+ float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/
+ float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+ float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+ float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+} mavlink_home_position_t;
+
+#define MAVLINK_MSG_ID_HOME_POSITION_LEN 52
+#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52
+#define MAVLINK_MSG_ID_242_LEN 52
+#define MAVLINK_MSG_ID_242_MIN_LEN 52
+
+#define MAVLINK_MSG_ID_HOME_POSITION_CRC 104
+#define MAVLINK_MSG_ID_242_CRC 104
+
+#define MAVLINK_MSG_HOME_POSITION_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
+	242, \
+	"HOME_POSITION", \
+	10, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
+         { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
+         { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
+         { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
+	"HOME_POSITION", \
+	10, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
+         { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
+         { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
+         { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a home_position message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_float_array(buf, 24, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
+#else
+	mavlink_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+}
+
+/**
+ * @brief Pack a home_position message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_float_array(buf, 24, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
+#else
+	mavlink_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+}
+
+/**
+ * @brief Encode a home_position struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param home_position C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
+{
+	return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z);
+}
+
+/**
+ * @brief Encode a home_position struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param home_position C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
+{
+	return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z);
+}
+
+/**
+ * @brief Send a home_position message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_float_array(buf, 24, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+#else
+	mavlink_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a home_position message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t chan, const mavlink_home_position_t* home_position)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_home_position_send(chan, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)home_position, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_float_array(buf, 24, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+#else
+	mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf;
+	packet->latitude = latitude;
+	packet->longitude = longitude;
+	packet->altitude = altitude;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->approach_x = approach_x;
+	packet->approach_y = approach_y;
+	packet->approach_z = approach_z;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE HOME_POSITION UNPACKING
+
+
+/**
+ * @brief Get field latitude from home_position message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field longitude from home_position message
+ *
+ * @return Longitude (WGS84, in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field altitude from home_position message
+ *
+ * @return Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field x from home_position message
+ *
+ * @return Local X position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field y from home_position message
+ *
+ * @return Local Y position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field z from home_position message
+ *
+ * @return Local Z position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field q from home_position message
+ *
+ * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ */
+static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  24);
+}
+
+/**
+ * @brief Get field approach_x from home_position message
+ *
+ * @return Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_home_position_get_approach_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field approach_y from home_position message
+ *
+ * @return Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_home_position_get_approach_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field approach_z from home_position message
+ *
+ * @return Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_home_position_get_approach_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  48);
+}
+
+/**
+ * @brief Decode a home_position message into a struct
+ *
+ * @param msg The message to decode
+ * @param home_position C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_home_position_decode(const mavlink_message_t* msg, mavlink_home_position_t* home_position)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	home_position->latitude = mavlink_msg_home_position_get_latitude(msg);
+	home_position->longitude = mavlink_msg_home_position_get_longitude(msg);
+	home_position->altitude = mavlink_msg_home_position_get_altitude(msg);
+	home_position->x = mavlink_msg_home_position_get_x(msg);
+	home_position->y = mavlink_msg_home_position_get_y(msg);
+	home_position->z = mavlink_msg_home_position_get_z(msg);
+	mavlink_msg_home_position_get_q(msg, home_position->q);
+	home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg);
+	home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg);
+	home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_HOME_POSITION_LEN;
+        memset(home_position, 0, MAVLINK_MSG_ID_HOME_POSITION_LEN);
+	memcpy(home_position, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_landing_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_landing_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_landing_target.h	(revision 209)
@@ -0,0 +1,387 @@
+// MESSAGE LANDING_TARGET PACKING
+
+#define MAVLINK_MSG_ID_LANDING_TARGET 149
+
+typedef struct MAVLINK_PACKED __mavlink_landing_target_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float angle_x; /*< X-axis angular offset (in radians) of the target from the center of the image*/
+ float angle_y; /*< Y-axis angular offset (in radians) of the target from the center of the image*/
+ float distance; /*< Distance to the target from the vehicle in meters*/
+ float size_x; /*< Size in radians of target along x-axis*/
+ float size_y; /*< Size in radians of target along y-axis*/
+ uint8_t target_num; /*< The ID of the target if multiple targets are present*/
+ uint8_t frame; /*< MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.*/
+} mavlink_landing_target_t;
+
+#define MAVLINK_MSG_ID_LANDING_TARGET_LEN 30
+#define MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN 30
+#define MAVLINK_MSG_ID_149_LEN 30
+#define MAVLINK_MSG_ID_149_MIN_LEN 30
+
+#define MAVLINK_MSG_ID_LANDING_TARGET_CRC 200
+#define MAVLINK_MSG_ID_149_CRC 200
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
+	149, \
+	"LANDING_TARGET", \
+	8, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
+         { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
+         { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
+         { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
+         { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
+         { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
+	"LANDING_TARGET", \
+	8, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
+         { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
+         { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
+         { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
+         { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
+         { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a landing_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param target_num The ID of the target if multiple targets are present
+ * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
+ * @param angle_x X-axis angular offset (in radians) of the target from the center of the image
+ * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
+ * @param distance Distance to the target from the vehicle in meters
+ * @param size_x Size in radians of target along x-axis
+ * @param size_y Size in radians of target along y-axis
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, angle_x);
+	_mav_put_float(buf, 12, angle_y);
+	_mav_put_float(buf, 16, distance);
+	_mav_put_float(buf, 20, size_x);
+	_mav_put_float(buf, 24, size_y);
+	_mav_put_uint8_t(buf, 28, target_num);
+	_mav_put_uint8_t(buf, 29, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
+#else
+	mavlink_landing_target_t packet;
+	packet.time_usec = time_usec;
+	packet.angle_x = angle_x;
+	packet.angle_y = angle_y;
+	packet.distance = distance;
+	packet.size_x = size_x;
+	packet.size_y = size_y;
+	packet.target_num = target_num;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a landing_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param target_num The ID of the target if multiple targets are present
+ * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
+ * @param angle_x X-axis angular offset (in radians) of the target from the center of the image
+ * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
+ * @param distance Distance to the target from the vehicle in meters
+ * @param size_x Size in radians of target along x-axis
+ * @param size_y Size in radians of target along y-axis
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, angle_x);
+	_mav_put_float(buf, 12, angle_y);
+	_mav_put_float(buf, 16, distance);
+	_mav_put_float(buf, 20, size_x);
+	_mav_put_float(buf, 24, size_y);
+	_mav_put_uint8_t(buf, 28, target_num);
+	_mav_put_uint8_t(buf, 29, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
+#else
+	mavlink_landing_target_t packet;
+	packet.time_usec = time_usec;
+	packet.angle_x = angle_x;
+	packet.angle_y = angle_y;
+	packet.distance = distance;
+	packet.size_x = size_x;
+	packet.size_y = size_y;
+	packet.target_num = target_num;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a landing_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param landing_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
+{
+	return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y);
+}
+
+/**
+ * @brief Encode a landing_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param landing_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
+{
+	return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y);
+}
+
+/**
+ * @brief Send a landing_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param target_num The ID of the target if multiple targets are present
+ * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
+ * @param angle_x X-axis angular offset (in radians) of the target from the center of the image
+ * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image
+ * @param distance Distance to the target from the vehicle in meters
+ * @param size_x Size in radians of target along x-axis
+ * @param size_y Size in radians of target along y-axis
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, angle_x);
+	_mav_put_float(buf, 12, angle_y);
+	_mav_put_float(buf, 16, distance);
+	_mav_put_float(buf, 20, size_x);
+	_mav_put_float(buf, 24, size_y);
+	_mav_put_uint8_t(buf, 28, target_num);
+	_mav_put_uint8_t(buf, 29, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+#else
+	mavlink_landing_target_t packet;
+	packet.time_usec = time_usec;
+	packet.angle_x = angle_x;
+	packet.angle_y = angle_y;
+	packet.distance = distance;
+	packet.size_x = size_x;
+	packet.size_y = size_y;
+	packet.target_num = target_num;
+	packet.frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a landing_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_landing_target_send_struct(mavlink_channel_t chan, const mavlink_landing_target_t* landing_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_landing_target_send(chan, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)landing_target, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LANDING_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, angle_x);
+	_mav_put_float(buf, 12, angle_y);
+	_mav_put_float(buf, 16, distance);
+	_mav_put_float(buf, 20, size_x);
+	_mav_put_float(buf, 24, size_y);
+	_mav_put_uint8_t(buf, 28, target_num);
+	_mav_put_uint8_t(buf, 29, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+#else
+	mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->angle_x = angle_x;
+	packet->angle_y = angle_y;
+	packet->distance = distance;
+	packet->size_x = size_x;
+	packet->size_y = size_y;
+	packet->target_num = target_num;
+	packet->frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LANDING_TARGET UNPACKING
+
+
+/**
+ * @brief Get field time_usec from landing_target message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_num from landing_target message
+ *
+ * @return The ID of the target if multiple targets are present
+ */
+static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  28);
+}
+
+/**
+ * @brief Get field frame from landing_target message
+ *
+ * @return MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.
+ */
+static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  29);
+}
+
+/**
+ * @brief Get field angle_x from landing_target message
+ *
+ * @return X-axis angular offset (in radians) of the target from the center of the image
+ */
+static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field angle_y from landing_target message
+ *
+ * @return Y-axis angular offset (in radians) of the target from the center of the image
+ */
+static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field distance from landing_target message
+ *
+ * @return Distance to the target from the vehicle in meters
+ */
+static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field size_x from landing_target message
+ *
+ * @return Size in radians of target along x-axis
+ */
+static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field size_y from landing_target message
+ *
+ * @return Size in radians of target along y-axis
+ */
+static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a landing_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param landing_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_landing_target_decode(const mavlink_message_t* msg, mavlink_landing_target_t* landing_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg);
+	landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg);
+	landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg);
+	landing_target->distance = mavlink_msg_landing_target_get_distance(msg);
+	landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg);
+	landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg);
+	landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg);
+	landing_target->frame = mavlink_msg_landing_target_get_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LANDING_TARGET_LEN? msg->len : MAVLINK_MSG_ID_LANDING_TARGET_LEN;
+        memset(landing_target, 0, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
+	memcpy(landing_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE LOCAL_POSITION_NED PACKING
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED 32
+
+typedef struct MAVLINK_PACKED __mavlink_local_position_ned_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float x; /*< X Position*/
+ float y; /*< Y Position*/
+ float z; /*< Z Position*/
+ float vx; /*< X Speed*/
+ float vy; /*< Y Speed*/
+ float vz; /*< Z Speed*/
+} mavlink_local_position_ned_t;
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN 28
+#define MAVLINK_MSG_ID_32_LEN 28
+#define MAVLINK_MSG_ID_32_MIN_LEN 28
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185
+#define MAVLINK_MSG_ID_32_CRC 185
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \
+	32, \
+	"LOCAL_POSITION_NED", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \
+	"LOCAL_POSITION_NED", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a local_position_ned message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed
+ * @param vy Y Speed
+ * @param vz Z Speed
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
+#else
+	mavlink_local_position_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+}
+
+/**
+ * @brief Pack a local_position_ned message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed
+ * @param vy Y Speed
+ * @param vz Z Speed
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
+#else
+	mavlink_local_position_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+}
+
+/**
+ * @brief Encode a local_position_ned struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
+{
+	return mavlink_msg_local_position_ned_pack(system_id, component_id, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
+}
+
+/**
+ * @brief Encode a local_position_ned struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
+{
+	return mavlink_msg_local_position_ned_pack_chan(system_id, component_id, chan, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
+}
+
+/**
+ * @brief Send a local_position_ned message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed
+ * @param vy Y Speed
+ * @param vz Z Speed
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+#else
+	mavlink_local_position_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+#endif
+}
+
+/**
+ * @brief Send a local_position_ned message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_local_position_ned_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_t* local_position_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_local_position_ned_send(chan, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)local_position_ned, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+#else
+	mavlink_local_position_ned_t *packet = (mavlink_local_position_ned_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOCAL_POSITION_NED UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from local_position_ned message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from local_position_ned message
+ *
+ * @return X Position
+ */
+static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field y from local_position_ned message
+ *
+ * @return Y Position
+ */
+static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field z from local_position_ned message
+ *
+ * @return Z Position
+ */
+static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vx from local_position_ned message
+ *
+ * @return X Speed
+ */
+static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field vy from local_position_ned message
+ *
+ * @return Y Speed
+ */
+static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vz from local_position_ned message
+ *
+ * @return Z Speed
+ */
+static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a local_position_ned message into a struct
+ *
+ * @param msg The message to decode
+ * @param local_position_ned C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_local_position_ned_decode(const mavlink_message_t* msg, mavlink_local_position_ned_t* local_position_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	local_position_ned->time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(msg);
+	local_position_ned->x = mavlink_msg_local_position_ned_get_x(msg);
+	local_position_ned->y = mavlink_msg_local_position_ned_get_y(msg);
+	local_position_ned->z = mavlink_msg_local_position_ned_get_z(msg);
+	local_position_ned->vx = mavlink_msg_local_position_ned_get_vx(msg);
+	local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg);
+	local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN;
+        memset(local_position_ned, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
+	memcpy(local_position_ned, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_cov.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_cov.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_cov.h	(revision 209)
@@ -0,0 +1,504 @@
+// MESSAGE LOCAL_POSITION_NED_COV PACKING
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64
+
+typedef struct MAVLINK_PACKED __mavlink_local_position_ned_cov_t
+{
+ uint64_t time_utc; /*< Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.*/
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp*/
+ float x; /*< X Position*/
+ float y; /*< Y Position*/
+ float z; /*< Z Position*/
+ float vx; /*< X Speed (m/s)*/
+ float vy; /*< Y Speed (m/s)*/
+ float vz; /*< Z Speed (m/s)*/
+ float ax; /*< X Acceleration (m/s^2)*/
+ float ay; /*< Y Acceleration (m/s^2)*/
+ float az; /*< Z Acceleration (m/s^2)*/
+ float covariance[45]; /*< Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)*/
+ uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
+} mavlink_local_position_ned_cov_t;
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 229
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN 229
+#define MAVLINK_MSG_ID_64_LEN 229
+#define MAVLINK_MSG_ID_64_MIN_LEN 229
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC 59
+#define MAVLINK_MSG_ID_64_CRC 59
+
+#define MAVLINK_MSG_LOCAL_POSITION_NED_COV_FIELD_COVARIANCE_LEN 45
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \
+	64, \
+	"LOCAL_POSITION_NED_COV", \
+	13, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_local_position_ned_cov_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, vz) }, \
+         { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ax) }, \
+         { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, ay) }, \
+         { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_local_position_ned_cov_t, az) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 48, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \
+         { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \
+	"LOCAL_POSITION_NED_COV", \
+	13, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_local_position_ned_cov_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, vz) }, \
+         { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ax) }, \
+         { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, ay) }, \
+         { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_local_position_ned_cov_t, az) }, \
+         { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 48, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \
+         { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a local_position_ned_cov message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed (m/s)
+ * @param vy Y Speed (m/s)
+ * @param vz Z Speed (m/s)
+ * @param ax X Acceleration (m/s^2)
+ * @param ay Y Acceleration (m/s^2)
+ * @param az Z Acceleration (m/s^2)
+ * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 24, vx);
+	_mav_put_float(buf, 28, vy);
+	_mav_put_float(buf, 32, vz);
+	_mav_put_float(buf, 36, ax);
+	_mav_put_float(buf, 40, ay);
+	_mav_put_float(buf, 44, az);
+	_mav_put_uint8_t(buf, 228, estimator_type);
+	_mav_put_float_array(buf, 48, covariance, 45);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
+#else
+	mavlink_local_position_ned_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ax = ax;
+	packet.ay = ay;
+	packet.az = az;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+}
+
+/**
+ * @brief Pack a local_position_ned_cov message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed (m/s)
+ * @param vy Y Speed (m/s)
+ * @param vz Z Speed (m/s)
+ * @param ax X Acceleration (m/s^2)
+ * @param ay Y Acceleration (m/s^2)
+ * @param az Z Acceleration (m/s^2)
+ * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az,const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 24, vx);
+	_mav_put_float(buf, 28, vy);
+	_mav_put_float(buf, 32, vz);
+	_mav_put_float(buf, 36, ax);
+	_mav_put_float(buf, 40, ay);
+	_mav_put_float(buf, 44, az);
+	_mav_put_uint8_t(buf, 228, estimator_type);
+	_mav_put_float_array(buf, 48, covariance, 45);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
+#else
+	mavlink_local_position_ned_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ax = ax;
+	packet.ay = ay;
+	packet.az = az;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+}
+
+/**
+ * @brief Encode a local_position_ned_cov struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
+{
+	return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
+}
+
+/**
+ * @brief Encode a local_position_ned_cov struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
+{
+	return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
+}
+
+/**
+ * @brief Send a local_position_ned_cov message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp
+ * @param time_utc Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ * @param estimator_type Class id of the estimator this estimate originated from.
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param vx X Speed (m/s)
+ * @param vy Y Speed (m/s)
+ * @param vz Z Speed (m/s)
+ * @param ax X Acceleration (m/s^2)
+ * @param ay Y Acceleration (m/s^2)
+ * @param az Z Acceleration (m/s^2)
+ * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 24, vx);
+	_mav_put_float(buf, 28, vy);
+	_mav_put_float(buf, 32, vz);
+	_mav_put_float(buf, 36, ax);
+	_mav_put_float(buf, 40, ay);
+	_mav_put_float(buf, 44, az);
+	_mav_put_uint8_t(buf, 228, estimator_type);
+	_mav_put_float_array(buf, 48, covariance, 45);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+#else
+	mavlink_local_position_ned_cov_t packet;
+	packet.time_utc = time_utc;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.ax = ax;
+	packet.ay = ay;
+	packet.az = az;
+	packet.estimator_type = estimator_type;
+	mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+#endif
+}
+
+/**
+ * @brief Send a local_position_ned_cov message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_local_position_ned_cov_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_local_position_ned_cov_send(chan, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)local_position_ned_cov, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 24, vx);
+	_mav_put_float(buf, 28, vy);
+	_mav_put_float(buf, 32, vz);
+	_mav_put_float(buf, 36, ax);
+	_mav_put_float(buf, 40, ay);
+	_mav_put_float(buf, 44, az);
+	_mav_put_uint8_t(buf, 228, estimator_type);
+	_mav_put_float_array(buf, 48, covariance, 45);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+#else
+	mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf;
+	packet->time_utc = time_utc;
+	packet->time_boot_ms = time_boot_ms;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->ax = ax;
+	packet->ay = ay;
+	packet->az = az;
+	packet->estimator_type = estimator_type;
+	mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOCAL_POSITION_NED_COV UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from local_position_ned_cov message
+ *
+ * @return Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp
+ */
+static inline uint32_t mavlink_msg_local_position_ned_cov_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field time_utc from local_position_ned_cov message
+ *
+ * @return Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.
+ */
+static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_utc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field estimator_type from local_position_ned_cov message
+ *
+ * @return Class id of the estimator this estimate originated from.
+ */
+static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  228);
+}
+
+/**
+ * @brief Get field x from local_position_ned_cov message
+ *
+ * @return X Position
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field y from local_position_ned_cov message
+ *
+ * @return Y Position
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field z from local_position_ned_cov message
+ *
+ * @return Z Position
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vx from local_position_ned_cov message
+ *
+ * @return X Speed (m/s)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field vy from local_position_ned_cov message
+ *
+ * @return Y Speed (m/s)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field vz from local_position_ned_cov message
+ *
+ * @return Z Speed (m/s)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field ax from local_position_ned_cov message
+ *
+ * @return X Acceleration (m/s^2)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field ay from local_position_ned_cov message
+ *
+ * @return Y Acceleration (m/s^2)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field az from local_position_ned_cov message
+ *
+ * @return Z Acceleration (m/s^2)
+ */
+static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field covariance from local_position_ned_cov message
+ *
+ * @return Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
+{
+	return _MAV_RETURN_float_array(msg, covariance, 45,  48);
+}
+
+/**
+ * @brief Decode a local_position_ned_cov message into a struct
+ *
+ * @param msg The message to decode
+ * @param local_position_ned_cov C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	local_position_ned_cov->time_utc = mavlink_msg_local_position_ned_cov_get_time_utc(msg);
+	local_position_ned_cov->time_boot_ms = mavlink_msg_local_position_ned_cov_get_time_boot_ms(msg);
+	local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg);
+	local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg);
+	local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg);
+	local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg);
+	local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg);
+	local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg);
+	local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg);
+	local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg);
+	local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg);
+	mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance);
+	local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN;
+        memset(local_position_ned_cov, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
+	memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_system_global_offset.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_system_global_offset.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_local_position_ned_system_global_offset.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89
+
+typedef struct MAVLINK_PACKED __mavlink_local_position_ned_system_global_offset_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float x; /*< X Position*/
+ float y; /*< Y Position*/
+ float z; /*< Z Position*/
+ float roll; /*< Roll*/
+ float pitch; /*< Pitch*/
+ float yaw; /*< Yaw*/
+} mavlink_local_position_ned_system_global_offset_t;
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN 28
+#define MAVLINK_MSG_ID_89_LEN 28
+#define MAVLINK_MSG_ID_89_MIN_LEN 28
+
+#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC 231
+#define MAVLINK_MSG_ID_89_CRC 231
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
+	89, \
+	"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
+	"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a local_position_ned_system_global_offset message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param roll Roll
+ * @param pitch Pitch
+ * @param yaw Yaw
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
+#else
+	mavlink_local_position_ned_system_global_offset_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+}
+
+/**
+ * @brief Pack a local_position_ned_system_global_offset message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param roll Roll
+ * @param pitch Pitch
+ * @param yaw Yaw
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
+#else
+	mavlink_local_position_ned_system_global_offset_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+}
+
+/**
+ * @brief Encode a local_position_ned_system_global_offset struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned_system_global_offset C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
+{
+	return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
+}
+
+/**
+ * @brief Encode a local_position_ned_system_global_offset struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param local_position_ned_system_global_offset C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
+{
+	return mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, chan, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
+}
+
+/**
+ * @brief Send a local_position_ned_system_global_offset message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param roll Roll
+ * @param pitch Pitch
+ * @param yaw Yaw
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+#else
+	mavlink_local_position_ned_system_global_offset_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a local_position_ned_system_global_offset message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_local_position_ned_system_global_offset_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_local_position_ned_system_global_offset_send(chan, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)local_position_ned_system_global_offset, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_local_position_ned_system_global_offset_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+#else
+	mavlink_local_position_ned_system_global_offset_t *packet = (mavlink_local_position_ned_system_global_offset_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from local_position_ned_system_global_offset message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from local_position_ned_system_global_offset message
+ *
+ * @return X Position
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field y from local_position_ned_system_global_offset message
+ *
+ * @return Y Position
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field z from local_position_ned_system_global_offset message
+ *
+ * @return Z Position
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field roll from local_position_ned_system_global_offset message
+ *
+ * @return Roll
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field pitch from local_position_ned_system_global_offset message
+ *
+ * @return Pitch
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field yaw from local_position_ned_system_global_offset message
+ *
+ * @return Yaw
+ */
+static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a local_position_ned_system_global_offset message into a struct
+ *
+ * @param msg The message to decode
+ * @param local_position_ned_system_global_offset C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg);
+	local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg);
+	local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg);
+	local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg);
+	local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg);
+	local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg);
+	local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN;
+        memset(local_position_ned_system_global_offset, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
+	memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_data.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE LOG_DATA PACKING
+
+#define MAVLINK_MSG_ID_LOG_DATA 120
+
+typedef struct MAVLINK_PACKED __mavlink_log_data_t
+{
+ uint32_t ofs; /*< Offset into the log*/
+ uint16_t id; /*< Log id (from LOG_ENTRY reply)*/
+ uint8_t count; /*< Number of bytes (zero for end of log)*/
+ uint8_t data[90]; /*< log data*/
+} mavlink_log_data_t;
+
+#define MAVLINK_MSG_ID_LOG_DATA_LEN 97
+#define MAVLINK_MSG_ID_LOG_DATA_MIN_LEN 97
+#define MAVLINK_MSG_ID_120_LEN 97
+#define MAVLINK_MSG_ID_120_MIN_LEN 97
+
+#define MAVLINK_MSG_ID_LOG_DATA_CRC 134
+#define MAVLINK_MSG_ID_120_CRC 134
+
+#define MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN 90
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_DATA { \
+	120, \
+	"LOG_DATA", \
+	4, \
+	{  { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_DATA { \
+	"LOG_DATA", \
+	4, \
+	{  { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes (zero for end of log)
+ * @param data log data
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint16_t(buf, 4, id);
+	_mav_put_uint8_t(buf, 6, count);
+	_mav_put_uint8_t_array(buf, 7, data, 90);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
+#else
+	mavlink_log_data_t packet;
+	packet.ofs = ofs;
+	packet.id = id;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+}
+
+/**
+ * @brief Pack a log_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes (zero for end of log)
+ * @param data log data
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t id,uint32_t ofs,uint8_t count,const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint16_t(buf, 4, id);
+	_mav_put_uint8_t(buf, 6, count);
+	_mav_put_uint8_t_array(buf, 7, data, 90);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
+#else
+	mavlink_log_data_t packet;
+	packet.ofs = ofs;
+	packet.id = id;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+}
+
+/**
+ * @brief Encode a log_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
+{
+	return mavlink_msg_log_data_pack(system_id, component_id, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
+}
+
+/**
+ * @brief Encode a log_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
+{
+	return mavlink_msg_log_data_pack_chan(system_id, component_id, chan, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
+}
+
+/**
+ * @brief Send a log_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes (zero for end of log)
+ * @param data log data
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_data_send(mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint16_t(buf, 4, id);
+	_mav_put_uint8_t(buf, 6, count);
+	_mav_put_uint8_t_array(buf, 7, data, 90);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+#else
+	mavlink_log_data_t packet;
+	packet.ofs = ofs;
+	packet.id = id;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_data_send_struct(mavlink_channel_t chan, const mavlink_log_data_t* log_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_data_send(chan, log_data->id, log_data->ofs, log_data->count, log_data->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)log_data, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint16_t(buf, 4, id);
+	_mav_put_uint8_t(buf, 6, count);
+	_mav_put_uint8_t_array(buf, 7, data, 90);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+#else
+	mavlink_log_data_t *packet = (mavlink_log_data_t *)msgbuf;
+	packet->ofs = ofs;
+	packet->id = id;
+	packet->count = count;
+	mav_array_memcpy(packet->data, data, sizeof(uint8_t)*90);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_DATA UNPACKING
+
+
+/**
+ * @brief Get field id from log_data message
+ *
+ * @return Log id (from LOG_ENTRY reply)
+ */
+static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field ofs from log_data message
+ *
+ * @return Offset into the log
+ */
+static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field count from log_data message
+ *
+ * @return Number of bytes (zero for end of log)
+ */
+static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  6);
+}
+
+/**
+ * @brief Get field data from log_data message
+ *
+ * @return log data
+ */
+static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* msg, uint8_t *data)
+{
+	return _MAV_RETURN_uint8_t_array(msg, data, 90,  7);
+}
+
+/**
+ * @brief Decode a log_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_data_decode(const mavlink_message_t* msg, mavlink_log_data_t* log_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_data->ofs = mavlink_msg_log_data_get_ofs(msg);
+	log_data->id = mavlink_msg_log_data_get_id(msg);
+	log_data->count = mavlink_msg_log_data_get_count(msg);
+	mavlink_msg_log_data_get_data(msg, log_data->data);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_DATA_LEN;
+        memset(log_data, 0, MAVLINK_MSG_ID_LOG_DATA_LEN);
+	memcpy(log_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_entry.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_entry.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_entry.h	(revision 209)
@@ -0,0 +1,312 @@
+// MESSAGE LOG_ENTRY PACKING
+
+#define MAVLINK_MSG_ID_LOG_ENTRY 118
+
+typedef struct MAVLINK_PACKED __mavlink_log_entry_t
+{
+ uint32_t time_utc; /*< UTC timestamp of log in seconds since 1970, or 0 if not available*/
+ uint32_t size; /*< Size of the log (may be approximate) in bytes*/
+ uint16_t id; /*< Log id*/
+ uint16_t num_logs; /*< Total number of logs*/
+ uint16_t last_log_num; /*< High log number*/
+} mavlink_log_entry_t;
+
+#define MAVLINK_MSG_ID_LOG_ENTRY_LEN 14
+#define MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN 14
+#define MAVLINK_MSG_ID_118_LEN 14
+#define MAVLINK_MSG_ID_118_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_LOG_ENTRY_CRC 56
+#define MAVLINK_MSG_ID_118_CRC 56
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \
+	118, \
+	"LOG_ENTRY", \
+	5, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \
+         { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \
+         { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \
+         { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \
+	"LOG_ENTRY", \
+	5, \
+	{  { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \
+         { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \
+         { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \
+         { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_entry message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param id Log id
+ * @param num_logs Total number of logs
+ * @param last_log_num High log number
+ * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
+ * @param size Size of the log (may be approximate) in bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
+	_mav_put_uint32_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 4, size);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint16_t(buf, 10, num_logs);
+	_mav_put_uint16_t(buf, 12, last_log_num);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
+#else
+	mavlink_log_entry_t packet;
+	packet.time_utc = time_utc;
+	packet.size = size;
+	packet.id = id;
+	packet.num_logs = num_logs;
+	packet.last_log_num = last_log_num;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+}
+
+/**
+ * @brief Pack a log_entry message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param id Log id
+ * @param num_logs Total number of logs
+ * @param last_log_num High log number
+ * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
+ * @param size Size of the log (may be approximate) in bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t id,uint16_t num_logs,uint16_t last_log_num,uint32_t time_utc,uint32_t size)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
+	_mav_put_uint32_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 4, size);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint16_t(buf, 10, num_logs);
+	_mav_put_uint16_t(buf, 12, last_log_num);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
+#else
+	mavlink_log_entry_t packet;
+	packet.time_utc = time_utc;
+	packet.size = size;
+	packet.id = id;
+	packet.num_logs = num_logs;
+	packet.last_log_num = last_log_num;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+}
+
+/**
+ * @brief Encode a log_entry struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_entry C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_entry_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
+{
+	return mavlink_msg_log_entry_pack(system_id, component_id, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
+}
+
+/**
+ * @brief Encode a log_entry struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_entry C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
+{
+	return mavlink_msg_log_entry_pack_chan(system_id, component_id, chan, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
+}
+
+/**
+ * @brief Send a log_entry message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param id Log id
+ * @param num_logs Total number of logs
+ * @param last_log_num High log number
+ * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
+ * @param size Size of the log (may be approximate) in bytes
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_entry_send(mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
+	_mav_put_uint32_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 4, size);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint16_t(buf, 10, num_logs);
+	_mav_put_uint16_t(buf, 12, last_log_num);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+#else
+	mavlink_log_entry_t packet;
+	packet.time_utc = time_utc;
+	packet.size = size;
+	packet.id = id;
+	packet.num_logs = num_logs;
+	packet.last_log_num = last_log_num;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_entry message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_entry_send_struct(mavlink_channel_t chan, const mavlink_log_entry_t* log_entry)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_entry_send(chan, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)log_entry, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_ENTRY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_entry_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_utc);
+	_mav_put_uint32_t(buf, 4, size);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint16_t(buf, 10, num_logs);
+	_mav_put_uint16_t(buf, 12, last_log_num);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+#else
+	mavlink_log_entry_t *packet = (mavlink_log_entry_t *)msgbuf;
+	packet->time_utc = time_utc;
+	packet->size = size;
+	packet->id = id;
+	packet->num_logs = num_logs;
+	packet->last_log_num = last_log_num;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_ENTRY UNPACKING
+
+
+/**
+ * @brief Get field id from log_entry message
+ *
+ * @return Log id
+ */
+static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field num_logs from log_entry message
+ *
+ * @return Total number of logs
+ */
+static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field last_log_num from log_entry message
+ *
+ * @return High log number
+ */
+static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field time_utc from log_entry message
+ *
+ * @return UTC timestamp of log in seconds since 1970, or 0 if not available
+ */
+static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field size from log_entry message
+ *
+ * @return Size of the log (may be approximate) in bytes
+ */
+static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  4);
+}
+
+/**
+ * @brief Decode a log_entry message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_entry C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_entry_decode(const mavlink_message_t* msg, mavlink_log_entry_t* log_entry)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_entry->time_utc = mavlink_msg_log_entry_get_time_utc(msg);
+	log_entry->size = mavlink_msg_log_entry_get_size(msg);
+	log_entry->id = mavlink_msg_log_entry_get_id(msg);
+	log_entry->num_logs = mavlink_msg_log_entry_get_num_logs(msg);
+	log_entry->last_log_num = mavlink_msg_log_entry_get_last_log_num(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ENTRY_LEN? msg->len : MAVLINK_MSG_ID_LOG_ENTRY_LEN;
+        memset(log_entry, 0, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
+	memcpy(log_entry, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_erase.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_erase.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_erase.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE LOG_ERASE PACKING
+
+#define MAVLINK_MSG_ID_LOG_ERASE 121
+
+typedef struct MAVLINK_PACKED __mavlink_log_erase_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_log_erase_t;
+
+#define MAVLINK_MSG_ID_LOG_ERASE_LEN 2
+#define MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN 2
+#define MAVLINK_MSG_ID_121_LEN 2
+#define MAVLINK_MSG_ID_121_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_LOG_ERASE_CRC 237
+#define MAVLINK_MSG_ID_121_CRC 237
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \
+	121, \
+	"LOG_ERASE", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \
+	"LOG_ERASE", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_erase message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
+#else
+	mavlink_log_erase_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+}
+
+/**
+ * @brief Pack a log_erase message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
+#else
+	mavlink_log_erase_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+}
+
+/**
+ * @brief Encode a log_erase struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_erase C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_erase_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
+{
+	return mavlink_msg_log_erase_pack(system_id, component_id, msg, log_erase->target_system, log_erase->target_component);
+}
+
+/**
+ * @brief Encode a log_erase struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_erase C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
+{
+	return mavlink_msg_log_erase_pack_chan(system_id, component_id, chan, msg, log_erase->target_system, log_erase->target_component);
+}
+
+/**
+ * @brief Send a log_erase message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_erase_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+#else
+	mavlink_log_erase_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_erase message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_erase_send_struct(mavlink_channel_t chan, const mavlink_log_erase_t* log_erase)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_erase_send(chan, log_erase->target_system, log_erase->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)log_erase, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_ERASE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_erase_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+#else
+	mavlink_log_erase_t *packet = (mavlink_log_erase_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_ERASE UNPACKING
+
+
+/**
+ * @brief Get field target_system from log_erase message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from log_erase message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a log_erase message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_erase C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_erase_decode(const mavlink_message_t* msg, mavlink_log_erase_t* log_erase)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_erase->target_system = mavlink_msg_log_erase_get_target_system(msg);
+	log_erase->target_component = mavlink_msg_log_erase_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ERASE_LEN? msg->len : MAVLINK_MSG_ID_LOG_ERASE_LEN;
+        memset(log_erase, 0, MAVLINK_MSG_ID_LOG_ERASE_LEN);
+	memcpy(log_erase, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_data.h	(revision 209)
@@ -0,0 +1,312 @@
+// MESSAGE LOG_REQUEST_DATA PACKING
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_DATA 119
+
+typedef struct MAVLINK_PACKED __mavlink_log_request_data_t
+{
+ uint32_t ofs; /*< Offset into the log*/
+ uint32_t count; /*< Number of bytes*/
+ uint16_t id; /*< Log id (from LOG_ENTRY reply)*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_log_request_data_t;
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12
+#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN 12
+#define MAVLINK_MSG_ID_119_LEN 12
+#define MAVLINK_MSG_ID_119_MIN_LEN 12
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC 116
+#define MAVLINK_MSG_ID_119_CRC 116
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \
+	119, \
+	"LOG_REQUEST_DATA", \
+	5, \
+	{  { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \
+	"LOG_REQUEST_DATA", \
+	5, \
+	{  { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \
+         { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_request_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint32_t(buf, 4, count);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint8_t(buf, 10, target_system);
+	_mav_put_uint8_t(buf, 11, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
+#else
+	mavlink_log_request_data_t packet;
+	packet.ofs = ofs;
+	packet.count = count;
+	packet.id = id;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+}
+
+/**
+ * @brief Pack a log_request_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t id,uint32_t ofs,uint32_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint32_t(buf, 4, count);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint8_t(buf, 10, target_system);
+	_mav_put_uint8_t(buf, 11, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
+#else
+	mavlink_log_request_data_t packet;
+	packet.ofs = ofs;
+	packet.count = count;
+	packet.id = id;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+}
+
+/**
+ * @brief Encode a log_request_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
+{
+	return mavlink_msg_log_request_data_pack(system_id, component_id, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
+}
+
+/**
+ * @brief Encode a log_request_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
+{
+	return mavlink_msg_log_request_data_pack_chan(system_id, component_id, chan, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
+}
+
+/**
+ * @brief Send a log_request_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param id Log id (from LOG_ENTRY reply)
+ * @param ofs Offset into the log
+ * @param count Number of bytes
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_request_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint32_t(buf, 4, count);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint8_t(buf, 10, target_system);
+	_mav_put_uint8_t(buf, 11, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+#else
+	mavlink_log_request_data_t packet;
+	packet.ofs = ofs;
+	packet.count = count;
+	packet.id = id;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_request_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_request_data_send_struct(mavlink_channel_t chan, const mavlink_log_request_data_t* log_request_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_request_data_send(chan, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)log_request_data, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_request_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, ofs);
+	_mav_put_uint32_t(buf, 4, count);
+	_mav_put_uint16_t(buf, 8, id);
+	_mav_put_uint8_t(buf, 10, target_system);
+	_mav_put_uint8_t(buf, 11, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+#else
+	mavlink_log_request_data_t *packet = (mavlink_log_request_data_t *)msgbuf;
+	packet->ofs = ofs;
+	packet->count = count;
+	packet->id = id;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_REQUEST_DATA UNPACKING
+
+
+/**
+ * @brief Get field target_system from log_request_data message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  10);
+}
+
+/**
+ * @brief Get field target_component from log_request_data message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_log_request_data_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  11);
+}
+
+/**
+ * @brief Get field id from log_request_data message
+ *
+ * @return Log id (from LOG_ENTRY reply)
+ */
+static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field ofs from log_request_data message
+ *
+ * @return Offset into the log
+ */
+static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field count from log_request_data message
+ *
+ * @return Number of bytes
+ */
+static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  4);
+}
+
+/**
+ * @brief Decode a log_request_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_request_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_request_data_decode(const mavlink_message_t* msg, mavlink_log_request_data_t* log_request_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_request_data->ofs = mavlink_msg_log_request_data_get_ofs(msg);
+	log_request_data->count = mavlink_msg_log_request_data_get_count(msg);
+	log_request_data->id = mavlink_msg_log_request_data_get_id(msg);
+	log_request_data->target_system = mavlink_msg_log_request_data_get_target_system(msg);
+	log_request_data->target_component = mavlink_msg_log_request_data_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN;
+        memset(log_request_data, 0, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
+	memcpy(log_request_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_end.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_end.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_end.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE LOG_REQUEST_END PACKING
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_END 122
+
+typedef struct MAVLINK_PACKED __mavlink_log_request_end_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_log_request_end_t;
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2
+#define MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN 2
+#define MAVLINK_MSG_ID_122_LEN 2
+#define MAVLINK_MSG_ID_122_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_END_CRC 203
+#define MAVLINK_MSG_ID_122_CRC 203
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \
+	122, \
+	"LOG_REQUEST_END", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \
+	"LOG_REQUEST_END", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_request_end message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
+#else
+	mavlink_log_request_end_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+}
+
+/**
+ * @brief Pack a log_request_end message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
+#else
+	mavlink_log_request_end_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+}
+
+/**
+ * @brief Encode a log_request_end struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_end C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_end_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
+{
+	return mavlink_msg_log_request_end_pack(system_id, component_id, msg, log_request_end->target_system, log_request_end->target_component);
+}
+
+/**
+ * @brief Encode a log_request_end struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_end C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
+{
+	return mavlink_msg_log_request_end_pack_chan(system_id, component_id, chan, msg, log_request_end->target_system, log_request_end->target_component);
+}
+
+/**
+ * @brief Send a log_request_end message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_request_end_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+#else
+	mavlink_log_request_end_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_request_end message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_request_end_send_struct(mavlink_channel_t chan, const mavlink_log_request_end_t* log_request_end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_request_end_send(chan, log_request_end->target_system, log_request_end->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)log_request_end, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_REQUEST_END_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_request_end_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+#else
+	mavlink_log_request_end_t *packet = (mavlink_log_request_end_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_REQUEST_END UNPACKING
+
+
+/**
+ * @brief Get field target_system from log_request_end message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from log_request_end message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a log_request_end message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_request_end C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_request_end_decode(const mavlink_message_t* msg, mavlink_log_request_end_t* log_request_end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_request_end->target_system = mavlink_msg_log_request_end_get_target_system(msg);
+	log_request_end->target_component = mavlink_msg_log_request_end_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_END_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_END_LEN;
+        memset(log_request_end, 0, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
+	memcpy(log_request_end, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_list.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_list.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_log_request_list.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE LOG_REQUEST_LIST PACKING
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117
+
+typedef struct MAVLINK_PACKED __mavlink_log_request_list_t
+{
+ uint16_t start; /*< First log id (0 for first available)*/
+ uint16_t end; /*< Last log id (0xffff for last available)*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_log_request_list_t;
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6
+#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN 6
+#define MAVLINK_MSG_ID_117_LEN 6
+#define MAVLINK_MSG_ID_117_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128
+#define MAVLINK_MSG_ID_117_CRC 128
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
+	117, \
+	"LOG_REQUEST_LIST", \
+	4, \
+	{  { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
+         { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
+	"LOG_REQUEST_LIST", \
+	4, \
+	{  { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
+         { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a log_request_list message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start First log id (0 for first available)
+ * @param end Last log id (0xffff for last available)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
+	_mav_put_uint16_t(buf, 0, start);
+	_mav_put_uint16_t(buf, 2, end);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
+#else
+	mavlink_log_request_list_t packet;
+	packet.start = start;
+	packet.end = end;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Pack a log_request_list message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start First log id (0 for first available)
+ * @param end Last log id (0xffff for last available)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t start,uint16_t end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
+	_mav_put_uint16_t(buf, 0, start);
+	_mav_put_uint16_t(buf, 2, end);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
+#else
+	mavlink_log_request_list_t packet;
+	packet.start = start;
+	packet.end = end;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Encode a log_request_list struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
+{
+	return mavlink_msg_log_request_list_pack(system_id, component_id, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
+}
+
+/**
+ * @brief Encode a log_request_list struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param log_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
+{
+	return mavlink_msg_log_request_list_pack_chan(system_id, component_id, chan, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
+}
+
+/**
+ * @brief Send a log_request_list message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start First log id (0 for first available)
+ * @param end Last log id (0xffff for last available)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
+	_mav_put_uint16_t(buf, 0, start);
+	_mav_put_uint16_t(buf, 2, end);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+#else
+	mavlink_log_request_list_t packet;
+	packet.start = start;
+	packet.end = end;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a log_request_list message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_log_request_list_send_struct(mavlink_channel_t chan, const mavlink_log_request_list_t* log_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_log_request_list_send(chan, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)log_request_list, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, start);
+	_mav_put_uint16_t(buf, 2, end);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+#else
+	mavlink_log_request_list_t *packet = (mavlink_log_request_list_t *)msgbuf;
+	packet->start = start;
+	packet->end = end;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE LOG_REQUEST_LIST UNPACKING
+
+
+/**
+ * @brief Get field target_system from log_request_list message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field target_component from log_request_list message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field start from log_request_list message
+ *
+ * @return First log id (0 for first available)
+ */
+static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field end from log_request_list message
+ *
+ * @return Last log id (0xffff for last available)
+ */
+static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  2);
+}
+
+/**
+ * @brief Decode a log_request_list message into a struct
+ *
+ * @param msg The message to decode
+ * @param log_request_list C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_log_request_list_decode(const mavlink_message_t* msg, mavlink_log_request_list_t* log_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	log_request_list->start = mavlink_msg_log_request_list_get_start(msg);
+	log_request_list->end = mavlink_msg_log_request_list_get_end(msg);
+	log_request_list->target_system = mavlink_msg_log_request_list_get_target_system(msg);
+	log_request_list->target_component = mavlink_msg_log_request_list_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN;
+        memset(log_request_list, 0, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
+	memcpy(log_request_list, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_control.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_control.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_control.h	(revision 209)
@@ -0,0 +1,337 @@
+// MESSAGE MANUAL_CONTROL PACKING
+
+#define MAVLINK_MSG_ID_MANUAL_CONTROL 69
+
+typedef struct MAVLINK_PACKED __mavlink_manual_control_t
+{
+ int16_t x; /*< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.*/
+ int16_t y; /*< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.*/
+ int16_t z; /*< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.*/
+ int16_t r; /*< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.*/
+ uint16_t buttons; /*< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.*/
+ uint8_t target; /*< The system to be controlled.*/
+} mavlink_manual_control_t;
+
+#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11
+#define MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN 11
+#define MAVLINK_MSG_ID_69_LEN 11
+#define MAVLINK_MSG_ID_69_MIN_LEN 11
+
+#define MAVLINK_MSG_ID_MANUAL_CONTROL_CRC 243
+#define MAVLINK_MSG_ID_69_CRC 243
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
+	69, \
+	"MANUAL_CONTROL", \
+	6, \
+	{  { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
+         { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
+         { "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
+         { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
+	"MANUAL_CONTROL", \
+	6, \
+	{  { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
+         { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
+         { "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
+         { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a manual_control message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target The system to be controlled.
+ * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
+ * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
+ * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
+ * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
+ * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
+	_mav_put_int16_t(buf, 0, x);
+	_mav_put_int16_t(buf, 2, y);
+	_mav_put_int16_t(buf, 4, z);
+	_mav_put_int16_t(buf, 6, r);
+	_mav_put_uint16_t(buf, 8, buttons);
+	_mav_put_uint8_t(buf, 10, target);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
+#else
+	mavlink_manual_control_t packet;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.r = r;
+	packet.buttons = buttons;
+	packet.target = target;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+}
+
+/**
+ * @brief Pack a manual_control message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target The system to be controlled.
+ * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
+ * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
+ * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
+ * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
+ * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
+	_mav_put_int16_t(buf, 0, x);
+	_mav_put_int16_t(buf, 2, y);
+	_mav_put_int16_t(buf, 4, z);
+	_mav_put_int16_t(buf, 6, r);
+	_mav_put_uint16_t(buf, 8, buttons);
+	_mav_put_uint8_t(buf, 10, target);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
+#else
+	mavlink_manual_control_t packet;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.r = r;
+	packet.buttons = buttons;
+	packet.target = target;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+}
+
+/**
+ * @brief Encode a manual_control struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param manual_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
+{
+	return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
+}
+
+/**
+ * @brief Encode a manual_control struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param manual_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_manual_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
+{
+	return mavlink_msg_manual_control_pack_chan(system_id, component_id, chan, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
+}
+
+/**
+ * @brief Send a manual_control message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target The system to be controlled.
+ * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
+ * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
+ * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
+ * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
+ * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
+	_mav_put_int16_t(buf, 0, x);
+	_mav_put_int16_t(buf, 2, y);
+	_mav_put_int16_t(buf, 4, z);
+	_mav_put_int16_t(buf, 6, r);
+	_mav_put_uint16_t(buf, 8, buttons);
+	_mav_put_uint8_t(buf, 10, target);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+#else
+	mavlink_manual_control_t packet;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.r = r;
+	packet.buttons = buttons;
+	packet.target = target;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a manual_control message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_manual_control_send_struct(mavlink_channel_t chan, const mavlink_manual_control_t* manual_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_manual_control_send(chan, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)manual_control, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MANUAL_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_manual_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int16_t(buf, 0, x);
+	_mav_put_int16_t(buf, 2, y);
+	_mav_put_int16_t(buf, 4, z);
+	_mav_put_int16_t(buf, 6, r);
+	_mav_put_uint16_t(buf, 8, buttons);
+	_mav_put_uint8_t(buf, 10, target);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+#else
+	mavlink_manual_control_t *packet = (mavlink_manual_control_t *)msgbuf;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->r = r;
+	packet->buttons = buttons;
+	packet->target = target;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MANUAL_CONTROL UNPACKING
+
+
+/**
+ * @brief Get field target from manual_control message
+ *
+ * @return The system to be controlled.
+ */
+static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  10);
+}
+
+/**
+ * @brief Get field x from manual_control message
+ *
+ * @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
+ */
+static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  0);
+}
+
+/**
+ * @brief Get field y from manual_control message
+ *
+ * @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
+ */
+static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  2);
+}
+
+/**
+ * @brief Get field z from manual_control message
+ *
+ * @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
+ */
+static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  4);
+}
+
+/**
+ * @brief Get field r from manual_control message
+ *
+ * @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
+ */
+static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  6);
+}
+
+/**
+ * @brief Get field buttons from manual_control message
+ *
+ * @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
+ */
+static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Decode a manual_control message into a struct
+ *
+ * @param msg The message to decode
+ * @param manual_control C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	manual_control->x = mavlink_msg_manual_control_get_x(msg);
+	manual_control->y = mavlink_msg_manual_control_get_y(msg);
+	manual_control->z = mavlink_msg_manual_control_get_z(msg);
+	manual_control->r = mavlink_msg_manual_control_get_r(msg);
+	manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg);
+	manual_control->target = mavlink_msg_manual_control_get_target(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_CONTROL_LEN;
+        memset(manual_control, 0, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
+	memcpy(manual_control, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_setpoint.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_setpoint.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_manual_setpoint.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE MANUAL_SETPOINT PACKING
+
+#define MAVLINK_MSG_ID_MANUAL_SETPOINT 81
+
+typedef struct MAVLINK_PACKED __mavlink_manual_setpoint_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
+ float roll; /*< Desired roll rate in radians per second*/
+ float pitch; /*< Desired pitch rate in radians per second*/
+ float yaw; /*< Desired yaw rate in radians per second*/
+ float thrust; /*< Collective thrust, normalized to 0 .. 1*/
+ uint8_t mode_switch; /*< Flight mode switch position, 0.. 255*/
+ uint8_t manual_override_switch; /*< Override mode switch position, 0.. 255*/
+} mavlink_manual_setpoint_t;
+
+#define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22
+#define MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN 22
+#define MAVLINK_MSG_ID_81_LEN 22
+#define MAVLINK_MSG_ID_81_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC 106
+#define MAVLINK_MSG_ID_81_CRC 106
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
+	81, \
+	"MANUAL_SETPOINT", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
+         { "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
+         { "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
+	"MANUAL_SETPOINT", \
+	7, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
+         { "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
+         { "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a manual_setpoint message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param roll Desired roll rate in radians per second
+ * @param pitch Desired pitch rate in radians per second
+ * @param yaw Desired yaw rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1
+ * @param mode_switch Flight mode switch position, 0.. 255
+ * @param manual_override_switch Override mode switch position, 0.. 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, thrust);
+	_mav_put_uint8_t(buf, 20, mode_switch);
+	_mav_put_uint8_t(buf, 21, manual_override_switch);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
+#else
+	mavlink_manual_setpoint_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.thrust = thrust;
+	packet.mode_switch = mode_switch;
+	packet.manual_override_switch = manual_override_switch;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+}
+
+/**
+ * @brief Pack a manual_setpoint message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param roll Desired roll rate in radians per second
+ * @param pitch Desired pitch rate in radians per second
+ * @param yaw Desired yaw rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1
+ * @param mode_switch Flight mode switch position, 0.. 255
+ * @param manual_override_switch Override mode switch position, 0.. 255
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, thrust);
+	_mav_put_uint8_t(buf, 20, mode_switch);
+	_mav_put_uint8_t(buf, 21, manual_override_switch);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
+#else
+	mavlink_manual_setpoint_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.thrust = thrust;
+	packet.mode_switch = mode_switch;
+	packet.manual_override_switch = manual_override_switch;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+}
+
+/**
+ * @brief Encode a manual_setpoint struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param manual_setpoint C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
+{
+	return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
+}
+
+/**
+ * @brief Encode a manual_setpoint struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param manual_setpoint C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_manual_setpoint_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
+{
+	return mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, chan, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
+}
+
+/**
+ * @brief Send a manual_setpoint message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param roll Desired roll rate in radians per second
+ * @param pitch Desired pitch rate in radians per second
+ * @param yaw Desired yaw rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1
+ * @param mode_switch Flight mode switch position, 0.. 255
+ * @param manual_override_switch Override mode switch position, 0.. 255
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, thrust);
+	_mav_put_uint8_t(buf, 20, mode_switch);
+	_mav_put_uint8_t(buf, 21, manual_override_switch);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+#else
+	mavlink_manual_setpoint_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.thrust = thrust;
+	packet.mode_switch = mode_switch;
+	packet.manual_override_switch = manual_override_switch;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a manual_setpoint message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_manual_setpoint_send_struct(mavlink_channel_t chan, const mavlink_manual_setpoint_t* manual_setpoint)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_manual_setpoint_send(chan, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)manual_setpoint, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_manual_setpoint_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, roll);
+	_mav_put_float(buf, 8, pitch);
+	_mav_put_float(buf, 12, yaw);
+	_mav_put_float(buf, 16, thrust);
+	_mav_put_uint8_t(buf, 20, mode_switch);
+	_mav_put_uint8_t(buf, 21, manual_override_switch);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+#else
+	mavlink_manual_setpoint_t *packet = (mavlink_manual_setpoint_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+	packet->thrust = thrust;
+	packet->mode_switch = mode_switch;
+	packet->manual_override_switch = manual_override_switch;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MANUAL_SETPOINT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from manual_setpoint message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field roll from manual_setpoint message
+ *
+ * @return Desired roll rate in radians per second
+ */
+static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field pitch from manual_setpoint message
+ *
+ * @return Desired pitch rate in radians per second
+ */
+static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field yaw from manual_setpoint message
+ *
+ * @return Desired yaw rate in radians per second
+ */
+static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field thrust from manual_setpoint message
+ *
+ * @return Collective thrust, normalized to 0 .. 1
+ */
+static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field mode_switch from manual_setpoint message
+ *
+ * @return Flight mode switch position, 0.. 255
+ */
+static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  20);
+}
+
+/**
+ * @brief Get field manual_override_switch from manual_setpoint message
+ *
+ * @return Override mode switch position, 0.. 255
+ */
+static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  21);
+}
+
+/**
+ * @brief Decode a manual_setpoint message into a struct
+ *
+ * @param msg The message to decode
+ * @param manual_setpoint C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* msg, mavlink_manual_setpoint_t* manual_setpoint)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg);
+	manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg);
+	manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg);
+	manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg);
+	manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg);
+	manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg);
+	manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN;
+        memset(manual_setpoint, 0, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
+	memcpy(manual_setpoint, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_memory_vect.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_memory_vect.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_memory_vect.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE MEMORY_VECT PACKING
+
+#define MAVLINK_MSG_ID_MEMORY_VECT 249
+
+typedef struct MAVLINK_PACKED __mavlink_memory_vect_t
+{
+ uint16_t address; /*< Starting address of the debug variables*/
+ uint8_t ver; /*< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below*/
+ uint8_t type; /*< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14*/
+ int8_t value[32]; /*< Memory contents at specified address*/
+} mavlink_memory_vect_t;
+
+#define MAVLINK_MSG_ID_MEMORY_VECT_LEN 36
+#define MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN 36
+#define MAVLINK_MSG_ID_249_LEN 36
+#define MAVLINK_MSG_ID_249_MIN_LEN 36
+
+#define MAVLINK_MSG_ID_MEMORY_VECT_CRC 204
+#define MAVLINK_MSG_ID_249_CRC 204
+
+#define MAVLINK_MSG_MEMORY_VECT_FIELD_VALUE_LEN 32
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \
+	249, \
+	"MEMORY_VECT", \
+	4, \
+	{  { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \
+         { "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \
+         { "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \
+	"MEMORY_VECT", \
+	4, \
+	{  { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \
+         { "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \
+         { "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a memory_vect message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param address Starting address of the debug variables
+ * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
+ * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
+ * @param value Memory contents at specified address
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
+	_mav_put_uint16_t(buf, 0, address);
+	_mav_put_uint8_t(buf, 2, ver);
+	_mav_put_uint8_t(buf, 3, type);
+	_mav_put_int8_t_array(buf, 4, value, 32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
+#else
+	mavlink_memory_vect_t packet;
+	packet.address = address;
+	packet.ver = ver;
+	packet.type = type;
+	mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+}
+
+/**
+ * @brief Pack a memory_vect message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param address Starting address of the debug variables
+ * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
+ * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
+ * @param value Memory contents at specified address
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t address,uint8_t ver,uint8_t type,const int8_t *value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
+	_mav_put_uint16_t(buf, 0, address);
+	_mav_put_uint8_t(buf, 2, ver);
+	_mav_put_uint8_t(buf, 3, type);
+	_mav_put_int8_t_array(buf, 4, value, 32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
+#else
+	mavlink_memory_vect_t packet;
+	packet.address = address;
+	packet.ver = ver;
+	packet.type = type;
+	mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+}
+
+/**
+ * @brief Encode a memory_vect struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param memory_vect C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_memory_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect)
+{
+	return mavlink_msg_memory_vect_pack(system_id, component_id, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
+}
+
+/**
+ * @brief Encode a memory_vect struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param memory_vect C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_memory_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect)
+{
+	return mavlink_msg_memory_vect_pack_chan(system_id, component_id, chan, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
+}
+
+/**
+ * @brief Send a memory_vect message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param address Starting address of the debug variables
+ * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
+ * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
+ * @param value Memory contents at specified address
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_memory_vect_send(mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
+	_mav_put_uint16_t(buf, 0, address);
+	_mav_put_uint8_t(buf, 2, ver);
+	_mav_put_uint8_t(buf, 3, type);
+	_mav_put_int8_t_array(buf, 4, value, 32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+#else
+	mavlink_memory_vect_t packet;
+	packet.address = address;
+	packet.ver = ver;
+	packet.type = type;
+	mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a memory_vect message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_memory_vect_send_struct(mavlink_channel_t chan, const mavlink_memory_vect_t* memory_vect)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_memory_vect_send(chan, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)memory_vect, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MEMORY_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_memory_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, address);
+	_mav_put_uint8_t(buf, 2, ver);
+	_mav_put_uint8_t(buf, 3, type);
+	_mav_put_int8_t_array(buf, 4, value, 32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+#else
+	mavlink_memory_vect_t *packet = (mavlink_memory_vect_t *)msgbuf;
+	packet->address = address;
+	packet->ver = ver;
+	packet->type = type;
+	mav_array_memcpy(packet->value, value, sizeof(int8_t)*32);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MEMORY_VECT UNPACKING
+
+
+/**
+ * @brief Get field address from memory_vect message
+ *
+ * @return Starting address of the debug variables
+ */
+static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field ver from memory_vect message
+ *
+ * @return Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
+ */
+static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field type from memory_vect message
+ *
+ * @return Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
+ */
+static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field value from memory_vect message
+ *
+ * @return Memory contents at specified address
+ */
+static inline uint16_t mavlink_msg_memory_vect_get_value(const mavlink_message_t* msg, int8_t *value)
+{
+	return _MAV_RETURN_int8_t_array(msg, value, 32,  4);
+}
+
+/**
+ * @brief Decode a memory_vect message into a struct
+ *
+ * @param msg The message to decode
+ * @param memory_vect C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_memory_vect_decode(const mavlink_message_t* msg, mavlink_memory_vect_t* memory_vect)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	memory_vect->address = mavlink_msg_memory_vect_get_address(msg);
+	memory_vect->ver = mavlink_msg_memory_vect_get_ver(msg);
+	memory_vect->type = mavlink_msg_memory_vect_get_type(msg);
+	mavlink_msg_memory_vect_get_value(msg, memory_vect->value);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MEMORY_VECT_LEN? msg->len : MAVLINK_MSG_ID_MEMORY_VECT_LEN;
+        memset(memory_vect, 0, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
+	memcpy(memory_vect, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_message_interval.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_message_interval.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_message_interval.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE MESSAGE_INTERVAL PACKING
+
+#define MAVLINK_MSG_ID_MESSAGE_INTERVAL 244
+
+typedef struct MAVLINK_PACKED __mavlink_message_interval_t
+{
+ int32_t interval_us; /*< The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/
+ uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/
+} mavlink_message_interval_t;
+
+#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN 6
+#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN 6
+#define MAVLINK_MSG_ID_244_LEN 6
+#define MAVLINK_MSG_ID_244_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC 95
+#define MAVLINK_MSG_ID_244_CRC 95
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \
+	244, \
+	"MESSAGE_INTERVAL", \
+	2, \
+	{  { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \
+         { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \
+	"MESSAGE_INTERVAL", \
+	2, \
+	{  { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \
+         { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a message_interval message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
+ * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t message_id, int32_t interval_us)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
+	_mav_put_int32_t(buf, 0, interval_us);
+	_mav_put_uint16_t(buf, 4, message_id);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
+#else
+	mavlink_message_interval_t packet;
+	packet.interval_us = interval_us;
+	packet.message_id = message_id;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+}
+
+/**
+ * @brief Pack a message_interval message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
+ * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t message_id,int32_t interval_us)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
+	_mav_put_int32_t(buf, 0, interval_us);
+	_mav_put_uint16_t(buf, 4, message_id);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
+#else
+	mavlink_message_interval_t packet;
+	packet.interval_us = interval_us;
+	packet.message_id = message_id;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+}
+
+/**
+ * @brief Encode a message_interval struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param message_interval C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_message_interval_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
+{
+	return mavlink_msg_message_interval_pack(system_id, component_id, msg, message_interval->message_id, message_interval->interval_us);
+}
+
+/**
+ * @brief Encode a message_interval struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param message_interval C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
+{
+	return mavlink_msg_message_interval_pack_chan(system_id, component_id, chan, msg, message_interval->message_id, message_interval->interval_us);
+}
+
+/**
+ * @brief Send a message_interval message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
+ * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_message_interval_send(mavlink_channel_t chan, uint16_t message_id, int32_t interval_us)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
+	_mav_put_int32_t(buf, 0, interval_us);
+	_mav_put_uint16_t(buf, 4, message_id);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+#else
+	mavlink_message_interval_t packet;
+	packet.interval_us = interval_us;
+	packet.message_id = message_id;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a message_interval message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_message_interval_send_struct(mavlink_channel_t chan, const mavlink_message_interval_t* message_interval)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_message_interval_send(chan, message_interval->message_id, message_interval->interval_us);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)message_interval, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_message_interval_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t message_id, int32_t interval_us)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, interval_us);
+	_mav_put_uint16_t(buf, 4, message_id);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+#else
+	mavlink_message_interval_t *packet = (mavlink_message_interval_t *)msgbuf;
+	packet->interval_us = interval_us;
+	packet->message_id = message_id;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MESSAGE_INTERVAL UNPACKING
+
+
+/**
+ * @brief Get field message_id from message_interval message
+ *
+ * @return The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
+ */
+static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field interval_us from message_interval message
+ *
+ * @return The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
+ */
+static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Decode a message_interval message into a struct
+ *
+ * @param msg The message to decode
+ * @param message_interval C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_message_interval_decode(const mavlink_message_t* msg, mavlink_message_interval_t* message_interval)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	message_interval->interval_us = mavlink_msg_message_interval_get_interval_us(msg);
+	message_interval->message_id = mavlink_msg_message_interval_get_message_id(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN? msg->len : MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN;
+        memset(message_interval, 0, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
+	memcpy(message_interval, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_ack.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_ack.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_ack.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE MISSION_ACK PACKING
+
+#define MAVLINK_MSG_ID_MISSION_ACK 47
+
+typedef struct MAVLINK_PACKED __mavlink_mission_ack_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t type; /*< See MAV_MISSION_RESULT enum*/
+} mavlink_mission_ack_t;
+
+#define MAVLINK_MSG_ID_MISSION_ACK_LEN 3
+#define MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN 3
+#define MAVLINK_MSG_ID_47_LEN 3
+#define MAVLINK_MSG_ID_47_MIN_LEN 3
+
+#define MAVLINK_MSG_ID_MISSION_ACK_CRC 153
+#define MAVLINK_MSG_ID_47_CRC 153
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_ACK { \
+	47, \
+	"MISSION_ACK", \
+	3, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_ACK { \
+	"MISSION_ACK", \
+	3, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \
+         { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_ack message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type See MAV_MISSION_RESULT enum
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint8_t type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN);
+#else
+	mavlink_mission_ack_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type = type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+}
+
+/**
+ * @brief Pack a mission_ack message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type See MAV_MISSION_RESULT enum
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint8_t type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, type);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN);
+#else
+	mavlink_mission_ack_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type = type;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+}
+
+/**
+ * @brief Encode a mission_ack struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack)
+{
+	return mavlink_msg_mission_ack_pack(system_id, component_id, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type);
+}
+
+/**
+ * @brief Encode a mission_ack struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_ack C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack)
+{
+	return mavlink_msg_mission_ack_pack_chan(system_id, component_id, chan, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type);
+}
+
+/**
+ * @brief Send a mission_ack message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type See MAV_MISSION_RESULT enum
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+#else
+	mavlink_mission_ack_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type = type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_ack message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_ack_send_struct(mavlink_channel_t chan, const mavlink_mission_ack_t* mission_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_ack_send(chan, mission_ack->target_system, mission_ack->target_component, mission_ack->type);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)mission_ack, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint8_t type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+	_mav_put_uint8_t(buf, 2, type);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+#else
+	mavlink_mission_ack_t *packet = (mavlink_mission_ack_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->type = type;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_ACK UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_ack message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from mission_ack message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field type from mission_ack message
+ *
+ * @return See MAV_MISSION_RESULT enum
+ */
+static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Decode a mission_ack message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_ack C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_ack_decode(const mavlink_message_t* msg, mavlink_mission_ack_t* mission_ack)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_ack->target_system = mavlink_msg_mission_ack_get_target_system(msg);
+	mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg);
+	mission_ack->type = mavlink_msg_mission_ack_get_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ACK_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ACK_LEN;
+        memset(mission_ack, 0, MAVLINK_MSG_ID_MISSION_ACK_LEN);
+	memcpy(mission_ack, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_clear_all.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_clear_all.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_clear_all.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE MISSION_CLEAR_ALL PACKING
+
+#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45
+
+typedef struct MAVLINK_PACKED __mavlink_mission_clear_all_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_clear_all_t;
+
+#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2
+#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN 2
+#define MAVLINK_MSG_ID_45_LEN 2
+#define MAVLINK_MSG_ID_45_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC 232
+#define MAVLINK_MSG_ID_45_CRC 232
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \
+	45, \
+	"MISSION_CLEAR_ALL", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \
+	"MISSION_CLEAR_ALL", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_clear_all message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
+#else
+	mavlink_mission_clear_all_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+}
+
+/**
+ * @brief Pack a mission_clear_all message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
+#else
+	mavlink_mission_clear_all_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+}
+
+/**
+ * @brief Encode a mission_clear_all struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_clear_all C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all)
+{
+	return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component);
+}
+
+/**
+ * @brief Encode a mission_clear_all struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_clear_all C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_clear_all_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all)
+{
+	return mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, chan, msg, mission_clear_all->target_system, mission_clear_all->target_component);
+}
+
+/**
+ * @brief Send a mission_clear_all message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+#else
+	mavlink_mission_clear_all_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_clear_all message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_clear_all_send_struct(mavlink_channel_t chan, const mavlink_mission_clear_all_t* mission_clear_all)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_clear_all_send(chan, mission_clear_all->target_system, mission_clear_all->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)mission_clear_all, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_clear_all_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+#else
+	mavlink_mission_clear_all_t *packet = (mavlink_mission_clear_all_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_CLEAR_ALL UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_clear_all message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from mission_clear_all message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a mission_clear_all message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_clear_all C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* msg, mavlink_mission_clear_all_t* mission_clear_all)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg);
+	mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN;
+        memset(mission_clear_all, 0, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
+	memcpy(mission_clear_all, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_count.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_count.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_count.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE MISSION_COUNT PACKING
+
+#define MAVLINK_MSG_ID_MISSION_COUNT 44
+
+typedef struct MAVLINK_PACKED __mavlink_mission_count_t
+{
+ uint16_t count; /*< Number of mission items in the sequence*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_count_t;
+
+#define MAVLINK_MSG_ID_MISSION_COUNT_LEN 4
+#define MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN 4
+#define MAVLINK_MSG_ID_44_LEN 4
+#define MAVLINK_MSG_ID_44_MIN_LEN 4
+
+#define MAVLINK_MSG_ID_MISSION_COUNT_CRC 221
+#define MAVLINK_MSG_ID_44_CRC 221
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \
+	44, \
+	"MISSION_COUNT", \
+	3, \
+	{  { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \
+	"MISSION_COUNT", \
+	3, \
+	{  { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_count message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param count Number of mission items in the sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
+	_mav_put_uint16_t(buf, 0, count);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
+#else
+	mavlink_mission_count_t packet;
+	packet.count = count;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+}
+
+/**
+ * @brief Pack a mission_count message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param count Number of mission items in the sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
+	_mav_put_uint16_t(buf, 0, count);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
+#else
+	mavlink_mission_count_t packet;
+	packet.count = count;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+}
+
+/**
+ * @brief Encode a mission_count struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_count C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count)
+{
+	return mavlink_msg_mission_count_pack(system_id, component_id, msg, mission_count->target_system, mission_count->target_component, mission_count->count);
+}
+
+/**
+ * @brief Encode a mission_count struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_count C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_count_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count)
+{
+	return mavlink_msg_mission_count_pack_chan(system_id, component_id, chan, msg, mission_count->target_system, mission_count->target_component, mission_count->count);
+}
+
+/**
+ * @brief Send a mission_count message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param count Number of mission items in the sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
+	_mav_put_uint16_t(buf, 0, count);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+#else
+	mavlink_mission_count_t packet;
+	packet.count = count;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_count message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_count_send_struct(mavlink_channel_t chan, const mavlink_mission_count_t* mission_count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_count_send(chan, mission_count->target_system, mission_count->target_component, mission_count->count);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)mission_count, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_COUNT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_count_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, count);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+#else
+	mavlink_mission_count_t *packet = (mavlink_mission_count_t *)msgbuf;
+	packet->count = count;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_COUNT UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_count message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from mission_count message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field count from mission_count message
+ *
+ * @return Number of mission items in the sequence
+ */
+static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_count message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_count C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_count_decode(const mavlink_message_t* msg, mavlink_mission_count_t* mission_count)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_count->count = mavlink_msg_mission_count_get_count(msg);
+	mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg);
+	mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_COUNT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_COUNT_LEN;
+        memset(mission_count, 0, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
+	memcpy(mission_count, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_current.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_current.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_current.h	(revision 209)
@@ -0,0 +1,212 @@
+// MESSAGE MISSION_CURRENT PACKING
+
+#define MAVLINK_MSG_ID_MISSION_CURRENT 42
+
+typedef struct MAVLINK_PACKED __mavlink_mission_current_t
+{
+ uint16_t seq; /*< Sequence*/
+} mavlink_mission_current_t;
+
+#define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2
+#define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2
+#define MAVLINK_MSG_ID_42_LEN 2
+#define MAVLINK_MSG_ID_42_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28
+#define MAVLINK_MSG_ID_42_CRC 28
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
+	42, \
+	"MISSION_CURRENT", \
+	1, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
+	"MISSION_CURRENT", \
+	1, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_current message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
+#else
+	mavlink_mission_current_t packet;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+}
+
+/**
+ * @brief Pack a mission_current message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
+#else
+	mavlink_mission_current_t packet;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+}
+
+/**
+ * @brief Encode a mission_current struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_current C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
+{
+	return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq);
+}
+
+/**
+ * @brief Encode a mission_current struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_current C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
+{
+	return mavlink_msg_mission_current_pack_chan(system_id, component_id, chan, msg, mission_current->seq);
+}
+
+/**
+ * @brief Send a mission_current message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param seq Sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+#else
+	mavlink_mission_current_t packet;
+	packet.seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_current message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_current_send_struct(mavlink_channel_t chan, const mavlink_mission_current_t* mission_current)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_current_send(chan, mission_current->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)mission_current, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+#else
+	mavlink_mission_current_t *packet = (mavlink_mission_current_t *)msgbuf;
+	packet->seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_CURRENT UNPACKING
+
+
+/**
+ * @brief Get field seq from mission_current message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_current message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_current C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* msg, mavlink_mission_current_t* mission_current)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_current->seq = mavlink_msg_mission_current_get_seq(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CURRENT_LEN;
+        memset(mission_current, 0, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
+	memcpy(mission_current, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item.h	(revision 209)
@@ -0,0 +1,537 @@
+// MESSAGE MISSION_ITEM PACKING
+
+#define MAVLINK_MSG_ID_MISSION_ITEM 39
+
+typedef struct MAVLINK_PACKED __mavlink_mission_item_t
+{
+ float param1; /*< PARAM1, see MAV_CMD enum*/
+ float param2; /*< PARAM2, see MAV_CMD enum*/
+ float param3; /*< PARAM3, see MAV_CMD enum*/
+ float param4; /*< PARAM4, see MAV_CMD enum*/
+ float x; /*< PARAM5 / local: x position, global: latitude*/
+ float y; /*< PARAM6 / y position: global: longitude*/
+ float z; /*< PARAM7 / z position: global: altitude (relative or absolute, depending on frame.*/
+ uint16_t seq; /*< Sequence*/
+ uint16_t command; /*< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/
+ uint8_t current; /*< false:0, true:1*/
+ uint8_t autocontinue; /*< autocontinue to next wp*/
+} mavlink_mission_item_t;
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_LEN 37
+#define MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN 37
+#define MAVLINK_MSG_ID_39_LEN 37
+#define MAVLINK_MSG_ID_39_MIN_LEN 37
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_CRC 254
+#define MAVLINK_MSG_ID_39_CRC 254
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
+	39, \
+	"MISSION_ITEM", \
+	14, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
+	"MISSION_ITEM", \
+	14, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_item message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position, global: latitude
+ * @param y PARAM6 / y position: global: longitude
+ * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, x);
+	_mav_put_float(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
+#else
+	mavlink_mission_item_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+}
+
+/**
+ * @brief Pack a mission_item message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position, global: latitude
+ * @param y PARAM6 / y position: global: longitude
+ * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, x);
+	_mav_put_float(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
+#else
+	mavlink_mission_item_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+}
+
+/**
+ * @brief Encode a mission_item struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item)
+{
+	return mavlink_msg_mission_item_pack(system_id, component_id, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z);
+}
+
+/**
+ * @brief Encode a mission_item struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item)
+{
+	return mavlink_msg_mission_item_pack_chan(system_id, component_id, chan, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z);
+}
+
+/**
+ * @brief Send a mission_item message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position, global: latitude
+ * @param y PARAM6 / y position: global: longitude
+ * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, x);
+	_mav_put_float(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+#else
+	mavlink_mission_item_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_item message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_item_send_struct(mavlink_channel_t chan, const mavlink_mission_item_t* mission_item)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_item_send(chan, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)mission_item, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_ITEM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_float(buf, 16, x);
+	_mav_put_float(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+#else
+	mavlink_mission_item_t *packet = (mavlink_mission_item_t *)msgbuf;
+	packet->param1 = param1;
+	packet->param2 = param2;
+	packet->param3 = param3;
+	packet->param4 = param4;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->seq = seq;
+	packet->command = command;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->frame = frame;
+	packet->current = current;
+	packet->autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_ITEM UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_item message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field target_component from mission_item message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field seq from mission_item message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field frame from mission_item message
+ *
+ * @return The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ */
+static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field command from mission_item message
+ *
+ * @return The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ */
+static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  30);
+}
+
+/**
+ * @brief Get field current from mission_item message
+ *
+ * @return false:0, true:1
+ */
+static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  35);
+}
+
+/**
+ * @brief Get field autocontinue from mission_item message
+ *
+ * @return autocontinue to next wp
+ */
+static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field param1 from mission_item message
+ *
+ * @return PARAM1, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param2 from mission_item message
+ *
+ * @return PARAM2, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field param3 from mission_item message
+ *
+ * @return PARAM3, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field param4 from mission_item message
+ *
+ * @return PARAM4, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field x from mission_item message
+ *
+ * @return PARAM5 / local: x position, global: latitude
+ */
+static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field y from mission_item message
+ *
+ * @return PARAM6 / y position: global: longitude
+ */
+static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field z from mission_item message
+ *
+ * @return PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
+ */
+static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a mission_item message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_item C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_item_decode(const mavlink_message_t* msg, mavlink_mission_item_t* mission_item)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_item->param1 = mavlink_msg_mission_item_get_param1(msg);
+	mission_item->param2 = mavlink_msg_mission_item_get_param2(msg);
+	mission_item->param3 = mavlink_msg_mission_item_get_param3(msg);
+	mission_item->param4 = mavlink_msg_mission_item_get_param4(msg);
+	mission_item->x = mavlink_msg_mission_item_get_x(msg);
+	mission_item->y = mavlink_msg_mission_item_get_y(msg);
+	mission_item->z = mavlink_msg_mission_item_get_z(msg);
+	mission_item->seq = mavlink_msg_mission_item_get_seq(msg);
+	mission_item->command = mavlink_msg_mission_item_get_command(msg);
+	mission_item->target_system = mavlink_msg_mission_item_get_target_system(msg);
+	mission_item->target_component = mavlink_msg_mission_item_get_target_component(msg);
+	mission_item->frame = mavlink_msg_mission_item_get_frame(msg);
+	mission_item->current = mavlink_msg_mission_item_get_current(msg);
+	mission_item->autocontinue = mavlink_msg_mission_item_get_autocontinue(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_LEN;
+        memset(mission_item, 0, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
+	memcpy(mission_item, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_int.h	(revision 209)
@@ -0,0 +1,537 @@
+// MESSAGE MISSION_ITEM_INT PACKING
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_INT 73
+
+typedef struct MAVLINK_PACKED __mavlink_mission_item_int_t
+{
+ float param1; /*< PARAM1, see MAV_CMD enum*/
+ float param2; /*< PARAM2, see MAV_CMD enum*/
+ float param3; /*< PARAM3, see MAV_CMD enum*/
+ float param4; /*< PARAM4, see MAV_CMD enum*/
+ int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
+ int32_t y; /*< PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7*/
+ float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/
+ uint16_t seq; /*< Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).*/
+ uint16_t command; /*< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/
+ uint8_t current; /*< false:0, true:1*/
+ uint8_t autocontinue; /*< autocontinue to next wp*/
+} mavlink_mission_item_int_t;
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN 37
+#define MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN 37
+#define MAVLINK_MSG_ID_73_LEN 37
+#define MAVLINK_MSG_ID_73_MIN_LEN 37
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC 38
+#define MAVLINK_MSG_ID_73_CRC 38
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \
+	73, \
+	"MISSION_ITEM_INT", \
+	14, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \
+	"MISSION_ITEM_INT", \
+	14, \
+	{  { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \
+         { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \
+         { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \
+         { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \
+         { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \
+         { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \
+         { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \
+         { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_item_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
+#else
+	mavlink_mission_item_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+}
+
+/**
+ * @brief Pack a mission_item_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
+#else
+	mavlink_mission_item_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+}
+
+/**
+ * @brief Encode a mission_item_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int)
+{
+	return mavlink_msg_mission_item_int_pack(system_id, component_id, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z);
+}
+
+/**
+ * @brief Encode a mission_item_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int)
+{
+	return mavlink_msg_mission_item_int_pack_chan(system_id, component_id, chan, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z);
+}
+
+/**
+ * @brief Send a mission_item_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
+ * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ * @param current false:0, true:1
+ * @param autocontinue autocontinue to next wp
+ * @param param1 PARAM1, see MAV_CMD enum
+ * @param param2 PARAM2, see MAV_CMD enum
+ * @param param3 PARAM3, see MAV_CMD enum
+ * @param param4 PARAM4, see MAV_CMD enum
+ * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
+ * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_item_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+#else
+	mavlink_mission_item_int_t packet;
+	packet.param1 = param1;
+	packet.param2 = param2;
+	packet.param3 = param3;
+	packet.param4 = param4;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.seq = seq;
+	packet.command = command;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+	packet.current = current;
+	packet.autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_item_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_item_int_send_struct(mavlink_channel_t chan, const mavlink_mission_item_int_t* mission_item_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_item_int_send(chan, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)mission_item_int, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_item_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param1);
+	_mav_put_float(buf, 4, param2);
+	_mav_put_float(buf, 8, param3);
+	_mav_put_float(buf, 12, param4);
+	_mav_put_int32_t(buf, 16, x);
+	_mav_put_int32_t(buf, 20, y);
+	_mav_put_float(buf, 24, z);
+	_mav_put_uint16_t(buf, 28, seq);
+	_mav_put_uint16_t(buf, 30, command);
+	_mav_put_uint8_t(buf, 32, target_system);
+	_mav_put_uint8_t(buf, 33, target_component);
+	_mav_put_uint8_t(buf, 34, frame);
+	_mav_put_uint8_t(buf, 35, current);
+	_mav_put_uint8_t(buf, 36, autocontinue);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+#else
+	mavlink_mission_item_int_t *packet = (mavlink_mission_item_int_t *)msgbuf;
+	packet->param1 = param1;
+	packet->param2 = param2;
+	packet->param3 = param3;
+	packet->param4 = param4;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->seq = seq;
+	packet->command = command;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->frame = frame;
+	packet->current = current;
+	packet->autocontinue = autocontinue;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_ITEM_INT UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_item_int message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  32);
+}
+
+/**
+ * @brief Get field target_component from mission_item_int message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  33);
+}
+
+/**
+ * @brief Get field seq from mission_item_int message
+ *
+ * @return Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
+ */
+static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field frame from mission_item_int message
+ *
+ * @return The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
+ */
+static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  34);
+}
+
+/**
+ * @brief Get field command from mission_item_int message
+ *
+ * @return The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
+ */
+static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  30);
+}
+
+/**
+ * @brief Get field current from mission_item_int message
+ *
+ * @return false:0, true:1
+ */
+static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  35);
+}
+
+/**
+ * @brief Get field autocontinue from mission_item_int message
+ *
+ * @return autocontinue to next wp
+ */
+static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field param1 from mission_item_int message
+ *
+ * @return PARAM1, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param2 from mission_item_int message
+ *
+ * @return PARAM2, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field param3 from mission_item_int message
+ *
+ * @return PARAM3, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field param4 from mission_item_int message
+ *
+ * @return PARAM4, see MAV_CMD enum
+ */
+static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field x from mission_item_int message
+ *
+ * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
+ */
+static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  16);
+}
+
+/**
+ * @brief Get field y from mission_item_int message
+ *
+ * @return PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
+ */
+static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  20);
+}
+
+/**
+ * @brief Get field z from mission_item_int message
+ *
+ * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
+ */
+static inline float mavlink_msg_mission_item_int_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Decode a mission_item_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_item_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_item_int_decode(const mavlink_message_t* msg, mavlink_mission_item_int_t* mission_item_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_item_int->param1 = mavlink_msg_mission_item_int_get_param1(msg);
+	mission_item_int->param2 = mavlink_msg_mission_item_int_get_param2(msg);
+	mission_item_int->param3 = mavlink_msg_mission_item_int_get_param3(msg);
+	mission_item_int->param4 = mavlink_msg_mission_item_int_get_param4(msg);
+	mission_item_int->x = mavlink_msg_mission_item_int_get_x(msg);
+	mission_item_int->y = mavlink_msg_mission_item_int_get_y(msg);
+	mission_item_int->z = mavlink_msg_mission_item_int_get_z(msg);
+	mission_item_int->seq = mavlink_msg_mission_item_int_get_seq(msg);
+	mission_item_int->command = mavlink_msg_mission_item_int_get_command(msg);
+	mission_item_int->target_system = mavlink_msg_mission_item_int_get_target_system(msg);
+	mission_item_int->target_component = mavlink_msg_mission_item_int_get_target_component(msg);
+	mission_item_int->frame = mavlink_msg_mission_item_int_get_frame(msg);
+	mission_item_int->current = mavlink_msg_mission_item_int_get_current(msg);
+	mission_item_int->autocontinue = mavlink_msg_mission_item_int_get_autocontinue(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN;
+        memset(mission_item_int, 0, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
+	memcpy(mission_item_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_reached.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_reached.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_item_reached.h	(revision 209)
@@ -0,0 +1,212 @@
+// MESSAGE MISSION_ITEM_REACHED PACKING
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46
+
+typedef struct MAVLINK_PACKED __mavlink_mission_item_reached_t
+{
+ uint16_t seq; /*< Sequence*/
+} mavlink_mission_item_reached_t;
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2
+#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN 2
+#define MAVLINK_MSG_ID_46_LEN 2
+#define MAVLINK_MSG_ID_46_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11
+#define MAVLINK_MSG_ID_46_CRC 11
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \
+	46, \
+	"MISSION_ITEM_REACHED", \
+	1, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \
+	"MISSION_ITEM_REACHED", \
+	1, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_item_reached message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
+#else
+	mavlink_mission_item_reached_t packet;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+}
+
+/**
+ * @brief Pack a mission_item_reached message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
+#else
+	mavlink_mission_item_reached_t packet;
+	packet.seq = seq;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+}
+
+/**
+ * @brief Encode a mission_item_reached struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item_reached C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
+{
+	return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq);
+}
+
+/**
+ * @brief Encode a mission_item_reached struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_item_reached C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
+{
+	return mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, chan, msg, mission_item_reached->seq);
+}
+
+/**
+ * @brief Send a mission_item_reached message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param seq Sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+#else
+	mavlink_mission_item_reached_t packet;
+	packet.seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_item_reached message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_item_reached_send_struct(mavlink_channel_t chan, const mavlink_mission_item_reached_t* mission_item_reached)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_item_reached_send(chan, mission_item_reached->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)mission_item_reached, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seq);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+#else
+	mavlink_mission_item_reached_t *packet = (mavlink_mission_item_reached_t *)msgbuf;
+	packet->seq = seq;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_ITEM_REACHED UNPACKING
+
+
+/**
+ * @brief Get field seq from mission_item_reached message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_item_reached message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_item_reached C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message_t* msg, mavlink_mission_item_reached_t* mission_item_reached)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN;
+        memset(mission_item_reached, 0, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
+	memcpy(mission_item_reached, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE MISSION_REQUEST PACKING
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST 40
+
+typedef struct MAVLINK_PACKED __mavlink_mission_request_t
+{
+ uint16_t seq; /*< Sequence*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_request_t;
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4
+#define MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN 4
+#define MAVLINK_MSG_ID_40_LEN 4
+#define MAVLINK_MSG_ID_40_MIN_LEN 4
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_CRC 230
+#define MAVLINK_MSG_ID_40_CRC 230
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \
+	40, \
+	"MISSION_REQUEST", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \
+	"MISSION_REQUEST", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_request message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
+#else
+	mavlink_mission_request_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+}
+
+/**
+ * @brief Pack a mission_request message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
+#else
+	mavlink_mission_request_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+}
+
+/**
+ * @brief Encode a mission_request struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request)
+{
+	return mavlink_msg_mission_request_pack(system_id, component_id, msg, mission_request->target_system, mission_request->target_component, mission_request->seq);
+}
+
+/**
+ * @brief Encode a mission_request struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request)
+{
+	return mavlink_msg_mission_request_pack_chan(system_id, component_id, chan, msg, mission_request->target_system, mission_request->target_component, mission_request->seq);
+}
+
+/**
+ * @brief Send a mission_request message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+#else
+	mavlink_mission_request_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_request message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_request_send_struct(mavlink_channel_t chan, const mavlink_mission_request_t* mission_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_request_send(chan, mission_request->target_system, mission_request->target_component, mission_request->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)mission_request, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+#else
+	mavlink_mission_request_t *packet = (mavlink_mission_request_t *)msgbuf;
+	packet->seq = seq;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_REQUEST UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_request message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from mission_request message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_request_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field seq from mission_request message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_request message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_request C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_request_decode(const mavlink_message_t* msg, mavlink_mission_request_t* mission_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_request->seq = mavlink_msg_mission_request_get_seq(msg);
+	mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg);
+	mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LEN;
+        memset(mission_request, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
+	memcpy(mission_request, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_int.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE MISSION_REQUEST_INT PACKING
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_INT 51
+
+typedef struct MAVLINK_PACKED __mavlink_mission_request_int_t
+{
+ uint16_t seq; /*< Sequence*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_request_int_t;
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN 4
+#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN 4
+#define MAVLINK_MSG_ID_51_LEN 4
+#define MAVLINK_MSG_ID_51_MIN_LEN 4
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC 196
+#define MAVLINK_MSG_ID_51_CRC 196
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \
+	51, \
+	"MISSION_REQUEST_INT", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \
+	"MISSION_REQUEST_INT", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_request_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
+#else
+	mavlink_mission_request_int_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+}
+
+/**
+ * @brief Pack a mission_request_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
+#else
+	mavlink_mission_request_int_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+}
+
+/**
+ * @brief Encode a mission_request_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int)
+{
+	return mavlink_msg_mission_request_int_pack(system_id, component_id, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq);
+}
+
+/**
+ * @brief Encode a mission_request_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int)
+{
+	return mavlink_msg_mission_request_int_pack_chan(system_id, component_id, chan, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq);
+}
+
+/**
+ * @brief Send a mission_request_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_request_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+#else
+	mavlink_mission_request_int_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_request_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_request_int_send_struct(mavlink_channel_t chan, const mavlink_mission_request_int_t* mission_request_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_request_int_send(chan, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)mission_request_int, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_request_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+#else
+	mavlink_mission_request_int_t *packet = (mavlink_mission_request_int_t *)msgbuf;
+	packet->seq = seq;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_REQUEST_INT UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_request_int message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from mission_request_int message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field seq from mission_request_int message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_request_int_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_request_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_request_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_request_int_decode(const mavlink_message_t* msg, mavlink_mission_request_int_t* mission_request_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_request_int->seq = mavlink_msg_mission_request_int_get_seq(msg);
+	mission_request_int->target_system = mavlink_msg_mission_request_int_get_target_system(msg);
+	mission_request_int->target_component = mavlink_msg_mission_request_int_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN;
+        memset(mission_request_int, 0, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
+	memcpy(mission_request_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_list.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_list.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_list.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE MISSION_REQUEST_LIST PACKING
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43
+
+typedef struct MAVLINK_PACKED __mavlink_mission_request_list_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_request_list_t;
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2
+#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN 2
+#define MAVLINK_MSG_ID_43_LEN 2
+#define MAVLINK_MSG_ID_43_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132
+#define MAVLINK_MSG_ID_43_CRC 132
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
+	43, \
+	"MISSION_REQUEST_LIST", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
+	"MISSION_REQUEST_LIST", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_request_list message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
+#else
+	mavlink_mission_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Pack a mission_request_list message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
+#else
+	mavlink_mission_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Encode a mission_request_list struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
+{
+	return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component);
+}
+
+/**
+ * @brief Encode a mission_request_list struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
+{
+	return mavlink_msg_mission_request_list_pack_chan(system_id, component_id, chan, msg, mission_request_list->target_system, mission_request_list->target_component);
+}
+
+/**
+ * @brief Send a mission_request_list message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+#else
+	mavlink_mission_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_request_list message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_request_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_list_t* mission_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_request_list_send(chan, mission_request_list->target_system, mission_request_list->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)mission_request_list, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+#else
+	mavlink_mission_request_list_t *packet = (mavlink_mission_request_list_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_REQUEST_LIST UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_request_list message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from mission_request_list message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a mission_request_list message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_request_list C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_request_list_decode(const mavlink_message_t* msg, mavlink_mission_request_list_t* mission_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg);
+	mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN;
+        memset(mission_request_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
+	memcpy(mission_request_list, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_partial_list.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_partial_list.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_request_partial_list.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37
+
+typedef struct MAVLINK_PACKED __mavlink_mission_request_partial_list_t
+{
+ int16_t start_index; /*< Start index, 0 by default*/
+ int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_request_partial_list_t;
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6
+#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN 6
+#define MAVLINK_MSG_ID_37_LEN 6
+#define MAVLINK_MSG_ID_37_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212
+#define MAVLINK_MSG_ID_37_CRC 212
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \
+	37, \
+	"MISSION_REQUEST_PARTIAL_LIST", \
+	4, \
+	{  { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \
+         { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \
+	"MISSION_REQUEST_PARTIAL_LIST", \
+	4, \
+	{  { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \
+         { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_request_partial_list message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default
+ * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
+#else
+	mavlink_mission_request_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+}
+
+/**
+ * @brief Pack a mission_request_partial_list message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default
+ * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
+#else
+	mavlink_mission_request_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+}
+
+/**
+ * @brief Encode a mission_request_partial_list struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_partial_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
+{
+	return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index);
+}
+
+/**
+ * @brief Encode a mission_request_partial_list struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_request_partial_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
+{
+	return mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, chan, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index);
+}
+
+/**
+ * @brief Send a mission_request_partial_list message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default
+ * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+#else
+	mavlink_mission_request_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_request_partial_list message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_request_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_request_partial_list_send(chan, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)mission_request_partial_list, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+#else
+	mavlink_mission_request_partial_list_t *packet = (mavlink_mission_request_partial_list_t *)msgbuf;
+	packet->start_index = start_index;
+	packet->end_index = end_index;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_REQUEST_PARTIAL_LIST UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_request_partial_list message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field target_component from mission_request_partial_list message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field start_index from mission_request_partial_list message
+ *
+ * @return Start index, 0 by default
+ */
+static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  0);
+}
+
+/**
+ * @brief Get field end_index from mission_request_partial_list message
+ *
+ * @return End index, -1 by default (-1: send list to end). Else a valid index of the list
+ */
+static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  2);
+}
+
+/**
+ * @brief Decode a mission_request_partial_list message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_request_partial_list C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_request_partial_list_t* mission_request_partial_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg);
+	mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg);
+	mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg);
+	mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN;
+        memset(mission_request_partial_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
+	memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_set_current.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_set_current.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_set_current.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE MISSION_SET_CURRENT PACKING
+
+#define MAVLINK_MSG_ID_MISSION_SET_CURRENT 41
+
+typedef struct MAVLINK_PACKED __mavlink_mission_set_current_t
+{
+ uint16_t seq; /*< Sequence*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_set_current_t;
+
+#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4
+#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN 4
+#define MAVLINK_MSG_ID_41_LEN 4
+#define MAVLINK_MSG_ID_41_MIN_LEN 4
+
+#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC 28
+#define MAVLINK_MSG_ID_41_CRC 28
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \
+	41, \
+	"MISSION_SET_CURRENT", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \
+	"MISSION_SET_CURRENT", \
+	3, \
+	{  { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_set_current message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
+#else
+	mavlink_mission_set_current_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+}
+
+/**
+ * @brief Pack a mission_set_current message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
+#else
+	mavlink_mission_set_current_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+}
+
+/**
+ * @brief Encode a mission_set_current struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_set_current C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current)
+{
+	return mavlink_msg_mission_set_current_pack(system_id, component_id, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
+}
+
+/**
+ * @brief Encode a mission_set_current struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_set_current C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_set_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current)
+{
+	return mavlink_msg_mission_set_current_pack_chan(system_id, component_id, chan, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
+}
+
+/**
+ * @brief Send a mission_set_current message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param seq Sequence
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+#else
+	mavlink_mission_set_current_t packet;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_set_current message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_set_current_send_struct(mavlink_channel_t chan, const mavlink_mission_set_current_t* mission_set_current)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_set_current_send(chan, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)mission_set_current, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_set_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t seq)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, seq);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+#else
+	mavlink_mission_set_current_t *packet = (mavlink_mission_set_current_t *)msgbuf;
+	packet->seq = seq;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_SET_CURRENT UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_set_current message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from mission_set_current message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field seq from mission_set_current message
+ *
+ * @return Sequence
+ */
+static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a mission_set_current message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_set_current C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_set_current_decode(const mavlink_message_t* msg, mavlink_mission_set_current_t* mission_set_current)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_set_current->seq = mavlink_msg_mission_set_current_get_seq(msg);
+	mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg);
+	mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN;
+        memset(mission_set_current, 0, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
+	memcpy(mission_set_current, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_write_partial_list.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_write_partial_list.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_mission_write_partial_list.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE MISSION_WRITE_PARTIAL_LIST PACKING
+
+#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38
+
+typedef struct MAVLINK_PACKED __mavlink_mission_write_partial_list_t
+{
+ int16_t start_index; /*< Start index, 0 by default and smaller / equal to the largest index of the current onboard list.*/
+ int16_t end_index; /*< End index, equal or greater than start index.*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_mission_write_partial_list_t;
+
+#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6
+#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN 6
+#define MAVLINK_MSG_ID_38_LEN 6
+#define MAVLINK_MSG_ID_38_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9
+#define MAVLINK_MSG_ID_38_CRC 9
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \
+	38, \
+	"MISSION_WRITE_PARTIAL_LIST", \
+	4, \
+	{  { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \
+         { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \
+	"MISSION_WRITE_PARTIAL_LIST", \
+	4, \
+	{  { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \
+         { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a mission_write_partial_list message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
+ * @param end_index End index, equal or greater than start index.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
+#else
+	mavlink_mission_write_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+}
+
+/**
+ * @brief Pack a mission_write_partial_list message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
+ * @param end_index End index, equal or greater than start index.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
+#else
+	mavlink_mission_write_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+}
+
+/**
+ * @brief Encode a mission_write_partial_list struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_write_partial_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
+{
+	return mavlink_msg_mission_write_partial_list_pack(system_id, component_id, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index);
+}
+
+/**
+ * @brief Encode a mission_write_partial_list struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param mission_write_partial_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
+{
+	return mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, chan, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index);
+}
+
+/**
+ * @brief Send a mission_write_partial_list message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
+ * @param end_index End index, equal or greater than start index.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+#else
+	mavlink_mission_write_partial_list_t packet;
+	packet.start_index = start_index;
+	packet.end_index = end_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a mission_write_partial_list message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_mission_write_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_mission_write_partial_list_send(chan, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)mission_write_partial_list, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int16_t(buf, 0, start_index);
+	_mav_put_int16_t(buf, 2, end_index);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+#else
+	mavlink_mission_write_partial_list_t *packet = (mavlink_mission_write_partial_list_t *)msgbuf;
+	packet->start_index = start_index;
+	packet->end_index = end_index;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE MISSION_WRITE_PARTIAL_LIST UNPACKING
+
+
+/**
+ * @brief Get field target_system from mission_write_partial_list message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field target_component from mission_write_partial_list message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field start_index from mission_write_partial_list message
+ *
+ * @return Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
+ */
+static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  0);
+}
+
+/**
+ * @brief Get field end_index from mission_write_partial_list message
+ *
+ * @return End index, equal or greater than start index.
+ */
+static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  2);
+}
+
+/**
+ * @brief Decode a mission_write_partial_list message into a struct
+ *
+ * @param msg The message to decode
+ * @param mission_write_partial_list C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_mission_write_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_write_partial_list_t* mission_write_partial_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	mission_write_partial_list->start_index = mavlink_msg_mission_write_partial_list_get_start_index(msg);
+	mission_write_partial_list->end_index = mavlink_msg_mission_write_partial_list_get_end_index(msg);
+	mission_write_partial_list->target_system = mavlink_msg_mission_write_partial_list_get_target_system(msg);
+	mission_write_partial_list->target_component = mavlink_msg_mission_write_partial_list_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN;
+        memset(mission_write_partial_list, 0, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
+	memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_float.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_float.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_float.h	(revision 209)
@@ -0,0 +1,254 @@
+// MESSAGE NAMED_VALUE_FLOAT PACKING
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251
+
+typedef struct MAVLINK_PACKED __mavlink_named_value_float_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float value; /*< Floating point value*/
+ char name[10]; /*< Name of the debug variable*/
+} mavlink_named_value_float_t;
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18
+#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN 18
+#define MAVLINK_MSG_ID_251_LEN 18
+#define MAVLINK_MSG_ID_251_MIN_LEN 18
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC 170
+#define MAVLINK_MSG_ID_251_CRC 170
+
+#define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \
+	251, \
+	"NAMED_VALUE_FLOAT", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \
+	"NAMED_VALUE_FLOAT", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a named_value_float message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Floating point value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, const char *name, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
+#else
+	mavlink_named_value_float_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+}
+
+/**
+ * @brief Pack a named_value_float message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Floating point value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,const char *name,float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
+#else
+	mavlink_named_value_float_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+}
+
+/**
+ * @brief Encode a named_value_float struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param named_value_float C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float)
+{
+	return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
+}
+
+/**
+ * @brief Encode a named_value_float struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param named_value_float C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_named_value_float_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float)
+{
+	return mavlink_msg_named_value_float_pack_chan(system_id, component_id, chan, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
+}
+
+/**
+ * @brief Send a named_value_float message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Floating point value
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+#else
+	mavlink_named_value_float_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a named_value_float message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_named_value_float_send_struct(mavlink_channel_t chan, const mavlink_named_value_float_t* named_value_float)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_named_value_float_send(chan, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)named_value_float, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_named_value_float_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, const char *name, float value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+#else
+	mavlink_named_value_float_t *packet = (mavlink_named_value_float_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->value = value;
+	mav_array_memcpy(packet->name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE NAMED_VALUE_FLOAT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from named_value_float message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field name from named_value_float message
+ *
+ * @return Name of the debug variable
+ */
+static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name)
+{
+	return _MAV_RETURN_char_array(msg, name, 10,  8);
+}
+
+/**
+ * @brief Get field value from named_value_float message
+ *
+ * @return Floating point value
+ */
+static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Decode a named_value_float message into a struct
+ *
+ * @param msg The message to decode
+ * @param named_value_float C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* msg, mavlink_named_value_float_t* named_value_float)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	named_value_float->time_boot_ms = mavlink_msg_named_value_float_get_time_boot_ms(msg);
+	named_value_float->value = mavlink_msg_named_value_float_get_value(msg);
+	mavlink_msg_named_value_float_get_name(msg, named_value_float->name);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN;
+        memset(named_value_float, 0, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
+	memcpy(named_value_float, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_named_value_int.h	(revision 209)
@@ -0,0 +1,254 @@
+// MESSAGE NAMED_VALUE_INT PACKING
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_INT 252
+
+typedef struct MAVLINK_PACKED __mavlink_named_value_int_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int32_t value; /*< Signed integer value*/
+ char name[10]; /*< Name of the debug variable*/
+} mavlink_named_value_int_t;
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18
+#define MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN 18
+#define MAVLINK_MSG_ID_252_LEN 18
+#define MAVLINK_MSG_ID_252_MIN_LEN 18
+
+#define MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC 44
+#define MAVLINK_MSG_ID_252_CRC 44
+
+#define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \
+	252, \
+	"NAMED_VALUE_INT", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \
+	"NAMED_VALUE_INT", \
+	3, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \
+         { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \
+         { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a named_value_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Signed integer value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, const char *name, int32_t value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
+#else
+	mavlink_named_value_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+}
+
+/**
+ * @brief Pack a named_value_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Signed integer value
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,const char *name,int32_t value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
+#else
+	mavlink_named_value_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+}
+
+/**
+ * @brief Encode a named_value_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param named_value_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int)
+{
+	return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
+}
+
+/**
+ * @brief Encode a named_value_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param named_value_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_named_value_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int)
+{
+	return mavlink_msg_named_value_int_pack_chan(system_id, component_id, chan, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
+}
+
+/**
+ * @brief Send a named_value_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param name Name of the debug variable
+ * @param value Signed integer value
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+#else
+	mavlink_named_value_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.value = value;
+	mav_array_memcpy(packet.name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a named_value_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_named_value_int_send_struct(mavlink_channel_t chan, const mavlink_named_value_int_t* named_value_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_named_value_int_send(chan, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)named_value_int, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_named_value_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, const char *name, int32_t value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, value);
+	_mav_put_char_array(buf, 8, name, 10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+#else
+	mavlink_named_value_int_t *packet = (mavlink_named_value_int_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->value = value;
+	mav_array_memcpy(packet->name, name, sizeof(char)*10);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE NAMED_VALUE_INT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from named_value_int message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field name from named_value_int message
+ *
+ * @return Name of the debug variable
+ */
+static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name)
+{
+	return _MAV_RETURN_char_array(msg, name, 10,  8);
+}
+
+/**
+ * @brief Get field value from named_value_int message
+ *
+ * @return Signed integer value
+ */
+static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Decode a named_value_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param named_value_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* msg, mavlink_named_value_int_t* named_value_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	named_value_int->time_boot_ms = mavlink_msg_named_value_int_get_time_boot_ms(msg);
+	named_value_int->value = mavlink_msg_named_value_int_get_value(msg);
+	mavlink_msg_named_value_int_get_name(msg, named_value_int->name);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN;
+        memset(named_value_int, 0, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
+	memcpy(named_value_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_nav_controller_output.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_nav_controller_output.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_nav_controller_output.h	(revision 209)
@@ -0,0 +1,387 @@
+// MESSAGE NAV_CONTROLLER_OUTPUT PACKING
+
+#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62
+
+typedef struct MAVLINK_PACKED __mavlink_nav_controller_output_t
+{
+ float nav_roll; /*< Current desired roll in degrees*/
+ float nav_pitch; /*< Current desired pitch in degrees*/
+ float alt_error; /*< Current altitude error in meters*/
+ float aspd_error; /*< Current airspeed error in meters/second*/
+ float xtrack_error; /*< Current crosstrack error on x-y plane in meters*/
+ int16_t nav_bearing; /*< Current desired heading in degrees*/
+ int16_t target_bearing; /*< Bearing to current MISSION/target in degrees*/
+ uint16_t wp_dist; /*< Distance to active MISSION in meters*/
+} mavlink_nav_controller_output_t;
+
+#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26
+#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN 26
+#define MAVLINK_MSG_ID_62_LEN 26
+#define MAVLINK_MSG_ID_62_MIN_LEN 26
+
+#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC 183
+#define MAVLINK_MSG_ID_62_CRC 183
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \
+	62, \
+	"NAV_CONTROLLER_OUTPUT", \
+	8, \
+	{  { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \
+         { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \
+         { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \
+         { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \
+         { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \
+         { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \
+         { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \
+         { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \
+	"NAV_CONTROLLER_OUTPUT", \
+	8, \
+	{  { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \
+         { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \
+         { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \
+         { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \
+         { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \
+         { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \
+         { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \
+         { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a nav_controller_output message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param nav_roll Current desired roll in degrees
+ * @param nav_pitch Current desired pitch in degrees
+ * @param nav_bearing Current desired heading in degrees
+ * @param target_bearing Bearing to current MISSION/target in degrees
+ * @param wp_dist Distance to active MISSION in meters
+ * @param alt_error Current altitude error in meters
+ * @param aspd_error Current airspeed error in meters/second
+ * @param xtrack_error Current crosstrack error on x-y plane in meters
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
+	_mav_put_float(buf, 0, nav_roll);
+	_mav_put_float(buf, 4, nav_pitch);
+	_mav_put_float(buf, 8, alt_error);
+	_mav_put_float(buf, 12, aspd_error);
+	_mav_put_float(buf, 16, xtrack_error);
+	_mav_put_int16_t(buf, 20, nav_bearing);
+	_mav_put_int16_t(buf, 22, target_bearing);
+	_mav_put_uint16_t(buf, 24, wp_dist);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
+#else
+	mavlink_nav_controller_output_t packet;
+	packet.nav_roll = nav_roll;
+	packet.nav_pitch = nav_pitch;
+	packet.alt_error = alt_error;
+	packet.aspd_error = aspd_error;
+	packet.xtrack_error = xtrack_error;
+	packet.nav_bearing = nav_bearing;
+	packet.target_bearing = target_bearing;
+	packet.wp_dist = wp_dist;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+}
+
+/**
+ * @brief Pack a nav_controller_output message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param nav_roll Current desired roll in degrees
+ * @param nav_pitch Current desired pitch in degrees
+ * @param nav_bearing Current desired heading in degrees
+ * @param target_bearing Bearing to current MISSION/target in degrees
+ * @param wp_dist Distance to active MISSION in meters
+ * @param alt_error Current altitude error in meters
+ * @param aspd_error Current airspeed error in meters/second
+ * @param xtrack_error Current crosstrack error on x-y plane in meters
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
+	_mav_put_float(buf, 0, nav_roll);
+	_mav_put_float(buf, 4, nav_pitch);
+	_mav_put_float(buf, 8, alt_error);
+	_mav_put_float(buf, 12, aspd_error);
+	_mav_put_float(buf, 16, xtrack_error);
+	_mav_put_int16_t(buf, 20, nav_bearing);
+	_mav_put_int16_t(buf, 22, target_bearing);
+	_mav_put_uint16_t(buf, 24, wp_dist);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
+#else
+	mavlink_nav_controller_output_t packet;
+	packet.nav_roll = nav_roll;
+	packet.nav_pitch = nav_pitch;
+	packet.alt_error = alt_error;
+	packet.aspd_error = aspd_error;
+	packet.xtrack_error = xtrack_error;
+	packet.nav_bearing = nav_bearing;
+	packet.target_bearing = target_bearing;
+	packet.wp_dist = wp_dist;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+}
+
+/**
+ * @brief Encode a nav_controller_output struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param nav_controller_output C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output)
+{
+	return mavlink_msg_nav_controller_output_pack(system_id, component_id, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
+}
+
+/**
+ * @brief Encode a nav_controller_output struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param nav_controller_output C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_nav_controller_output_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output)
+{
+	return mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, chan, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
+}
+
+/**
+ * @brief Send a nav_controller_output message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param nav_roll Current desired roll in degrees
+ * @param nav_pitch Current desired pitch in degrees
+ * @param nav_bearing Current desired heading in degrees
+ * @param target_bearing Bearing to current MISSION/target in degrees
+ * @param wp_dist Distance to active MISSION in meters
+ * @param alt_error Current altitude error in meters
+ * @param aspd_error Current airspeed error in meters/second
+ * @param xtrack_error Current crosstrack error on x-y plane in meters
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
+	_mav_put_float(buf, 0, nav_roll);
+	_mav_put_float(buf, 4, nav_pitch);
+	_mav_put_float(buf, 8, alt_error);
+	_mav_put_float(buf, 12, aspd_error);
+	_mav_put_float(buf, 16, xtrack_error);
+	_mav_put_int16_t(buf, 20, nav_bearing);
+	_mav_put_int16_t(buf, 22, target_bearing);
+	_mav_put_uint16_t(buf, 24, wp_dist);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+#else
+	mavlink_nav_controller_output_t packet;
+	packet.nav_roll = nav_roll;
+	packet.nav_pitch = nav_pitch;
+	packet.alt_error = alt_error;
+	packet.aspd_error = aspd_error;
+	packet.xtrack_error = xtrack_error;
+	packet.nav_bearing = nav_bearing;
+	packet.target_bearing = target_bearing;
+	packet.wp_dist = wp_dist;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a nav_controller_output message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_nav_controller_output_send_struct(mavlink_channel_t chan, const mavlink_nav_controller_output_t* nav_controller_output)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_nav_controller_output_send(chan, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)nav_controller_output, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_nav_controller_output_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, nav_roll);
+	_mav_put_float(buf, 4, nav_pitch);
+	_mav_put_float(buf, 8, alt_error);
+	_mav_put_float(buf, 12, aspd_error);
+	_mav_put_float(buf, 16, xtrack_error);
+	_mav_put_int16_t(buf, 20, nav_bearing);
+	_mav_put_int16_t(buf, 22, target_bearing);
+	_mav_put_uint16_t(buf, 24, wp_dist);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+#else
+	mavlink_nav_controller_output_t *packet = (mavlink_nav_controller_output_t *)msgbuf;
+	packet->nav_roll = nav_roll;
+	packet->nav_pitch = nav_pitch;
+	packet->alt_error = alt_error;
+	packet->aspd_error = aspd_error;
+	packet->xtrack_error = xtrack_error;
+	packet->nav_bearing = nav_bearing;
+	packet->target_bearing = target_bearing;
+	packet->wp_dist = wp_dist;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE NAV_CONTROLLER_OUTPUT UNPACKING
+
+
+/**
+ * @brief Get field nav_roll from nav_controller_output message
+ *
+ * @return Current desired roll in degrees
+ */
+static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field nav_pitch from nav_controller_output message
+ *
+ * @return Current desired pitch in degrees
+ */
+static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field nav_bearing from nav_controller_output message
+ *
+ * @return Current desired heading in degrees
+ */
+static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Get field target_bearing from nav_controller_output message
+ *
+ * @return Bearing to current MISSION/target in degrees
+ */
+static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  22);
+}
+
+/**
+ * @brief Get field wp_dist from nav_controller_output message
+ *
+ * @return Distance to active MISSION in meters
+ */
+static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field alt_error from nav_controller_output message
+ *
+ * @return Current altitude error in meters
+ */
+static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field aspd_error from nav_controller_output message
+ *
+ * @return Current airspeed error in meters/second
+ */
+static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field xtrack_error from nav_controller_output message
+ *
+ * @return Current crosstrack error on x-y plane in meters
+ */
+static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Decode a nav_controller_output message into a struct
+ *
+ * @param msg The message to decode
+ * @param nav_controller_output C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_nav_controller_output_decode(const mavlink_message_t* msg, mavlink_nav_controller_output_t* nav_controller_output)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	nav_controller_output->nav_roll = mavlink_msg_nav_controller_output_get_nav_roll(msg);
+	nav_controller_output->nav_pitch = mavlink_msg_nav_controller_output_get_nav_pitch(msg);
+	nav_controller_output->alt_error = mavlink_msg_nav_controller_output_get_alt_error(msg);
+	nav_controller_output->aspd_error = mavlink_msg_nav_controller_output_get_aspd_error(msg);
+	nav_controller_output->xtrack_error = mavlink_msg_nav_controller_output_get_xtrack_error(msg);
+	nav_controller_output->nav_bearing = mavlink_msg_nav_controller_output_get_nav_bearing(msg);
+	nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg);
+	nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN? msg->len : MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN;
+        memset(nav_controller_output, 0, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
+	memcpy(nav_controller_output, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow.h	(revision 209)
@@ -0,0 +1,387 @@
+// MESSAGE OPTICAL_FLOW PACKING
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW 100
+
+typedef struct MAVLINK_PACKED __mavlink_optical_flow_t
+{
+ uint64_t time_usec; /*< Timestamp (UNIX)*/
+ float flow_comp_m_x; /*< Flow in meters in x-sensor direction, angular-speed compensated*/
+ float flow_comp_m_y; /*< Flow in meters in y-sensor direction, angular-speed compensated*/
+ float ground_distance; /*< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance*/
+ int16_t flow_x; /*< Flow in pixels * 10 in x-sensor direction (dezi-pixels)*/
+ int16_t flow_y; /*< Flow in pixels * 10 in y-sensor direction (dezi-pixels)*/
+ uint8_t sensor_id; /*< Sensor ID*/
+ uint8_t quality; /*< Optical flow quality / confidence. 0: bad, 255: maximum quality*/
+} mavlink_optical_flow_t;
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN 26
+#define MAVLINK_MSG_ID_100_LEN 26
+#define MAVLINK_MSG_ID_100_MIN_LEN 26
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175
+#define MAVLINK_MSG_ID_100_CRC 175
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
+	100, \
+	"OPTICAL_FLOW", \
+	8, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
+         { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
+         { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
+         { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
+         { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
+         { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
+	"OPTICAL_FLOW", \
+	8, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
+         { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
+         { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
+         { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
+         { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
+         { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a optical_flow message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (UNIX)
+ * @param sensor_id Sensor ID
+ * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels)
+ * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels)
+ * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
+ * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
+ * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
+ * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, flow_comp_m_x);
+	_mav_put_float(buf, 12, flow_comp_m_y);
+	_mav_put_float(buf, 16, ground_distance);
+	_mav_put_int16_t(buf, 20, flow_x);
+	_mav_put_int16_t(buf, 22, flow_y);
+	_mav_put_uint8_t(buf, 24, sensor_id);
+	_mav_put_uint8_t(buf, 25, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
+#else
+	mavlink_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.flow_comp_m_x = flow_comp_m_x;
+	packet.flow_comp_m_y = flow_comp_m_y;
+	packet.ground_distance = ground_distance;
+	packet.flow_x = flow_x;
+	packet.flow_y = flow_y;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+}
+
+/**
+ * @brief Pack a optical_flow message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (UNIX)
+ * @param sensor_id Sensor ID
+ * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels)
+ * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels)
+ * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
+ * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
+ * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
+ * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, flow_comp_m_x);
+	_mav_put_float(buf, 12, flow_comp_m_y);
+	_mav_put_float(buf, 16, ground_distance);
+	_mav_put_int16_t(buf, 20, flow_x);
+	_mav_put_int16_t(buf, 22, flow_y);
+	_mav_put_uint8_t(buf, 24, sensor_id);
+	_mav_put_uint8_t(buf, 25, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
+#else
+	mavlink_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.flow_comp_m_x = flow_comp_m_x;
+	packet.flow_comp_m_y = flow_comp_m_y;
+	packet.ground_distance = ground_distance;
+	packet.flow_x = flow_x;
+	packet.flow_y = flow_y;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+}
+
+/**
+ * @brief Encode a optical_flow struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param optical_flow C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
+{
+	return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance);
+}
+
+/**
+ * @brief Encode a optical_flow struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param optical_flow C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
+{
+	return mavlink_msg_optical_flow_pack_chan(system_id, component_id, chan, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance);
+}
+
+/**
+ * @brief Send a optical_flow message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (UNIX)
+ * @param sensor_id Sensor ID
+ * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels)
+ * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels)
+ * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
+ * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
+ * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
+ * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, flow_comp_m_x);
+	_mav_put_float(buf, 12, flow_comp_m_y);
+	_mav_put_float(buf, 16, ground_distance);
+	_mav_put_int16_t(buf, 20, flow_x);
+	_mav_put_int16_t(buf, 22, flow_y);
+	_mav_put_uint8_t(buf, 24, sensor_id);
+	_mav_put_uint8_t(buf, 25, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+#else
+	mavlink_optical_flow_t packet;
+	packet.time_usec = time_usec;
+	packet.flow_comp_m_x = flow_comp_m_x;
+	packet.flow_comp_m_y = flow_comp_m_y;
+	packet.ground_distance = ground_distance;
+	packet.flow_x = flow_x;
+	packet.flow_y = flow_y;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a optical_flow message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_t* optical_flow)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_optical_flow_send(chan, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)optical_flow, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, flow_comp_m_x);
+	_mav_put_float(buf, 12, flow_comp_m_y);
+	_mav_put_float(buf, 16, ground_distance);
+	_mav_put_int16_t(buf, 20, flow_x);
+	_mav_put_int16_t(buf, 22, flow_y);
+	_mav_put_uint8_t(buf, 24, sensor_id);
+	_mav_put_uint8_t(buf, 25, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+#else
+	mavlink_optical_flow_t *packet = (mavlink_optical_flow_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->flow_comp_m_x = flow_comp_m_x;
+	packet->flow_comp_m_y = flow_comp_m_y;
+	packet->ground_distance = ground_distance;
+	packet->flow_x = flow_x;
+	packet->flow_y = flow_y;
+	packet->sensor_id = sensor_id;
+	packet->quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE OPTICAL_FLOW UNPACKING
+
+
+/**
+ * @brief Get field time_usec from optical_flow message
+ *
+ * @return Timestamp (UNIX)
+ */
+static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field sensor_id from optical_flow message
+ *
+ * @return Sensor ID
+ */
+static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  24);
+}
+
+/**
+ * @brief Get field flow_x from optical_flow message
+ *
+ * @return Flow in pixels * 10 in x-sensor direction (dezi-pixels)
+ */
+static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Get field flow_y from optical_flow message
+ *
+ * @return Flow in pixels * 10 in y-sensor direction (dezi-pixels)
+ */
+static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  22);
+}
+
+/**
+ * @brief Get field flow_comp_m_x from optical_flow message
+ *
+ * @return Flow in meters in x-sensor direction, angular-speed compensated
+ */
+static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field flow_comp_m_y from optical_flow message
+ *
+ * @return Flow in meters in y-sensor direction, angular-speed compensated
+ */
+static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field quality from optical_flow message
+ *
+ * @return Optical flow quality / confidence. 0: bad, 255: maximum quality
+ */
+static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  25);
+}
+
+/**
+ * @brief Get field ground_distance from optical_flow message
+ *
+ * @return Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
+ */
+static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Decode a optical_flow message into a struct
+ *
+ * @param msg The message to decode
+ * @param optical_flow C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, mavlink_optical_flow_t* optical_flow)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg);
+	optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg);
+	optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg);
+	optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg);
+	optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg);
+	optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg);
+	optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg);
+	optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_LEN;
+        memset(optical_flow, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
+	memcpy(optical_flow, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow_rad.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow_rad.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_optical_flow_rad.h	(revision 209)
@@ -0,0 +1,487 @@
+// MESSAGE OPTICAL_FLOW_RAD PACKING
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD 106
+
+typedef struct MAVLINK_PACKED __mavlink_optical_flow_rad_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/
+ float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/
+ float integrated_y; /*< Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/
+ float integrated_xgyro; /*< RH rotation around X axis (rad)*/
+ float integrated_ygyro; /*< RH rotation around Y axis (rad)*/
+ float integrated_zgyro; /*< RH rotation around Z axis (rad)*/
+ uint32_t time_delta_distance_us; /*< Time in microseconds since the distance was sampled.*/
+ float distance; /*< Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.*/
+ int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/
+ uint8_t sensor_id; /*< Sensor ID*/
+ uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/
+} mavlink_optical_flow_rad_t;
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN 44
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN 44
+#define MAVLINK_MSG_ID_106_LEN 44
+#define MAVLINK_MSG_ID_106_MIN_LEN 44
+
+#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC 138
+#define MAVLINK_MSG_ID_106_CRC 138
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \
+	106, \
+	"OPTICAL_FLOW_RAD", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \
+         { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \
+         { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \
+         { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \
+         { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \
+         { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \
+         { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \
+         { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \
+	"OPTICAL_FLOW_RAD", \
+	12, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \
+         { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \
+         { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \
+         { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \
+         { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \
+         { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \
+         { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \
+         { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \
+         { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \
+         { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \
+         { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a optical_flow_rad message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
+#else
+	mavlink_optical_flow_rad_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+}
+
+/**
+ * @brief Pack a optical_flow_rad message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_optical_flow_rad_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
+#else
+	mavlink_optical_flow_rad_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+}
+
+/**
+ * @brief Encode a optical_flow_rad struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param optical_flow_rad C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_optical_flow_rad_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad)
+{
+	return mavlink_msg_optical_flow_rad_pack(system_id, component_id, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
+}
+
+/**
+ * @brief Encode a optical_flow_rad struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param optical_flow_rad C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_optical_flow_rad_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad)
+{
+	return mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, chan, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
+}
+
+/**
+ * @brief Send a optical_flow_rad message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param sensor_id Sensor ID
+ * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ * @param integrated_xgyro RH rotation around X axis (rad)
+ * @param integrated_ygyro RH rotation around Y axis (rad)
+ * @param integrated_zgyro RH rotation around Z axis (rad)
+ * @param temperature Temperature * 100 in centi-degrees Celsius
+ * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ * @param time_delta_distance_us Time in microseconds since the distance was sampled.
+ * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_optical_flow_rad_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+#else
+	mavlink_optical_flow_rad_t packet;
+	packet.time_usec = time_usec;
+	packet.integration_time_us = integration_time_us;
+	packet.integrated_x = integrated_x;
+	packet.integrated_y = integrated_y;
+	packet.integrated_xgyro = integrated_xgyro;
+	packet.integrated_ygyro = integrated_ygyro;
+	packet.integrated_zgyro = integrated_zgyro;
+	packet.time_delta_distance_us = time_delta_distance_us;
+	packet.distance = distance;
+	packet.temperature = temperature;
+	packet.sensor_id = sensor_id;
+	packet.quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+#endif
+}
+
+/**
+ * @brief Send a optical_flow_rad message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_optical_flow_rad_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_rad_t* optical_flow_rad)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_optical_flow_rad_send(chan, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)optical_flow_rad, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_optical_flow_rad_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, integration_time_us);
+	_mav_put_float(buf, 12, integrated_x);
+	_mav_put_float(buf, 16, integrated_y);
+	_mav_put_float(buf, 20, integrated_xgyro);
+	_mav_put_float(buf, 24, integrated_ygyro);
+	_mav_put_float(buf, 28, integrated_zgyro);
+	_mav_put_uint32_t(buf, 32, time_delta_distance_us);
+	_mav_put_float(buf, 36, distance);
+	_mav_put_int16_t(buf, 40, temperature);
+	_mav_put_uint8_t(buf, 42, sensor_id);
+	_mav_put_uint8_t(buf, 43, quality);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+#else
+	mavlink_optical_flow_rad_t *packet = (mavlink_optical_flow_rad_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->integration_time_us = integration_time_us;
+	packet->integrated_x = integrated_x;
+	packet->integrated_y = integrated_y;
+	packet->integrated_xgyro = integrated_xgyro;
+	packet->integrated_ygyro = integrated_ygyro;
+	packet->integrated_zgyro = integrated_zgyro;
+	packet->time_delta_distance_us = time_delta_distance_us;
+	packet->distance = distance;
+	packet->temperature = temperature;
+	packet->sensor_id = sensor_id;
+	packet->quality = quality;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE OPTICAL_FLOW_RAD UNPACKING
+
+
+/**
+ * @brief Get field time_usec from optical_flow_rad message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field sensor_id from optical_flow_rad message
+ *
+ * @return Sensor ID
+ */
+static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  42);
+}
+
+/**
+ * @brief Get field integration_time_us from optical_flow_rad message
+ *
+ * @return Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
+ */
+static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field integrated_x from optical_flow_rad message
+ *
+ * @return Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
+ */
+static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field integrated_y from optical_flow_rad message
+ *
+ * @return Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
+ */
+static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field integrated_xgyro from optical_flow_rad message
+ *
+ * @return RH rotation around X axis (rad)
+ */
+static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field integrated_ygyro from optical_flow_rad message
+ *
+ * @return RH rotation around Y axis (rad)
+ */
+static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field integrated_zgyro from optical_flow_rad message
+ *
+ * @return RH rotation around Z axis (rad)
+ */
+static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field temperature from optical_flow_rad message
+ *
+ * @return Temperature * 100 in centi-degrees Celsius
+ */
+static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  40);
+}
+
+/**
+ * @brief Get field quality from optical_flow_rad message
+ *
+ * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
+ */
+static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  43);
+}
+
+/**
+ * @brief Get field time_delta_distance_us from optical_flow_rad message
+ *
+ * @return Time in microseconds since the distance was sampled.
+ */
+static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  32);
+}
+
+/**
+ * @brief Get field distance from optical_flow_rad message
+ *
+ * @return Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.
+ */
+static inline float mavlink_msg_optical_flow_rad_get_distance(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Decode a optical_flow_rad message into a struct
+ *
+ * @param msg The message to decode
+ * @param optical_flow_rad C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_optical_flow_rad_decode(const mavlink_message_t* msg, mavlink_optical_flow_rad_t* optical_flow_rad)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	optical_flow_rad->time_usec = mavlink_msg_optical_flow_rad_get_time_usec(msg);
+	optical_flow_rad->integration_time_us = mavlink_msg_optical_flow_rad_get_integration_time_us(msg);
+	optical_flow_rad->integrated_x = mavlink_msg_optical_flow_rad_get_integrated_x(msg);
+	optical_flow_rad->integrated_y = mavlink_msg_optical_flow_rad_get_integrated_y(msg);
+	optical_flow_rad->integrated_xgyro = mavlink_msg_optical_flow_rad_get_integrated_xgyro(msg);
+	optical_flow_rad->integrated_ygyro = mavlink_msg_optical_flow_rad_get_integrated_ygyro(msg);
+	optical_flow_rad->integrated_zgyro = mavlink_msg_optical_flow_rad_get_integrated_zgyro(msg);
+	optical_flow_rad->time_delta_distance_us = mavlink_msg_optical_flow_rad_get_time_delta_distance_us(msg);
+	optical_flow_rad->distance = mavlink_msg_optical_flow_rad_get_distance(msg);
+	optical_flow_rad->temperature = mavlink_msg_optical_flow_rad_get_temperature(msg);
+	optical_flow_rad->sensor_id = mavlink_msg_optical_flow_rad_get_sensor_id(msg);
+	optical_flow_rad->quality = mavlink_msg_optical_flow_rad_get_quality(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN;
+        memset(optical_flow_rad, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
+	memcpy(optical_flow_rad, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_map_rc.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_map_rc.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_map_rc.h	(revision 209)
@@ -0,0 +1,404 @@
+// MESSAGE PARAM_MAP_RC PACKING
+
+#define MAVLINK_MSG_ID_PARAM_MAP_RC 50
+
+typedef struct MAVLINK_PACKED __mavlink_param_map_rc_t
+{
+ float param_value0; /*< Initial parameter value*/
+ float scale; /*< Scale, maps the RC range [-1, 1] to a parameter value*/
+ float param_value_min; /*< Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)*/
+ float param_value_max; /*< Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)*/
+ int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/
+ uint8_t parameter_rc_channel_index; /*< Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.*/
+} mavlink_param_map_rc_t;
+
+#define MAVLINK_MSG_ID_PARAM_MAP_RC_LEN 37
+#define MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN 37
+#define MAVLINK_MSG_ID_50_LEN 37
+#define MAVLINK_MSG_ID_50_MIN_LEN 37
+
+#define MAVLINK_MSG_ID_PARAM_MAP_RC_CRC 78
+#define MAVLINK_MSG_ID_50_CRC 78
+
+#define MAVLINK_MSG_PARAM_MAP_RC_FIELD_PARAM_ID_LEN 16
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC { \
+	50, \
+	"PARAM_MAP_RC", \
+	9, \
+	{  { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \
+         { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \
+         { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \
+         { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \
+         { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \
+         { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC { \
+	"PARAM_MAP_RC", \
+	9, \
+	{  { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \
+         { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \
+         { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \
+         { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \
+         { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \
+         { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a param_map_rc message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
+ * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.
+ * @param param_value0 Initial parameter value
+ * @param scale Scale, maps the RC range [-1, 1] to a parameter value
+ * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
+ * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN];
+	_mav_put_float(buf, 0, param_value0);
+	_mav_put_float(buf, 4, scale);
+	_mav_put_float(buf, 8, param_value_min);
+	_mav_put_float(buf, 12, param_value_max);
+	_mav_put_int16_t(buf, 16, param_index);
+	_mav_put_uint8_t(buf, 18, target_system);
+	_mav_put_uint8_t(buf, 19, target_component);
+	_mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
+	_mav_put_char_array(buf, 20, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
+#else
+	mavlink_param_map_rc_t packet;
+	packet.param_value0 = param_value0;
+	packet.scale = scale;
+	packet.param_value_min = param_value_min;
+	packet.param_value_max = param_value_max;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.parameter_rc_channel_index = parameter_rc_channel_index;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+}
+
+/**
+ * @brief Pack a param_map_rc message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
+ * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.
+ * @param param_value0 Initial parameter value
+ * @param scale Scale, maps the RC range [-1, 1] to a parameter value
+ * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
+ * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_map_rc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index,uint8_t parameter_rc_channel_index,float param_value0,float scale,float param_value_min,float param_value_max)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN];
+	_mav_put_float(buf, 0, param_value0);
+	_mav_put_float(buf, 4, scale);
+	_mav_put_float(buf, 8, param_value_min);
+	_mav_put_float(buf, 12, param_value_max);
+	_mav_put_int16_t(buf, 16, param_index);
+	_mav_put_uint8_t(buf, 18, target_system);
+	_mav_put_uint8_t(buf, 19, target_component);
+	_mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
+	_mav_put_char_array(buf, 20, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
+#else
+	mavlink_param_map_rc_t packet;
+	packet.param_value0 = param_value0;
+	packet.scale = scale;
+	packet.param_value_min = param_value_min;
+	packet.param_value_max = param_value_max;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.parameter_rc_channel_index = parameter_rc_channel_index;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+}
+
+/**
+ * @brief Encode a param_map_rc struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param param_map_rc C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_map_rc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc)
+{
+	return mavlink_msg_param_map_rc_pack(system_id, component_id, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
+}
+
+/**
+ * @brief Encode a param_map_rc struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_map_rc C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_map_rc_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc)
+{
+	return mavlink_msg_param_map_rc_pack_chan(system_id, component_id, chan, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
+}
+
+/**
+ * @brief Send a param_map_rc message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
+ * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.
+ * @param param_value0 Initial parameter value
+ * @param scale Scale, maps the RC range [-1, 1] to a parameter value
+ * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
+ * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_param_map_rc_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN];
+	_mav_put_float(buf, 0, param_value0);
+	_mav_put_float(buf, 4, scale);
+	_mav_put_float(buf, 8, param_value_min);
+	_mav_put_float(buf, 12, param_value_max);
+	_mav_put_int16_t(buf, 16, param_index);
+	_mav_put_uint8_t(buf, 18, target_system);
+	_mav_put_uint8_t(buf, 19, target_component);
+	_mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
+	_mav_put_char_array(buf, 20, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+#else
+	mavlink_param_map_rc_t packet;
+	packet.param_value0 = param_value0;
+	packet.scale = scale;
+	packet.param_value_min = param_value_min;
+	packet.param_value_max = param_value_max;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.parameter_rc_channel_index = parameter_rc_channel_index;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)&packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+#endif
+}
+
+/**
+ * @brief Send a param_map_rc message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_param_map_rc_send_struct(mavlink_channel_t chan, const mavlink_param_map_rc_t* param_map_rc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_param_map_rc_send(chan, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)param_map_rc, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PARAM_MAP_RC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_param_map_rc_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param_value0);
+	_mav_put_float(buf, 4, scale);
+	_mav_put_float(buf, 8, param_value_min);
+	_mav_put_float(buf, 12, param_value_max);
+	_mav_put_int16_t(buf, 16, param_index);
+	_mav_put_uint8_t(buf, 18, target_system);
+	_mav_put_uint8_t(buf, 19, target_component);
+	_mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
+	_mav_put_char_array(buf, 20, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+#else
+	mavlink_param_map_rc_t *packet = (mavlink_param_map_rc_t *)msgbuf;
+	packet->param_value0 = param_value0;
+	packet->scale = scale;
+	packet->param_value_min = param_value_min;
+	packet->param_value_max = param_value_max;
+	packet->param_index = param_index;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->parameter_rc_channel_index = parameter_rc_channel_index;
+	mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PARAM_MAP_RC UNPACKING
+
+
+/**
+ * @brief Get field target_system from param_map_rc message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  18);
+}
+
+/**
+ * @brief Get field target_component from param_map_rc message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  19);
+}
+
+/**
+ * @brief Get field param_id from param_map_rc message
+ *
+ * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ */
+static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_message_t* msg, char *param_id)
+{
+	return _MAV_RETURN_char_array(msg, param_id, 16,  20);
+}
+
+/**
+ * @brief Get field param_index from param_map_rc message
+ *
+ * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
+ */
+static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field parameter_rc_channel_index from param_map_rc message
+ *
+ * @return Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.
+ */
+static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field param_value0 from param_map_rc message
+ *
+ * @return Initial parameter value
+ */
+static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field scale from param_map_rc message
+ *
+ * @return Scale, maps the RC range [-1, 1] to a parameter value
+ */
+static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field param_value_min from param_map_rc message
+ *
+ * @return Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
+ */
+static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field param_value_max from param_map_rc message
+ *
+ * @return Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
+ */
+static inline float mavlink_msg_param_map_rc_get_param_value_max(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Decode a param_map_rc message into a struct
+ *
+ * @param msg The message to decode
+ * @param param_map_rc C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_param_map_rc_decode(const mavlink_message_t* msg, mavlink_param_map_rc_t* param_map_rc)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	param_map_rc->param_value0 = mavlink_msg_param_map_rc_get_param_value0(msg);
+	param_map_rc->scale = mavlink_msg_param_map_rc_get_scale(msg);
+	param_map_rc->param_value_min = mavlink_msg_param_map_rc_get_param_value_min(msg);
+	param_map_rc->param_value_max = mavlink_msg_param_map_rc_get_param_value_max(msg);
+	param_map_rc->param_index = mavlink_msg_param_map_rc_get_param_index(msg);
+	param_map_rc->target_system = mavlink_msg_param_map_rc_get_target_system(msg);
+	param_map_rc->target_component = mavlink_msg_param_map_rc_get_target_component(msg);
+	mavlink_msg_param_map_rc_get_param_id(msg, param_map_rc->param_id);
+	param_map_rc->parameter_rc_channel_index = mavlink_msg_param_map_rc_get_parameter_rc_channel_index(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_MAP_RC_LEN? msg->len : MAVLINK_MSG_ID_PARAM_MAP_RC_LEN;
+        memset(param_map_rc, 0, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
+	memcpy(param_map_rc, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_list.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_list.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_list.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE PARAM_REQUEST_LIST PACKING
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21
+
+typedef struct MAVLINK_PACKED __mavlink_param_request_list_t
+{
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_param_request_list_t;
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2
+#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN 2
+#define MAVLINK_MSG_ID_21_LEN 2
+#define MAVLINK_MSG_ID_21_MIN_LEN 2
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC 159
+#define MAVLINK_MSG_ID_21_CRC 159
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \
+	21, \
+	"PARAM_REQUEST_LIST", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \
+	"PARAM_REQUEST_LIST", \
+	2, \
+	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a param_request_list message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN);
+#else
+	mavlink_param_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Pack a param_request_list message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN);
+#else
+	mavlink_param_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+}
+
+/**
+ * @brief Encode a param_request_list struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param param_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list)
+{
+	return mavlink_msg_param_request_list_pack(system_id, component_id, msg, param_request_list->target_system, param_request_list->target_component);
+}
+
+/**
+ * @brief Encode a param_request_list struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_request_list C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list)
+{
+	return mavlink_msg_param_request_list_pack_chan(system_id, component_id, chan, msg, param_request_list->target_system, param_request_list->target_component);
+}
+
+/**
+ * @brief Send a param_request_list message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN];
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+#else
+	mavlink_param_request_list_t packet;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a param_request_list message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_param_request_list_send_struct(mavlink_channel_t chan, const mavlink_param_request_list_t* param_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_param_request_list_send(chan, param_request_list->target_system, param_request_list->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)param_request_list, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_param_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, target_system);
+	_mav_put_uint8_t(buf, 1, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+#else
+	mavlink_param_request_list_t *packet = (mavlink_param_request_list_t *)msgbuf;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PARAM_REQUEST_LIST UNPACKING
+
+
+/**
+ * @brief Get field target_system from param_request_list message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_component from param_request_list message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_param_request_list_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Decode a param_request_list message into a struct
+ *
+ * @param msg The message to decode
+ * @param param_request_list C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_param_request_list_decode(const mavlink_message_t* msg, mavlink_param_request_list_t* param_request_list)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg);
+	param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN;
+        memset(param_request_list, 0, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN);
+	memcpy(param_request_list, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_read.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_read.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_request_read.h	(revision 209)
@@ -0,0 +1,279 @@
+// MESSAGE PARAM_REQUEST_READ PACKING
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_READ 20
+
+typedef struct MAVLINK_PACKED __mavlink_param_request_read_t
+{
+ int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/
+} mavlink_param_request_read_t;
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20
+#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN 20
+#define MAVLINK_MSG_ID_20_LEN 20
+#define MAVLINK_MSG_ID_20_MIN_LEN 20
+
+#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC 214
+#define MAVLINK_MSG_ID_20_CRC 214
+
+#define MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN 16
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \
+	20, \
+	"PARAM_REQUEST_READ", \
+	4, \
+	{  { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \
+	"PARAM_REQUEST_READ", \
+	4, \
+	{  { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a param_request_read message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN];
+	_mav_put_int16_t(buf, 0, param_index);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_char_array(buf, 4, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN);
+#else
+	mavlink_param_request_read_t packet;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+}
+
+/**
+ * @brief Pack a param_request_read message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN];
+	_mav_put_int16_t(buf, 0, param_index);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_char_array(buf, 4, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN);
+#else
+	mavlink_param_request_read_t packet;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+}
+
+/**
+ * @brief Encode a param_request_read struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param param_request_read C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_read_t* param_request_read)
+{
+	return mavlink_msg_param_request_read_pack(system_id, component_id, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index);
+}
+
+/**
+ * @brief Encode a param_request_read struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_request_read C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_request_read_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_request_read_t* param_request_read)
+{
+	return mavlink_msg_param_request_read_pack_chan(system_id, component_id, chan, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index);
+}
+
+/**
+ * @brief Send a param_request_read message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_param_request_read_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN];
+	_mav_put_int16_t(buf, 0, param_index);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_char_array(buf, 4, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+#else
+	mavlink_param_request_read_t packet;
+	packet.param_index = param_index;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+#endif
+}
+
+/**
+ * @brief Send a param_request_read message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_param_request_read_send_struct(mavlink_channel_t chan, const mavlink_param_request_read_t* param_request_read)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_param_request_read_send(chan, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)param_request_read, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_param_request_read_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int16_t(buf, 0, param_index);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_char_array(buf, 4, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+#else
+	mavlink_param_request_read_t *packet = (mavlink_param_request_read_t *)msgbuf;
+	packet->param_index = param_index;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PARAM_REQUEST_READ UNPACKING
+
+
+/**
+ * @brief Get field target_system from param_request_read message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from param_request_read message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_param_request_read_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field param_id from param_request_read message
+ *
+ * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ */
+static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, char *param_id)
+{
+	return _MAV_RETURN_char_array(msg, param_id, 16,  4);
+}
+
+/**
+ * @brief Get field param_index from param_request_read message
+ *
+ * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
+ */
+static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  0);
+}
+
+/**
+ * @brief Decode a param_request_read message into a struct
+ *
+ * @param msg The message to decode
+ * @param param_request_read C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_param_request_read_decode(const mavlink_message_t* msg, mavlink_param_request_read_t* param_request_read)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	param_request_read->param_index = mavlink_msg_param_request_read_get_param_index(msg);
+	param_request_read->target_system = mavlink_msg_param_request_read_get_target_system(msg);
+	param_request_read->target_component = mavlink_msg_param_request_read_get_target_component(msg);
+	mavlink_msg_param_request_read_get_param_id(msg, param_request_read->param_id);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN? msg->len : MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN;
+        memset(param_request_read, 0, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN);
+	memcpy(param_request_read, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_set.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_set.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_set.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE PARAM_SET PACKING
+
+#define MAVLINK_MSG_ID_PARAM_SET 23
+
+typedef struct MAVLINK_PACKED __mavlink_param_set_t
+{
+ float param_value; /*< Onboard parameter value*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/
+ uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/
+} mavlink_param_set_t;
+
+#define MAVLINK_MSG_ID_PARAM_SET_LEN 23
+#define MAVLINK_MSG_ID_PARAM_SET_MIN_LEN 23
+#define MAVLINK_MSG_ID_23_LEN 23
+#define MAVLINK_MSG_ID_23_MIN_LEN 23
+
+#define MAVLINK_MSG_ID_PARAM_SET_CRC 168
+#define MAVLINK_MSG_ID_23_CRC 168
+
+#define MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN 16
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PARAM_SET { \
+	23, \
+	"PARAM_SET", \
+	5, \
+	{  { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \
+         { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PARAM_SET { \
+	"PARAM_SET", \
+	5, \
+	{  { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \
+         { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a param_set message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_SET_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+	_mav_put_uint8_t(buf, 22, param_type);
+	_mav_put_char_array(buf, 6, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN);
+#else
+	mavlink_param_set_t packet;
+	packet.param_value = param_value;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+}
+
+/**
+ * @brief Pack a param_set message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,const char *param_id,float param_value,uint8_t param_type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_SET_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+	_mav_put_uint8_t(buf, 22, param_type);
+	_mav_put_char_array(buf, 6, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN);
+#else
+	mavlink_param_set_t packet;
+	packet.param_value = param_value;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+}
+
+/**
+ * @brief Encode a param_set struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param param_set C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_set_t* param_set)
+{
+	return mavlink_msg_param_set_pack(system_id, component_id, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type);
+}
+
+/**
+ * @brief Encode a param_set struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_set C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_set_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_set_t* param_set)
+{
+	return mavlink_msg_param_set_pack_chan(system_id, component_id, chan, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type);
+}
+
+/**
+ * @brief Send a param_set message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_SET_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+	_mav_put_uint8_t(buf, 22, param_type);
+	_mav_put_char_array(buf, 6, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+#else
+	mavlink_param_set_t packet;
+	packet.param_value = param_value;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a param_set message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_param_set_send_struct(mavlink_channel_t chan, const mavlink_param_set_t* param_set)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_param_set_send(chan, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)param_set, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PARAM_SET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_param_set_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, target_component);
+	_mav_put_uint8_t(buf, 22, param_type);
+	_mav_put_char_array(buf, 6, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+#else
+	mavlink_param_set_t *packet = (mavlink_param_set_t *)msgbuf;
+	packet->param_value = param_value;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->param_type = param_type;
+	mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)packet, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PARAM_SET UNPACKING
+
+
+/**
+ * @brief Get field target_system from param_set message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field target_component from param_set message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field param_id from param_set message
+ *
+ * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ */
+static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, char *param_id)
+{
+	return _MAV_RETURN_char_array(msg, param_id, 16,  6);
+}
+
+/**
+ * @brief Get field param_value from param_set message
+ *
+ * @return Onboard parameter value
+ */
+static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param_type from param_set message
+ *
+ * @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ */
+static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  22);
+}
+
+/**
+ * @brief Decode a param_set message into a struct
+ *
+ * @param msg The message to decode
+ * @param param_set C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_param_set_decode(const mavlink_message_t* msg, mavlink_param_set_t* param_set)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	param_set->param_value = mavlink_msg_param_set_get_param_value(msg);
+	param_set->target_system = mavlink_msg_param_set_get_target_system(msg);
+	param_set->target_component = mavlink_msg_param_set_get_target_component(msg);
+	mavlink_msg_param_set_get_param_id(msg, param_set->param_id);
+	param_set->param_type = mavlink_msg_param_set_get_param_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_SET_LEN? msg->len : MAVLINK_MSG_ID_PARAM_SET_LEN;
+        memset(param_set, 0, MAVLINK_MSG_ID_PARAM_SET_LEN);
+	memcpy(param_set, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_value.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_value.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_param_value.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE PARAM_VALUE PACKING
+
+#define MAVLINK_MSG_ID_PARAM_VALUE 22
+
+typedef struct MAVLINK_PACKED __mavlink_param_value_t
+{
+ float param_value; /*< Onboard parameter value*/
+ uint16_t param_count; /*< Total number of onboard parameters*/
+ uint16_t param_index; /*< Index of this onboard parameter*/
+ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/
+ uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/
+} mavlink_param_value_t;
+
+#define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25
+#define MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN 25
+#define MAVLINK_MSG_ID_22_LEN 25
+#define MAVLINK_MSG_ID_22_MIN_LEN 25
+
+#define MAVLINK_MSG_ID_PARAM_VALUE_CRC 220
+#define MAVLINK_MSG_ID_22_CRC 220
+
+#define MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN 16
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \
+	22, \
+	"PARAM_VALUE", \
+	5, \
+	{  { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \
+         { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \
+         { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \
+         { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \
+	"PARAM_VALUE", \
+	5, \
+	{  { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \
+         { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \
+         { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \
+         { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \
+         { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a param_value message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ * @param param_count Total number of onboard parameters
+ * @param param_index Index of this onboard parameter
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint16_t(buf, 4, param_count);
+	_mav_put_uint16_t(buf, 6, param_index);
+	_mav_put_uint8_t(buf, 24, param_type);
+	_mav_put_char_array(buf, 8, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN);
+#else
+	mavlink_param_value_t packet;
+	packet.param_value = param_value;
+	packet.param_count = param_count;
+	packet.param_index = param_index;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+}
+
+/**
+ * @brief Pack a param_value message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ * @param param_count Total number of onboard parameters
+ * @param param_index Index of this onboard parameter
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           const char *param_id,float param_value,uint8_t param_type,uint16_t param_count,uint16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint16_t(buf, 4, param_count);
+	_mav_put_uint16_t(buf, 6, param_index);
+	_mav_put_uint8_t(buf, 24, param_type);
+	_mav_put_char_array(buf, 8, param_id, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN);
+#else
+	mavlink_param_value_t packet;
+	packet.param_value = param_value;
+	packet.param_count = param_count;
+	packet.param_index = param_index;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+}
+
+/**
+ * @brief Encode a param_value struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param param_value C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_value_t* param_value)
+{
+	return mavlink_msg_param_value_pack(system_id, component_id, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index);
+}
+
+/**
+ * @brief Encode a param_value struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param param_value C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_param_value_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_value_t* param_value)
+{
+	return mavlink_msg_param_value_pack_chan(system_id, component_id, chan, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index);
+}
+
+/**
+ * @brief Send a param_value message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ * @param param_value Onboard parameter value
+ * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ * @param param_count Total number of onboard parameters
+ * @param param_index Index of this onboard parameter
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN];
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint16_t(buf, 4, param_count);
+	_mav_put_uint16_t(buf, 6, param_index);
+	_mav_put_uint8_t(buf, 24, param_type);
+	_mav_put_char_array(buf, 8, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+#else
+	mavlink_param_value_t packet;
+	packet.param_value = param_value;
+	packet.param_count = param_count;
+	packet.param_index = param_index;
+	packet.param_type = param_type;
+	mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a param_value message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_param_value_send_struct(mavlink_channel_t chan, const mavlink_param_value_t* param_value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_param_value_send(chan, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)param_value, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PARAM_VALUE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_param_value_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, param_value);
+	_mav_put_uint16_t(buf, 4, param_count);
+	_mav_put_uint16_t(buf, 6, param_index);
+	_mav_put_uint8_t(buf, 24, param_type);
+	_mav_put_char_array(buf, 8, param_id, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+#else
+	mavlink_param_value_t *packet = (mavlink_param_value_t *)msgbuf;
+	packet->param_value = param_value;
+	packet->param_count = param_count;
+	packet->param_index = param_index;
+	packet->param_type = param_type;
+	mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)packet, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PARAM_VALUE UNPACKING
+
+
+/**
+ * @brief Get field param_id from param_value message
+ *
+ * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
+ */
+static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, char *param_id)
+{
+	return _MAV_RETURN_char_array(msg, param_id, 16,  8);
+}
+
+/**
+ * @brief Get field param_value from param_value message
+ *
+ * @return Onboard parameter value
+ */
+static inline float mavlink_msg_param_value_get_param_value(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field param_type from param_value message
+ *
+ * @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
+ */
+static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  24);
+}
+
+/**
+ * @brief Get field param_count from param_value message
+ *
+ * @return Total number of onboard parameters
+ */
+static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field param_index from param_value message
+ *
+ * @return Index of this onboard parameter
+ */
+static inline uint16_t mavlink_msg_param_value_get_param_index(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Decode a param_value message into a struct
+ *
+ * @param msg The message to decode
+ * @param param_value C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_param_value_decode(const mavlink_message_t* msg, mavlink_param_value_t* param_value)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	param_value->param_value = mavlink_msg_param_value_get_param_value(msg);
+	param_value->param_count = mavlink_msg_param_value_get_param_count(msg);
+	param_value->param_index = mavlink_msg_param_value_get_param_index(msg);
+	mavlink_msg_param_value_get_param_id(msg, param_value->param_id);
+	param_value->param_type = mavlink_msg_param_value_get_param_type(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_VALUE_LEN? msg->len : MAVLINK_MSG_ID_PARAM_VALUE_LEN;
+        memset(param_value, 0, MAVLINK_MSG_ID_PARAM_VALUE_LEN);
+	memcpy(param_value, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_ping.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_ping.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_ping.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE PING PACKING
+
+#define MAVLINK_MSG_ID_PING 4
+
+typedef struct MAVLINK_PACKED __mavlink_ping_t
+{
+ uint64_t time_usec; /*< Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)*/
+ uint32_t seq; /*< PING sequence*/
+ uint8_t target_system; /*< 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system*/
+ uint8_t target_component; /*< 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system*/
+} mavlink_ping_t;
+
+#define MAVLINK_MSG_ID_PING_LEN 14
+#define MAVLINK_MSG_ID_PING_MIN_LEN 14
+#define MAVLINK_MSG_ID_4_LEN 14
+#define MAVLINK_MSG_ID_4_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_PING_CRC 237
+#define MAVLINK_MSG_ID_4_CRC 237
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_PING { \
+	4, \
+	"PING", \
+	4, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_ping_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_ping_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_ping_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_PING { \
+	"PING", \
+	4, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \
+         { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_ping_t, seq) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_ping_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_ping_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a ping message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)
+ * @param seq PING sequence
+ * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system
+ * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PING_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+	_mav_put_uint8_t(buf, 12, target_system);
+	_mav_put_uint8_t(buf, 13, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN);
+#else
+	mavlink_ping_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PING;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+}
+
+/**
+ * @brief Pack a ping message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)
+ * @param seq PING sequence
+ * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system
+ * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint32_t seq,uint8_t target_system,uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PING_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+	_mav_put_uint8_t(buf, 12, target_system);
+	_mav_put_uint8_t(buf, 13, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN);
+#else
+	mavlink_ping_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_PING;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+}
+
+/**
+ * @brief Encode a ping struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param ping C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ping_t* ping)
+{
+	return mavlink_msg_ping_pack(system_id, component_id, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component);
+}
+
+/**
+ * @brief Encode a ping struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param ping C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_ping_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ping_t* ping)
+{
+	return mavlink_msg_ping_pack_chan(system_id, component_id, chan, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component);
+}
+
+/**
+ * @brief Send a ping message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)
+ * @param seq PING sequence
+ * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system
+ * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_PING_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+	_mav_put_uint8_t(buf, 12, target_system);
+	_mav_put_uint8_t(buf, 13, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+#else
+	mavlink_ping_t packet;
+	packet.time_usec = time_usec;
+	packet.seq = seq;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+#endif
+}
+
+/**
+ * @brief Send a ping message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_ping_send_struct(mavlink_channel_t chan, const mavlink_ping_t* ping)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_ping_send(chan, ping->time_usec, ping->seq, ping->target_system, ping->target_component);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)ping, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_PING_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_ping_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint32_t(buf, 8, seq);
+	_mav_put_uint8_t(buf, 12, target_system);
+	_mav_put_uint8_t(buf, 13, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+#else
+	mavlink_ping_t *packet = (mavlink_ping_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->seq = seq;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)packet, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE PING UNPACKING
+
+
+/**
+ * @brief Get field time_usec from ping message
+ *
+ * @return Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)
+ */
+static inline uint64_t mavlink_msg_ping_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field seq from ping message
+ *
+ * @return PING sequence
+ */
+static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field target_system from ping message
+ *
+ * @return 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system
+ */
+static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  12);
+}
+
+/**
+ * @brief Get field target_component from ping message
+ *
+ * @return 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system
+ */
+static inline uint8_t mavlink_msg_ping_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  13);
+}
+
+/**
+ * @brief Decode a ping message into a struct
+ *
+ * @param msg The message to decode
+ * @param ping C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_ping_decode(const mavlink_message_t* msg, mavlink_ping_t* ping)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	ping->time_usec = mavlink_msg_ping_get_time_usec(msg);
+	ping->seq = mavlink_msg_ping_get_seq(msg);
+	ping->target_system = mavlink_msg_ping_get_target_system(msg);
+	ping->target_component = mavlink_msg_ping_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_PING_LEN? msg->len : MAVLINK_MSG_ID_PING_LEN;
+        memset(ping, 0, MAVLINK_MSG_ID_PING_LEN);
+	memcpy(ping, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_global_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_global_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_global_int.h	(revision 209)
@@ -0,0 +1,537 @@
+// MESSAGE POSITION_TARGET_GLOBAL_INT PACKING
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87
+
+typedef struct MAVLINK_PACKED __mavlink_position_target_global_int_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/
+ int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/
+ int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/
+ float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/
+ float vx; /*< X velocity in NED frame in meter / s*/
+ float vy; /*< Y velocity in NED frame in meter / s*/
+ float vz; /*< Z velocity in NED frame in meter / s*/
+ float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float yaw; /*< yaw setpoint in rad*/
+ float yaw_rate; /*< yaw rate setpoint in rad/s*/
+ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
+ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/
+} mavlink_position_target_global_int_t;
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51
+#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN 51
+#define MAVLINK_MSG_ID_87_LEN 51
+#define MAVLINK_MSG_ID_87_MIN_LEN 51
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC 150
+#define MAVLINK_MSG_ID_87_CRC 150
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \
+	87, \
+	"POSITION_TARGET_GLOBAL_INT", \
+	14, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \
+         { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \
+         { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \
+	"POSITION_TARGET_GLOBAL_INT", \
+	14, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \
+         { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \
+         { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a position_target_global_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
+#else
+	mavlink_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+}
+
+/**
+ * @brief Pack a position_target_global_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
+#else
+	mavlink_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+}
+
+/**
+ * @brief Encode a position_target_global_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param position_target_global_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
+{
+	return mavlink_msg_position_target_global_int_pack(system_id, component_id, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
+}
+
+/**
+ * @brief Encode a position_target_global_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param position_target_global_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
+{
+	return mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, chan, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
+}
+
+/**
+ * @brief Send a position_target_global_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+#else
+	mavlink_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a position_target_global_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_position_target_global_int_t* position_target_global_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_position_target_global_int_send(chan, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)position_target_global_int, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+#else
+	mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->lat_int = lat_int;
+	packet->lon_int = lon_int;
+	packet->alt = alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->afx = afx;
+	packet->afy = afy;
+	packet->afz = afz;
+	packet->yaw = yaw;
+	packet->yaw_rate = yaw_rate;
+	packet->type_mask = type_mask;
+	packet->coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE POSITION_TARGET_GLOBAL_INT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from position_target_global_int message
+ *
+ * @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ */
+static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field coordinate_frame from position_target_global_int message
+ *
+ * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ */
+static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  50);
+}
+
+/**
+ * @brief Get field type_mask from position_target_global_int message
+ *
+ * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ */
+static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  48);
+}
+
+/**
+ * @brief Get field lat_int from position_target_global_int message
+ *
+ * @return X Position in WGS84 frame in 1e7 * meters
+ */
+static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field lon_int from position_target_global_int message
+ *
+ * @return Y Position in WGS84 frame in 1e7 * meters
+ */
+static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field alt from position_target_global_int message
+ *
+ * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ */
+static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vx from position_target_global_int message
+ *
+ * @return X velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field vy from position_target_global_int message
+ *
+ * @return Y velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vz from position_target_global_int message
+ *
+ * @return Z velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field afx from position_target_global_int message
+ *
+ * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field afy from position_target_global_int message
+ *
+ * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field afz from position_target_global_int message
+ *
+ * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field yaw from position_target_global_int message
+ *
+ * @return yaw setpoint in rad
+ */
+static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field yaw_rate from position_target_global_int message
+ *
+ * @return yaw rate setpoint in rad/s
+ */
+static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Decode a position_target_global_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param position_target_global_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg);
+	position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg);
+	position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg);
+	position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg);
+	position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg);
+	position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg);
+	position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg);
+	position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg);
+	position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg);
+	position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg);
+	position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg);
+	position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg);
+	position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg);
+	position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN;
+        memset(position_target_global_int, 0, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
+	memcpy(position_target_global_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_local_ned.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_local_ned.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_position_target_local_ned.h	(revision 209)
@@ -0,0 +1,537 @@
+// MESSAGE POSITION_TARGET_LOCAL_NED PACKING
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED 85
+
+typedef struct MAVLINK_PACKED __mavlink_position_target_local_ned_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
+ float x; /*< X Position in NED frame in meters*/
+ float y; /*< Y Position in NED frame in meters*/
+ float z; /*< Z Position in NED frame in meters (note, altitude is negative in NED)*/
+ float vx; /*< X velocity in NED frame in meter / s*/
+ float vy; /*< Y velocity in NED frame in meter / s*/
+ float vz; /*< Z velocity in NED frame in meter / s*/
+ float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float yaw; /*< yaw setpoint in rad*/
+ float yaw_rate; /*< yaw rate setpoint in rad/s*/
+ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
+ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/
+} mavlink_position_target_local_ned_t;
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN 51
+#define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN 51
+#define MAVLINK_MSG_ID_85_LEN 51
+#define MAVLINK_MSG_ID_85_MIN_LEN 51
+
+#define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC 140
+#define MAVLINK_MSG_ID_85_CRC 140
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \
+	85, \
+	"POSITION_TARGET_LOCAL_NED", \
+	14, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_local_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_local_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_local_ned_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_local_ned_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_local_ned_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \
+	"POSITION_TARGET_LOCAL_NED", \
+	14, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_local_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_local_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_local_ned_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_local_ned_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_local_ned_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a position_target_local_ned message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
+#else
+	mavlink_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+}
+
+/**
+ * @brief Pack a position_target_local_ned message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
+#else
+	mavlink_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+}
+
+/**
+ * @brief Encode a position_target_local_ned struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param position_target_local_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned)
+{
+	return mavlink_msg_position_target_local_ned_pack(system_id, component_id, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
+}
+
+/**
+ * @brief Encode a position_target_local_ned struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param position_target_local_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned)
+{
+	return mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
+}
+
+/**
+ * @brief Send a position_target_local_ned message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_position_target_local_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+#else
+	mavlink_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+
+/**
+ * @brief Send a position_target_local_ned message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_position_target_local_ned_t* position_target_local_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_position_target_local_ned_send(chan, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)position_target_local_ned, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_position_target_local_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+#else
+	mavlink_position_target_local_ned_t *packet = (mavlink_position_target_local_ned_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->afx = afx;
+	packet->afy = afy;
+	packet->afz = afz;
+	packet->yaw = yaw;
+	packet->yaw_rate = yaw_rate;
+	packet->type_mask = type_mask;
+	packet->coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE POSITION_TARGET_LOCAL_NED UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from position_target_local_ned message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field coordinate_frame from position_target_local_ned message
+ *
+ * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ */
+static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  50);
+}
+
+/**
+ * @brief Get field type_mask from position_target_local_ned message
+ *
+ * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ */
+static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  48);
+}
+
+/**
+ * @brief Get field x from position_target_local_ned message
+ *
+ * @return X Position in NED frame in meters
+ */
+static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field y from position_target_local_ned message
+ *
+ * @return Y Position in NED frame in meters
+ */
+static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field z from position_target_local_ned message
+ *
+ * @return Z Position in NED frame in meters (note, altitude is negative in NED)
+ */
+static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vx from position_target_local_ned message
+ *
+ * @return X velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field vy from position_target_local_ned message
+ *
+ * @return Y velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vz from position_target_local_ned message
+ *
+ * @return Z velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field afx from position_target_local_ned message
+ *
+ * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field afy from position_target_local_ned message
+ *
+ * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field afz from position_target_local_ned message
+ *
+ * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field yaw from position_target_local_ned message
+ *
+ * @return yaw setpoint in rad
+ */
+static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field yaw_rate from position_target_local_ned message
+ *
+ * @return yaw rate setpoint in rad/s
+ */
+static inline float mavlink_msg_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Decode a position_target_local_ned message into a struct
+ *
+ * @param msg The message to decode
+ * @param position_target_local_ned C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_position_target_local_ned_t* position_target_local_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	position_target_local_ned->time_boot_ms = mavlink_msg_position_target_local_ned_get_time_boot_ms(msg);
+	position_target_local_ned->x = mavlink_msg_position_target_local_ned_get_x(msg);
+	position_target_local_ned->y = mavlink_msg_position_target_local_ned_get_y(msg);
+	position_target_local_ned->z = mavlink_msg_position_target_local_ned_get_z(msg);
+	position_target_local_ned->vx = mavlink_msg_position_target_local_ned_get_vx(msg);
+	position_target_local_ned->vy = mavlink_msg_position_target_local_ned_get_vy(msg);
+	position_target_local_ned->vz = mavlink_msg_position_target_local_ned_get_vz(msg);
+	position_target_local_ned->afx = mavlink_msg_position_target_local_ned_get_afx(msg);
+	position_target_local_ned->afy = mavlink_msg_position_target_local_ned_get_afy(msg);
+	position_target_local_ned->afz = mavlink_msg_position_target_local_ned_get_afz(msg);
+	position_target_local_ned->yaw = mavlink_msg_position_target_local_ned_get_yaw(msg);
+	position_target_local_ned->yaw_rate = mavlink_msg_position_target_local_ned_get_yaw_rate(msg);
+	position_target_local_ned->type_mask = mavlink_msg_position_target_local_ned_get_type_mask(msg);
+	position_target_local_ned->coordinate_frame = mavlink_msg_position_target_local_ned_get_coordinate_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN;
+        memset(position_target_local_ned, 0, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
+	memcpy(position_target_local_ned, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_power_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_power_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_power_status.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE POWER_STATUS PACKING
+
+#define MAVLINK_MSG_ID_POWER_STATUS 125
+
+typedef struct MAVLINK_PACKED __mavlink_power_status_t
+{
+ uint16_t Vcc; /*< 5V rail voltage in millivolts*/
+ uint16_t Vservo; /*< servo rail voltage in millivolts*/
+ uint16_t flags; /*< power supply status flags (see MAV_POWER_STATUS enum)*/
+} mavlink_power_status_t;
+
+#define MAVLINK_MSG_ID_POWER_STATUS_LEN 6
+#define MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN 6
+#define MAVLINK_MSG_ID_125_LEN 6
+#define MAVLINK_MSG_ID_125_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_POWER_STATUS_CRC 203
+#define MAVLINK_MSG_ID_125_CRC 203
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_POWER_STATUS { \
+	125, \
+	"POWER_STATUS", \
+	3, \
+	{  { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_power_status_t, Vcc) }, \
+         { "Vservo", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_power_status_t, Vservo) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_power_status_t, flags) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_POWER_STATUS { \
+	"POWER_STATUS", \
+	3, \
+	{  { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_power_status_t, Vcc) }, \
+         { "Vservo", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_power_status_t, Vservo) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_power_status_t, flags) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a power_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param Vcc 5V rail voltage in millivolts
+ * @param Vservo servo rail voltage in millivolts
+ * @param flags power supply status flags (see MAV_POWER_STATUS enum)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_power_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint16_t Vcc, uint16_t Vservo, uint16_t flags)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, Vcc);
+	_mav_put_uint16_t(buf, 2, Vservo);
+	_mav_put_uint16_t(buf, 4, flags);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POWER_STATUS_LEN);
+#else
+	mavlink_power_status_t packet;
+	packet.Vcc = Vcc;
+	packet.Vservo = Vservo;
+	packet.flags = flags;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POWER_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POWER_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a power_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param Vcc 5V rail voltage in millivolts
+ * @param Vservo servo rail voltage in millivolts
+ * @param flags power supply status flags (see MAV_POWER_STATUS enum)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_power_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint16_t Vcc,uint16_t Vservo,uint16_t flags)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, Vcc);
+	_mav_put_uint16_t(buf, 2, Vservo);
+	_mav_put_uint16_t(buf, 4, flags);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POWER_STATUS_LEN);
+#else
+	mavlink_power_status_t packet;
+	packet.Vcc = Vcc;
+	packet.Vservo = Vservo;
+	packet.flags = flags;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POWER_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_POWER_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a power_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param power_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_power_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_power_status_t* power_status)
+{
+	return mavlink_msg_power_status_pack(system_id, component_id, msg, power_status->Vcc, power_status->Vservo, power_status->flags);
+}
+
+/**
+ * @brief Encode a power_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param power_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_power_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_power_status_t* power_status)
+{
+	return mavlink_msg_power_status_pack_chan(system_id, component_id, chan, msg, power_status->Vcc, power_status->Vservo, power_status->flags);
+}
+
+/**
+ * @brief Send a power_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param Vcc 5V rail voltage in millivolts
+ * @param Vservo servo rail voltage in millivolts
+ * @param flags power supply status flags (see MAV_POWER_STATUS enum)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_power_status_send(mavlink_channel_t chan, uint16_t Vcc, uint16_t Vservo, uint16_t flags)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, Vcc);
+	_mav_put_uint16_t(buf, 2, Vservo);
+	_mav_put_uint16_t(buf, 4, flags);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+#else
+	mavlink_power_status_t packet;
+	packet.Vcc = Vcc;
+	packet.Vservo = Vservo;
+	packet.flags = flags;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)&packet, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a power_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_power_status_send_struct(mavlink_channel_t chan, const mavlink_power_status_t* power_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_power_status_send(chan, power_status->Vcc, power_status->Vservo, power_status->flags);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)power_status, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_POWER_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_power_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint16_t Vcc, uint16_t Vservo, uint16_t flags)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, Vcc);
+	_mav_put_uint16_t(buf, 2, Vservo);
+	_mav_put_uint16_t(buf, 4, flags);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+#else
+	mavlink_power_status_t *packet = (mavlink_power_status_t *)msgbuf;
+	packet->Vcc = Vcc;
+	packet->Vservo = Vservo;
+	packet->flags = flags;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)packet, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE POWER_STATUS UNPACKING
+
+
+/**
+ * @brief Get field Vcc from power_status message
+ *
+ * @return 5V rail voltage in millivolts
+ */
+static inline uint16_t mavlink_msg_power_status_get_Vcc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field Vservo from power_status message
+ *
+ * @return servo rail voltage in millivolts
+ */
+static inline uint16_t mavlink_msg_power_status_get_Vservo(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  2);
+}
+
+/**
+ * @brief Get field flags from power_status message
+ *
+ * @return power supply status flags (see MAV_POWER_STATUS enum)
+ */
+static inline uint16_t mavlink_msg_power_status_get_flags(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Decode a power_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param power_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_power_status_decode(const mavlink_message_t* msg, mavlink_power_status_t* power_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	power_status->Vcc = mavlink_msg_power_status_get_Vcc(msg);
+	power_status->Vservo = mavlink_msg_power_status_get_Vservo(msg);
+	power_status->flags = mavlink_msg_power_status_get_flags(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_POWER_STATUS_LEN? msg->len : MAVLINK_MSG_ID_POWER_STATUS_LEN;
+        memset(power_status, 0, MAVLINK_MSG_ID_POWER_STATUS_LEN);
+	memcpy(power_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_radio_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_radio_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_radio_status.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE RADIO_STATUS PACKING
+
+#define MAVLINK_MSG_ID_RADIO_STATUS 109
+
+typedef struct MAVLINK_PACKED __mavlink_radio_status_t
+{
+ uint16_t rxerrors; /*< Receive errors*/
+ uint16_t fixed; /*< Count of error corrected packets*/
+ uint8_t rssi; /*< Local signal strength*/
+ uint8_t remrssi; /*< Remote signal strength*/
+ uint8_t txbuf; /*< Remaining free buffer space in percent.*/
+ uint8_t noise; /*< Background noise level*/
+ uint8_t remnoise; /*< Remote background noise level*/
+} mavlink_radio_status_t;
+
+#define MAVLINK_MSG_ID_RADIO_STATUS_LEN 9
+#define MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN 9
+#define MAVLINK_MSG_ID_109_LEN 9
+#define MAVLINK_MSG_ID_109_MIN_LEN 9
+
+#define MAVLINK_MSG_ID_RADIO_STATUS_CRC 185
+#define MAVLINK_MSG_ID_109_CRC 185
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \
+	109, \
+	"RADIO_STATUS", \
+	7, \
+	{  { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \
+         { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \
+         { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \
+         { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \
+         { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \
+         { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \
+	"RADIO_STATUS", \
+	7, \
+	{  { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \
+         { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \
+         { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \
+         { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \
+         { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \
+         { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a radio_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param rssi Local signal strength
+ * @param remrssi Remote signal strength
+ * @param txbuf Remaining free buffer space in percent.
+ * @param noise Background noise level
+ * @param remnoise Remote background noise level
+ * @param rxerrors Receive errors
+ * @param fixed Count of error corrected packets
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, rxerrors);
+	_mav_put_uint16_t(buf, 2, fixed);
+	_mav_put_uint8_t(buf, 4, rssi);
+	_mav_put_uint8_t(buf, 5, remrssi);
+	_mav_put_uint8_t(buf, 6, txbuf);
+	_mav_put_uint8_t(buf, 7, noise);
+	_mav_put_uint8_t(buf, 8, remnoise);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
+#else
+	mavlink_radio_status_t packet;
+	packet.rxerrors = rxerrors;
+	packet.fixed = fixed;
+	packet.rssi = rssi;
+	packet.remrssi = remrssi;
+	packet.txbuf = txbuf;
+	packet.noise = noise;
+	packet.remnoise = remnoise;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a radio_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param rssi Local signal strength
+ * @param remrssi Remote signal strength
+ * @param txbuf Remaining free buffer space in percent.
+ * @param noise Background noise level
+ * @param remnoise Remote background noise level
+ * @param rxerrors Receive errors
+ * @param fixed Count of error corrected packets
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, rxerrors);
+	_mav_put_uint16_t(buf, 2, fixed);
+	_mav_put_uint8_t(buf, 4, rssi);
+	_mav_put_uint8_t(buf, 5, remrssi);
+	_mav_put_uint8_t(buf, 6, txbuf);
+	_mav_put_uint8_t(buf, 7, noise);
+	_mav_put_uint8_t(buf, 8, remnoise);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
+#else
+	mavlink_radio_status_t packet;
+	packet.rxerrors = rxerrors;
+	packet.fixed = fixed;
+	packet.rssi = rssi;
+	packet.remrssi = remrssi;
+	packet.txbuf = txbuf;
+	packet.noise = noise;
+	packet.remnoise = remnoise;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a radio_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param radio_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_radio_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status)
+{
+	return mavlink_msg_radio_status_pack(system_id, component_id, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed);
+}
+
+/**
+ * @brief Encode a radio_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param radio_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status)
+{
+	return mavlink_msg_radio_status_pack_chan(system_id, component_id, chan, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed);
+}
+
+/**
+ * @brief Send a radio_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param rssi Local signal strength
+ * @param remrssi Remote signal strength
+ * @param txbuf Remaining free buffer space in percent.
+ * @param noise Background noise level
+ * @param remnoise Remote background noise level
+ * @param rxerrors Receive errors
+ * @param fixed Count of error corrected packets
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_radio_status_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
+	_mav_put_uint16_t(buf, 0, rxerrors);
+	_mav_put_uint16_t(buf, 2, fixed);
+	_mav_put_uint8_t(buf, 4, rssi);
+	_mav_put_uint8_t(buf, 5, remrssi);
+	_mav_put_uint8_t(buf, 6, txbuf);
+	_mav_put_uint8_t(buf, 7, noise);
+	_mav_put_uint8_t(buf, 8, remnoise);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+#else
+	mavlink_radio_status_t packet;
+	packet.rxerrors = rxerrors;
+	packet.fixed = fixed;
+	packet.rssi = rssi;
+	packet.remrssi = remrssi;
+	packet.txbuf = txbuf;
+	packet.noise = noise;
+	packet.remnoise = remnoise;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a radio_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_radio_status_send_struct(mavlink_channel_t chan, const mavlink_radio_status_t* radio_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_radio_status_send(chan, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)radio_status, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RADIO_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_radio_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, rxerrors);
+	_mav_put_uint16_t(buf, 2, fixed);
+	_mav_put_uint8_t(buf, 4, rssi);
+	_mav_put_uint8_t(buf, 5, remrssi);
+	_mav_put_uint8_t(buf, 6, txbuf);
+	_mav_put_uint8_t(buf, 7, noise);
+	_mav_put_uint8_t(buf, 8, remnoise);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+#else
+	mavlink_radio_status_t *packet = (mavlink_radio_status_t *)msgbuf;
+	packet->rxerrors = rxerrors;
+	packet->fixed = fixed;
+	packet->rssi = rssi;
+	packet->remrssi = remrssi;
+	packet->txbuf = txbuf;
+	packet->noise = noise;
+	packet->remnoise = remnoise;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RADIO_STATUS UNPACKING
+
+
+/**
+ * @brief Get field rssi from radio_status message
+ *
+ * @return Local signal strength
+ */
+static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field remrssi from radio_status message
+ *
+ * @return Remote signal strength
+ */
+static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field txbuf from radio_status message
+ *
+ * @return Remaining free buffer space in percent.
+ */
+static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  6);
+}
+
+/**
+ * @brief Get field noise from radio_status message
+ *
+ * @return Background noise level
+ */
+static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  7);
+}
+
+/**
+ * @brief Get field remnoise from radio_status message
+ *
+ * @return Remote background noise level
+ */
+static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  8);
+}
+
+/**
+ * @brief Get field rxerrors from radio_status message
+ *
+ * @return Receive errors
+ */
+static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field fixed from radio_status message
+ *
+ * @return Count of error corrected packets
+ */
+static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  2);
+}
+
+/**
+ * @brief Decode a radio_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param radio_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_radio_status_decode(const mavlink_message_t* msg, mavlink_radio_status_t* radio_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	radio_status->rxerrors = mavlink_msg_radio_status_get_rxerrors(msg);
+	radio_status->fixed = mavlink_msg_radio_status_get_fixed(msg);
+	radio_status->rssi = mavlink_msg_radio_status_get_rssi(msg);
+	radio_status->remrssi = mavlink_msg_radio_status_get_remrssi(msg);
+	radio_status->txbuf = mavlink_msg_radio_status_get_txbuf(msg);
+	radio_status->noise = mavlink_msg_radio_status_get_noise(msg);
+	radio_status->remnoise = mavlink_msg_radio_status_get_remnoise(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RADIO_STATUS_LEN? msg->len : MAVLINK_MSG_ID_RADIO_STATUS_LEN;
+        memset(radio_status, 0, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
+	memcpy(radio_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_imu.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_imu.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_imu.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE RAW_IMU PACKING
+
+#define MAVLINK_MSG_ID_RAW_IMU 27
+
+typedef struct MAVLINK_PACKED __mavlink_raw_imu_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ int16_t xacc; /*< X acceleration (raw)*/
+ int16_t yacc; /*< Y acceleration (raw)*/
+ int16_t zacc; /*< Z acceleration (raw)*/
+ int16_t xgyro; /*< Angular speed around X axis (raw)*/
+ int16_t ygyro; /*< Angular speed around Y axis (raw)*/
+ int16_t zgyro; /*< Angular speed around Z axis (raw)*/
+ int16_t xmag; /*< X Magnetic field (raw)*/
+ int16_t ymag; /*< Y Magnetic field (raw)*/
+ int16_t zmag; /*< Z Magnetic field (raw)*/
+} mavlink_raw_imu_t;
+
+#define MAVLINK_MSG_ID_RAW_IMU_LEN 26
+#define MAVLINK_MSG_ID_RAW_IMU_MIN_LEN 26
+#define MAVLINK_MSG_ID_27_LEN 26
+#define MAVLINK_MSG_ID_27_MIN_LEN 26
+
+#define MAVLINK_MSG_ID_RAW_IMU_CRC 144
+#define MAVLINK_MSG_ID_27_CRC 144
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RAW_IMU { \
+	27, \
+	"RAW_IMU", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_raw_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_raw_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_raw_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_raw_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_raw_imu_t, zmag) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RAW_IMU { \
+	"RAW_IMU", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, time_usec) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_raw_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_raw_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_raw_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_raw_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_raw_imu_t, zmag) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a raw_imu message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param xacc X acceleration (raw)
+ * @param yacc Y acceleration (raw)
+ * @param zacc Z acceleration (raw)
+ * @param xgyro Angular speed around X axis (raw)
+ * @param ygyro Angular speed around Y axis (raw)
+ * @param zgyro Angular speed around Z axis (raw)
+ * @param xmag X Magnetic field (raw)
+ * @param ymag Y Magnetic field (raw)
+ * @param zmag Z Magnetic field (raw)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, xacc);
+	_mav_put_int16_t(buf, 10, yacc);
+	_mav_put_int16_t(buf, 12, zacc);
+	_mav_put_int16_t(buf, 14, xgyro);
+	_mav_put_int16_t(buf, 16, ygyro);
+	_mav_put_int16_t(buf, 18, zgyro);
+	_mav_put_int16_t(buf, 20, xmag);
+	_mav_put_int16_t(buf, 22, ymag);
+	_mav_put_int16_t(buf, 24, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN);
+#else
+	mavlink_raw_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+}
+
+/**
+ * @brief Pack a raw_imu message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param xacc X acceleration (raw)
+ * @param yacc Y acceleration (raw)
+ * @param zacc Z acceleration (raw)
+ * @param xgyro Angular speed around X axis (raw)
+ * @param ygyro Angular speed around Y axis (raw)
+ * @param zgyro Angular speed around Z axis (raw)
+ * @param xmag X Magnetic field (raw)
+ * @param ymag Y Magnetic field (raw)
+ * @param zmag Z Magnetic field (raw)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, xacc);
+	_mav_put_int16_t(buf, 10, yacc);
+	_mav_put_int16_t(buf, 12, zacc);
+	_mav_put_int16_t(buf, 14, xgyro);
+	_mav_put_int16_t(buf, 16, ygyro);
+	_mav_put_int16_t(buf, 18, zgyro);
+	_mav_put_int16_t(buf, 20, xmag);
+	_mav_put_int16_t(buf, 22, ymag);
+	_mav_put_int16_t(buf, 24, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN);
+#else
+	mavlink_raw_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+}
+
+/**
+ * @brief Encode a raw_imu struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param raw_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_raw_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_imu_t* raw_imu)
+{
+	return mavlink_msg_raw_imu_pack(system_id, component_id, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag);
+}
+
+/**
+ * @brief Encode a raw_imu struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param raw_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_raw_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_raw_imu_t* raw_imu)
+{
+	return mavlink_msg_raw_imu_pack_chan(system_id, component_id, chan, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag);
+}
+
+/**
+ * @brief Send a raw_imu message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param xacc X acceleration (raw)
+ * @param yacc Y acceleration (raw)
+ * @param zacc Z acceleration (raw)
+ * @param xgyro Angular speed around X axis (raw)
+ * @param ygyro Angular speed around Y axis (raw)
+ * @param zgyro Angular speed around Z axis (raw)
+ * @param xmag X Magnetic field (raw)
+ * @param ymag Y Magnetic field (raw)
+ * @param zmag Z Magnetic field (raw)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_IMU_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, xacc);
+	_mav_put_int16_t(buf, 10, yacc);
+	_mav_put_int16_t(buf, 12, zacc);
+	_mav_put_int16_t(buf, 14, xgyro);
+	_mav_put_int16_t(buf, 16, ygyro);
+	_mav_put_int16_t(buf, 18, zgyro);
+	_mav_put_int16_t(buf, 20, xmag);
+	_mav_put_int16_t(buf, 22, ymag);
+	_mav_put_int16_t(buf, 24, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+#else
+	mavlink_raw_imu_t packet;
+	packet.time_usec = time_usec;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+#endif
+}
+
+/**
+ * @brief Send a raw_imu message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_raw_imu_send_struct(mavlink_channel_t chan, const mavlink_raw_imu_t* raw_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_raw_imu_send(chan, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)raw_imu, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RAW_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_raw_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, xacc);
+	_mav_put_int16_t(buf, 10, yacc);
+	_mav_put_int16_t(buf, 12, zacc);
+	_mav_put_int16_t(buf, 14, xgyro);
+	_mav_put_int16_t(buf, 16, ygyro);
+	_mav_put_int16_t(buf, 18, zgyro);
+	_mav_put_int16_t(buf, 20, xmag);
+	_mav_put_int16_t(buf, 22, ymag);
+	_mav_put_int16_t(buf, 24, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+#else
+	mavlink_raw_imu_t *packet = (mavlink_raw_imu_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)packet, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RAW_IMU UNPACKING
+
+
+/**
+ * @brief Get field time_usec from raw_imu message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_raw_imu_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from raw_imu message
+ *
+ * @return X acceleration (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field yacc from raw_imu message
+ *
+ * @return Y acceleration (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field zacc from raw_imu message
+ *
+ * @return Z acceleration (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field xgyro from raw_imu message
+ *
+ * @return Angular speed around X axis (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Get field ygyro from raw_imu message
+ *
+ * @return Angular speed around Y axis (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field zgyro from raw_imu message
+ *
+ * @return Angular speed around Z axis (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  18);
+}
+
+/**
+ * @brief Get field xmag from raw_imu message
+ *
+ * @return X Magnetic field (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Get field ymag from raw_imu message
+ *
+ * @return Y Magnetic field (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  22);
+}
+
+/**
+ * @brief Get field zmag from raw_imu message
+ *
+ * @return Z Magnetic field (raw)
+ */
+static inline int16_t mavlink_msg_raw_imu_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  24);
+}
+
+/**
+ * @brief Decode a raw_imu message into a struct
+ *
+ * @param msg The message to decode
+ * @param raw_imu C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_raw_imu_decode(const mavlink_message_t* msg, mavlink_raw_imu_t* raw_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	raw_imu->time_usec = mavlink_msg_raw_imu_get_time_usec(msg);
+	raw_imu->xacc = mavlink_msg_raw_imu_get_xacc(msg);
+	raw_imu->yacc = mavlink_msg_raw_imu_get_yacc(msg);
+	raw_imu->zacc = mavlink_msg_raw_imu_get_zacc(msg);
+	raw_imu->xgyro = mavlink_msg_raw_imu_get_xgyro(msg);
+	raw_imu->ygyro = mavlink_msg_raw_imu_get_ygyro(msg);
+	raw_imu->zgyro = mavlink_msg_raw_imu_get_zgyro(msg);
+	raw_imu->xmag = mavlink_msg_raw_imu_get_xmag(msg);
+	raw_imu->ymag = mavlink_msg_raw_imu_get_ymag(msg);
+	raw_imu->zmag = mavlink_msg_raw_imu_get_zmag(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RAW_IMU_LEN? msg->len : MAVLINK_MSG_ID_RAW_IMU_LEN;
+        memset(raw_imu, 0, MAVLINK_MSG_ID_RAW_IMU_LEN);
+	memcpy(raw_imu, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_pressure.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_pressure.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_raw_pressure.h	(revision 209)
@@ -0,0 +1,312 @@
+// MESSAGE RAW_PRESSURE PACKING
+
+#define MAVLINK_MSG_ID_RAW_PRESSURE 28
+
+typedef struct MAVLINK_PACKED __mavlink_raw_pressure_t
+{
+ uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
+ int16_t press_abs; /*< Absolute pressure (raw)*/
+ int16_t press_diff1; /*< Differential pressure 1 (raw, 0 if nonexistant)*/
+ int16_t press_diff2; /*< Differential pressure 2 (raw, 0 if nonexistant)*/
+ int16_t temperature; /*< Raw Temperature measurement (raw)*/
+} mavlink_raw_pressure_t;
+
+#define MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16
+#define MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN 16
+#define MAVLINK_MSG_ID_28_LEN 16
+#define MAVLINK_MSG_ID_28_MIN_LEN 16
+
+#define MAVLINK_MSG_ID_RAW_PRESSURE_CRC 67
+#define MAVLINK_MSG_ID_28_CRC 67
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \
+	28, \
+	"RAW_PRESSURE", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, time_usec) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_pressure_t, press_abs) }, \
+         { "press_diff1", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_pressure_t, press_diff1) }, \
+         { "press_diff2", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_pressure_t, press_diff2) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_pressure_t, temperature) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \
+	"RAW_PRESSURE", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, time_usec) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_pressure_t, press_abs) }, \
+         { "press_diff1", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_pressure_t, press_diff1) }, \
+         { "press_diff2", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_pressure_t, press_diff2) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_pressure_t, temperature) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a raw_pressure message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param press_abs Absolute pressure (raw)
+ * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant)
+ * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant)
+ * @param temperature Raw Temperature measurement (raw)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, press_abs);
+	_mav_put_int16_t(buf, 10, press_diff1);
+	_mav_put_int16_t(buf, 12, press_diff2);
+	_mav_put_int16_t(buf, 14, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN);
+#else
+	mavlink_raw_pressure_t packet;
+	packet.time_usec = time_usec;
+	packet.press_abs = press_abs;
+	packet.press_diff1 = press_diff1;
+	packet.press_diff2 = press_diff2;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+}
+
+/**
+ * @brief Pack a raw_pressure message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param press_abs Absolute pressure (raw)
+ * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant)
+ * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant)
+ * @param temperature Raw Temperature measurement (raw)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,int16_t press_abs,int16_t press_diff1,int16_t press_diff2,int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, press_abs);
+	_mav_put_int16_t(buf, 10, press_diff1);
+	_mav_put_int16_t(buf, 12, press_diff2);
+	_mav_put_int16_t(buf, 14, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN);
+#else
+	mavlink_raw_pressure_t packet;
+	packet.time_usec = time_usec;
+	packet.press_abs = press_abs;
+	packet.press_diff1 = press_diff1;
+	packet.press_diff2 = press_diff2;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+}
+
+/**
+ * @brief Encode a raw_pressure struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param raw_pressure C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_raw_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_pressure_t* raw_pressure)
+{
+	return mavlink_msg_raw_pressure_pack(system_id, component_id, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature);
+}
+
+/**
+ * @brief Encode a raw_pressure struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param raw_pressure C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_raw_pressure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_raw_pressure_t* raw_pressure)
+{
+	return mavlink_msg_raw_pressure_pack_chan(system_id, component_id, chan, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature);
+}
+
+/**
+ * @brief Send a raw_pressure message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ * @param press_abs Absolute pressure (raw)
+ * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant)
+ * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant)
+ * @param temperature Raw Temperature measurement (raw)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, press_abs);
+	_mav_put_int16_t(buf, 10, press_diff1);
+	_mav_put_int16_t(buf, 12, press_diff2);
+	_mav_put_int16_t(buf, 14, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+#else
+	mavlink_raw_pressure_t packet;
+	packet.time_usec = time_usec;
+	packet.press_abs = press_abs;
+	packet.press_diff1 = press_diff1;
+	packet.press_diff2 = press_diff2;
+	packet.temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a raw_pressure message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_raw_pressure_send_struct(mavlink_channel_t chan, const mavlink_raw_pressure_t* raw_pressure)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_raw_pressure_send(chan, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)raw_pressure, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RAW_PRESSURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_raw_pressure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_int16_t(buf, 8, press_abs);
+	_mav_put_int16_t(buf, 10, press_diff1);
+	_mav_put_int16_t(buf, 12, press_diff2);
+	_mav_put_int16_t(buf, 14, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+#else
+	mavlink_raw_pressure_t *packet = (mavlink_raw_pressure_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->press_abs = press_abs;
+	packet->press_diff1 = press_diff1;
+	packet->press_diff2 = press_diff2;
+	packet->temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RAW_PRESSURE UNPACKING
+
+
+/**
+ * @brief Get field time_usec from raw_pressure message
+ *
+ * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
+ */
+static inline uint64_t mavlink_msg_raw_pressure_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field press_abs from raw_pressure message
+ *
+ * @return Absolute pressure (raw)
+ */
+static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field press_diff1 from raw_pressure message
+ *
+ * @return Differential pressure 1 (raw, 0 if nonexistant)
+ */
+static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field press_diff2 from raw_pressure message
+ *
+ * @return Differential pressure 2 (raw, 0 if nonexistant)
+ */
+static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field temperature from raw_pressure message
+ *
+ * @return Raw Temperature measurement (raw)
+ */
+static inline int16_t mavlink_msg_raw_pressure_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Decode a raw_pressure message into a struct
+ *
+ * @param msg The message to decode
+ * @param raw_pressure C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_raw_pressure_decode(const mavlink_message_t* msg, mavlink_raw_pressure_t* raw_pressure)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	raw_pressure->time_usec = mavlink_msg_raw_pressure_get_time_usec(msg);
+	raw_pressure->press_abs = mavlink_msg_raw_pressure_get_press_abs(msg);
+	raw_pressure->press_diff1 = mavlink_msg_raw_pressure_get_press_diff1(msg);
+	raw_pressure->press_diff2 = mavlink_msg_raw_pressure_get_press_diff2(msg);
+	raw_pressure->temperature = mavlink_msg_raw_pressure_get_temperature(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RAW_PRESSURE_LEN? msg->len : MAVLINK_MSG_ID_RAW_PRESSURE_LEN;
+        memset(raw_pressure, 0, MAVLINK_MSG_ID_RAW_PRESSURE_LEN);
+	memcpy(raw_pressure, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels.h	(revision 209)
@@ -0,0 +1,712 @@
+// MESSAGE RC_CHANNELS PACKING
+
+#define MAVLINK_MSG_ID_RC_CHANNELS 65
+
+typedef struct MAVLINK_PACKED __mavlink_rc_channels_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan9_raw; /*< RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan10_raw; /*< RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan11_raw; /*< RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan12_raw; /*< RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan13_raw; /*< RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan14_raw; /*< RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan15_raw; /*< RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan16_raw; /*< RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan17_raw; /*< RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan18_raw; /*< RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint8_t chancount; /*< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.*/
+ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/
+} mavlink_rc_channels_t;
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_LEN 42
+#define MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN 42
+#define MAVLINK_MSG_ID_65_LEN 42
+#define MAVLINK_MSG_ID_65_MIN_LEN 42
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_CRC 118
+#define MAVLINK_MSG_ID_65_CRC 118
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \
+	65, \
+	"RC_CHANNELS", \
+	21, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_t, chan8_raw) }, \
+         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_t, chan9_raw) }, \
+         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_t, chan10_raw) }, \
+         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_t, chan11_raw) }, \
+         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_t, chan12_raw) }, \
+         { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_t, chan13_raw) }, \
+         { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_t, chan14_raw) }, \
+         { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_t, chan15_raw) }, \
+         { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \
+         { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \
+         { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \
+         { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \
+	"RC_CHANNELS", \
+	21, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_t, chan8_raw) }, \
+         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_t, chan9_raw) }, \
+         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_t, chan10_raw) }, \
+         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_t, chan11_raw) }, \
+         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_t, chan12_raw) }, \
+         { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_t, chan13_raw) }, \
+         { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_t, chan14_raw) }, \
+         { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_t, chan15_raw) }, \
+         { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \
+         { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \
+         { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \
+         { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a rc_channels message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint16_t(buf, 20, chan9_raw);
+	_mav_put_uint16_t(buf, 22, chan10_raw);
+	_mav_put_uint16_t(buf, 24, chan11_raw);
+	_mav_put_uint16_t(buf, 26, chan12_raw);
+	_mav_put_uint16_t(buf, 28, chan13_raw);
+	_mav_put_uint16_t(buf, 30, chan14_raw);
+	_mav_put_uint16_t(buf, 32, chan15_raw);
+	_mav_put_uint16_t(buf, 34, chan16_raw);
+	_mav_put_uint16_t(buf, 36, chan17_raw);
+	_mav_put_uint16_t(buf, 38, chan18_raw);
+	_mav_put_uint8_t(buf, 40, chancount);
+	_mav_put_uint8_t(buf, 41, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
+#else
+	mavlink_rc_channels_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.chan13_raw = chan13_raw;
+	packet.chan14_raw = chan14_raw;
+	packet.chan15_raw = chan15_raw;
+	packet.chan16_raw = chan16_raw;
+	packet.chan17_raw = chan17_raw;
+	packet.chan18_raw = chan18_raw;
+	packet.chancount = chancount;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+}
+
+/**
+ * @brief Pack a rc_channels message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t chancount,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint16_t chan13_raw,uint16_t chan14_raw,uint16_t chan15_raw,uint16_t chan16_raw,uint16_t chan17_raw,uint16_t chan18_raw,uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint16_t(buf, 20, chan9_raw);
+	_mav_put_uint16_t(buf, 22, chan10_raw);
+	_mav_put_uint16_t(buf, 24, chan11_raw);
+	_mav_put_uint16_t(buf, 26, chan12_raw);
+	_mav_put_uint16_t(buf, 28, chan13_raw);
+	_mav_put_uint16_t(buf, 30, chan14_raw);
+	_mav_put_uint16_t(buf, 32, chan15_raw);
+	_mav_put_uint16_t(buf, 34, chan16_raw);
+	_mav_put_uint16_t(buf, 36, chan17_raw);
+	_mav_put_uint16_t(buf, 38, chan18_raw);
+	_mav_put_uint8_t(buf, 40, chancount);
+	_mav_put_uint8_t(buf, 41, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
+#else
+	mavlink_rc_channels_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.chan13_raw = chan13_raw;
+	packet.chan14_raw = chan14_raw;
+	packet.chan15_raw = chan15_raw;
+	packet.chan16_raw = chan16_raw;
+	packet.chan17_raw = chan17_raw;
+	packet.chan18_raw = chan18_raw;
+	packet.chancount = chancount;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+}
+
+/**
+ * @brief Encode a rc_channels struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels)
+{
+	return mavlink_msg_rc_channels_pack(system_id, component_id, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
+}
+
+/**
+ * @brief Encode a rc_channels struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels)
+{
+	return mavlink_msg_rc_channels_pack_chan(system_id, component_id, chan, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
+}
+
+/**
+ * @brief Send a rc_channels message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_rc_channels_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint16_t(buf, 20, chan9_raw);
+	_mav_put_uint16_t(buf, 22, chan10_raw);
+	_mav_put_uint16_t(buf, 24, chan11_raw);
+	_mav_put_uint16_t(buf, 26, chan12_raw);
+	_mav_put_uint16_t(buf, 28, chan13_raw);
+	_mav_put_uint16_t(buf, 30, chan14_raw);
+	_mav_put_uint16_t(buf, 32, chan15_raw);
+	_mav_put_uint16_t(buf, 34, chan16_raw);
+	_mav_put_uint16_t(buf, 36, chan17_raw);
+	_mav_put_uint16_t(buf, 38, chan18_raw);
+	_mav_put_uint8_t(buf, 40, chancount);
+	_mav_put_uint8_t(buf, 41, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+#else
+	mavlink_rc_channels_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.chan9_raw = chan9_raw;
+	packet.chan10_raw = chan10_raw;
+	packet.chan11_raw = chan11_raw;
+	packet.chan12_raw = chan12_raw;
+	packet.chan13_raw = chan13_raw;
+	packet.chan14_raw = chan14_raw;
+	packet.chan15_raw = chan15_raw;
+	packet.chan16_raw = chan16_raw;
+	packet.chan17_raw = chan17_raw;
+	packet.chan18_raw = chan18_raw;
+	packet.chancount = chancount;
+	packet.rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a rc_channels message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_rc_channels_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_t* rc_channels)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_rc_channels_send(chan, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)rc_channels, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RC_CHANNELS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_rc_channels_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint16_t(buf, 20, chan9_raw);
+	_mav_put_uint16_t(buf, 22, chan10_raw);
+	_mav_put_uint16_t(buf, 24, chan11_raw);
+	_mav_put_uint16_t(buf, 26, chan12_raw);
+	_mav_put_uint16_t(buf, 28, chan13_raw);
+	_mav_put_uint16_t(buf, 30, chan14_raw);
+	_mav_put_uint16_t(buf, 32, chan15_raw);
+	_mav_put_uint16_t(buf, 34, chan16_raw);
+	_mav_put_uint16_t(buf, 36, chan17_raw);
+	_mav_put_uint16_t(buf, 38, chan18_raw);
+	_mav_put_uint8_t(buf, 40, chancount);
+	_mav_put_uint8_t(buf, 41, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+#else
+	mavlink_rc_channels_t *packet = (mavlink_rc_channels_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->chan1_raw = chan1_raw;
+	packet->chan2_raw = chan2_raw;
+	packet->chan3_raw = chan3_raw;
+	packet->chan4_raw = chan4_raw;
+	packet->chan5_raw = chan5_raw;
+	packet->chan6_raw = chan6_raw;
+	packet->chan7_raw = chan7_raw;
+	packet->chan8_raw = chan8_raw;
+	packet->chan9_raw = chan9_raw;
+	packet->chan10_raw = chan10_raw;
+	packet->chan11_raw = chan11_raw;
+	packet->chan12_raw = chan12_raw;
+	packet->chan13_raw = chan13_raw;
+	packet->chan14_raw = chan14_raw;
+	packet->chan15_raw = chan15_raw;
+	packet->chan16_raw = chan16_raw;
+	packet->chan17_raw = chan17_raw;
+	packet->chan18_raw = chan18_raw;
+	packet->chancount = chancount;
+	packet->rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RC_CHANNELS UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from rc_channels message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field chancount from rc_channels message
+ *
+ * @return Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
+ */
+static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  40);
+}
+
+/**
+ * @brief Get field chan1_raw from rc_channels message
+ *
+ * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field chan2_raw from rc_channels message
+ *
+ * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field chan3_raw from rc_channels message
+ *
+ * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field chan4_raw from rc_channels message
+ *
+ * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field chan5_raw from rc_channels message
+ *
+ * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field chan6_raw from rc_channels message
+ *
+ * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Get field chan7_raw from rc_channels message
+ *
+ * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field chan8_raw from rc_channels message
+ *
+ * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field chan9_raw from rc_channels message
+ *
+ * @return RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Get field chan10_raw from rc_channels message
+ *
+ * @return RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field chan11_raw from rc_channels message
+ *
+ * @return RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field chan12_raw from rc_channels message
+ *
+ * @return RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Get field chan13_raw from rc_channels message
+ *
+ * @return RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Get field chan14_raw from rc_channels message
+ *
+ * @return RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  30);
+}
+
+/**
+ * @brief Get field chan15_raw from rc_channels message
+ *
+ * @return RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  32);
+}
+
+/**
+ * @brief Get field chan16_raw from rc_channels message
+ *
+ * @return RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  34);
+}
+
+/**
+ * @brief Get field chan17_raw from rc_channels message
+ *
+ * @return RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  36);
+}
+
+/**
+ * @brief Get field chan18_raw from rc_channels message
+ *
+ * @return RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  38);
+}
+
+/**
+ * @brief Get field rssi from rc_channels message
+ *
+ * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+static inline uint8_t mavlink_msg_rc_channels_get_rssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  41);
+}
+
+/**
+ * @brief Decode a rc_channels message into a struct
+ *
+ * @param msg The message to decode
+ * @param rc_channels C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_rc_channels_decode(const mavlink_message_t* msg, mavlink_rc_channels_t* rc_channels)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	rc_channels->time_boot_ms = mavlink_msg_rc_channels_get_time_boot_ms(msg);
+	rc_channels->chan1_raw = mavlink_msg_rc_channels_get_chan1_raw(msg);
+	rc_channels->chan2_raw = mavlink_msg_rc_channels_get_chan2_raw(msg);
+	rc_channels->chan3_raw = mavlink_msg_rc_channels_get_chan3_raw(msg);
+	rc_channels->chan4_raw = mavlink_msg_rc_channels_get_chan4_raw(msg);
+	rc_channels->chan5_raw = mavlink_msg_rc_channels_get_chan5_raw(msg);
+	rc_channels->chan6_raw = mavlink_msg_rc_channels_get_chan6_raw(msg);
+	rc_channels->chan7_raw = mavlink_msg_rc_channels_get_chan7_raw(msg);
+	rc_channels->chan8_raw = mavlink_msg_rc_channels_get_chan8_raw(msg);
+	rc_channels->chan9_raw = mavlink_msg_rc_channels_get_chan9_raw(msg);
+	rc_channels->chan10_raw = mavlink_msg_rc_channels_get_chan10_raw(msg);
+	rc_channels->chan11_raw = mavlink_msg_rc_channels_get_chan11_raw(msg);
+	rc_channels->chan12_raw = mavlink_msg_rc_channels_get_chan12_raw(msg);
+	rc_channels->chan13_raw = mavlink_msg_rc_channels_get_chan13_raw(msg);
+	rc_channels->chan14_raw = mavlink_msg_rc_channels_get_chan14_raw(msg);
+	rc_channels->chan15_raw = mavlink_msg_rc_channels_get_chan15_raw(msg);
+	rc_channels->chan16_raw = mavlink_msg_rc_channels_get_chan16_raw(msg);
+	rc_channels->chan17_raw = mavlink_msg_rc_channels_get_chan17_raw(msg);
+	rc_channels->chan18_raw = mavlink_msg_rc_channels_get_chan18_raw(msg);
+	rc_channels->chancount = mavlink_msg_rc_channels_get_chancount(msg);
+	rc_channels->rssi = mavlink_msg_rc_channels_get_rssi(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_LEN;
+        memset(rc_channels, 0, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
+	memcpy(rc_channels, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_override.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_override.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_override.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE RC_CHANNELS_OVERRIDE PACKING
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70
+
+typedef struct MAVLINK_PACKED __mavlink_rc_channels_override_t
+{
+ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_rc_channels_override_t;
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18
+#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN 18
+#define MAVLINK_MSG_ID_70_LEN 18
+#define MAVLINK_MSG_ID_70_MIN_LEN 18
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124
+#define MAVLINK_MSG_ID_70_CRC 124
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
+	70, \
+	"RC_CHANNELS_OVERRIDE", \
+	10, \
+	{  { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
+	"RC_CHANNELS_OVERRIDE", \
+	10, \
+	{  { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a rc_channels_override message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
+	_mav_put_uint16_t(buf, 0, chan1_raw);
+	_mav_put_uint16_t(buf, 2, chan2_raw);
+	_mav_put_uint16_t(buf, 4, chan3_raw);
+	_mav_put_uint16_t(buf, 6, chan4_raw);
+	_mav_put_uint16_t(buf, 8, chan5_raw);
+	_mav_put_uint16_t(buf, 10, chan6_raw);
+	_mav_put_uint16_t(buf, 12, chan7_raw);
+	_mav_put_uint16_t(buf, 14, chan8_raw);
+	_mav_put_uint8_t(buf, 16, target_system);
+	_mav_put_uint8_t(buf, 17, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
+#else
+	mavlink_rc_channels_override_t packet;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+}
+
+/**
+ * @brief Pack a rc_channels_override message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
+	_mav_put_uint16_t(buf, 0, chan1_raw);
+	_mav_put_uint16_t(buf, 2, chan2_raw);
+	_mav_put_uint16_t(buf, 4, chan3_raw);
+	_mav_put_uint16_t(buf, 6, chan4_raw);
+	_mav_put_uint16_t(buf, 8, chan5_raw);
+	_mav_put_uint16_t(buf, 10, chan6_raw);
+	_mav_put_uint16_t(buf, 12, chan7_raw);
+	_mav_put_uint16_t(buf, 14, chan8_raw);
+	_mav_put_uint8_t(buf, 16, target_system);
+	_mav_put_uint8_t(buf, 17, target_component);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
+#else
+	mavlink_rc_channels_override_t packet;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+}
+
+/**
+ * @brief Encode a rc_channels_override struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_override C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
+{
+	return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
+}
+
+/**
+ * @brief Encode a rc_channels_override struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_override C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
+{
+	return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
+}
+
+/**
+ * @brief Send a rc_channels_override message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
+	_mav_put_uint16_t(buf, 0, chan1_raw);
+	_mav_put_uint16_t(buf, 2, chan2_raw);
+	_mav_put_uint16_t(buf, 4, chan3_raw);
+	_mav_put_uint16_t(buf, 6, chan4_raw);
+	_mav_put_uint16_t(buf, 8, chan5_raw);
+	_mav_put_uint16_t(buf, 10, chan6_raw);
+	_mav_put_uint16_t(buf, 12, chan7_raw);
+	_mav_put_uint16_t(buf, 14, chan8_raw);
+	_mav_put_uint8_t(buf, 16, target_system);
+	_mav_put_uint8_t(buf, 17, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+#else
+	mavlink_rc_channels_override_t packet;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a rc_channels_override message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_rc_channels_override_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_override_t* rc_channels_override)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_rc_channels_override_send(chan, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)rc_channels_override, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, chan1_raw);
+	_mav_put_uint16_t(buf, 2, chan2_raw);
+	_mav_put_uint16_t(buf, 4, chan3_raw);
+	_mav_put_uint16_t(buf, 6, chan4_raw);
+	_mav_put_uint16_t(buf, 8, chan5_raw);
+	_mav_put_uint16_t(buf, 10, chan6_raw);
+	_mav_put_uint16_t(buf, 12, chan7_raw);
+	_mav_put_uint16_t(buf, 14, chan8_raw);
+	_mav_put_uint8_t(buf, 16, target_system);
+	_mav_put_uint8_t(buf, 17, target_component);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+#else
+	mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf;
+	packet->chan1_raw = chan1_raw;
+	packet->chan2_raw = chan2_raw;
+	packet->chan3_raw = chan3_raw;
+	packet->chan4_raw = chan4_raw;
+	packet->chan5_raw = chan5_raw;
+	packet->chan6_raw = chan6_raw;
+	packet->chan7_raw = chan7_raw;
+	packet->chan8_raw = chan8_raw;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RC_CHANNELS_OVERRIDE UNPACKING
+
+
+/**
+ * @brief Get field target_system from rc_channels_override message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  16);
+}
+
+/**
+ * @brief Get field target_component from rc_channels_override message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  17);
+}
+
+/**
+ * @brief Get field chan1_raw from rc_channels_override message
+ *
+ * @return RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field chan2_raw from rc_channels_override message
+ *
+ * @return RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  2);
+}
+
+/**
+ * @brief Get field chan3_raw from rc_channels_override message
+ *
+ * @return RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field chan4_raw from rc_channels_override message
+ *
+ * @return RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field chan5_raw from rc_channels_override message
+ *
+ * @return RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field chan6_raw from rc_channels_override message
+ *
+ * @return RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field chan7_raw from rc_channels_override message
+ *
+ * @return RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field chan8_raw from rc_channels_override message
+ *
+ * @return RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
+ */
+static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Decode a rc_channels_override message into a struct
+ *
+ * @param msg The message to decode
+ * @param rc_channels_override C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg);
+	rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg);
+	rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg);
+	rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg);
+	rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg);
+	rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg);
+	rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg);
+	rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg);
+	rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg);
+	rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN;
+        memset(rc_channels_override, 0, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
+	memcpy(rc_channels_override, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_raw.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_raw.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_raw.h	(revision 209)
@@ -0,0 +1,462 @@
+// MESSAGE RC_CHANNELS_RAW PACKING
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35
+
+typedef struct MAVLINK_PACKED __mavlink_rc_channels_raw_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
+ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/
+ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/
+} mavlink_rc_channels_raw_t;
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22
+#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN 22
+#define MAVLINK_MSG_ID_35_LEN 22
+#define MAVLINK_MSG_ID_35_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244
+#define MAVLINK_MSG_ID_35_CRC 244
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \
+	35, \
+	"RC_CHANNELS_RAW", \
+	11, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \
+	"RC_CHANNELS_RAW", \
+	11, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \
+         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \
+         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \
+         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \
+         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) }, \
+         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) }, \
+         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \
+         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \
+         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a rc_channels_raw message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
+#else
+	mavlink_rc_channels_raw_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.port = port;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+}
+
+/**
+ * @brief Pack a rc_channels_raw message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t port,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
+#else
+	mavlink_rc_channels_raw_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.port = port;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+}
+
+/**
+ * @brief Encode a rc_channels_raw struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw)
+{
+	return mavlink_msg_rc_channels_raw_pack(system_id, component_id, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
+}
+
+/**
+ * @brief Encode a rc_channels_raw struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw)
+{
+	return mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, chan, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
+}
+
+/**
+ * @brief Send a rc_channels_raw message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+#else
+	mavlink_rc_channels_raw_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_raw = chan1_raw;
+	packet.chan2_raw = chan2_raw;
+	packet.chan3_raw = chan3_raw;
+	packet.chan4_raw = chan4_raw;
+	packet.chan5_raw = chan5_raw;
+	packet.chan6_raw = chan6_raw;
+	packet.chan7_raw = chan7_raw;
+	packet.chan8_raw = chan8_raw;
+	packet.port = port;
+	packet.rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a rc_channels_raw message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_rc_channels_raw_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_raw_t* rc_channels_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_rc_channels_raw_send(chan, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)rc_channels_raw, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_rc_channels_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_uint16_t(buf, 4, chan1_raw);
+	_mav_put_uint16_t(buf, 6, chan2_raw);
+	_mav_put_uint16_t(buf, 8, chan3_raw);
+	_mav_put_uint16_t(buf, 10, chan4_raw);
+	_mav_put_uint16_t(buf, 12, chan5_raw);
+	_mav_put_uint16_t(buf, 14, chan6_raw);
+	_mav_put_uint16_t(buf, 16, chan7_raw);
+	_mav_put_uint16_t(buf, 18, chan8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+#else
+	mavlink_rc_channels_raw_t *packet = (mavlink_rc_channels_raw_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->chan1_raw = chan1_raw;
+	packet->chan2_raw = chan2_raw;
+	packet->chan3_raw = chan3_raw;
+	packet->chan4_raw = chan4_raw;
+	packet->chan5_raw = chan5_raw;
+	packet->chan6_raw = chan6_raw;
+	packet->chan7_raw = chan7_raw;
+	packet->chan8_raw = chan8_raw;
+	packet->port = port;
+	packet->rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RC_CHANNELS_RAW UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from rc_channels_raw message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field port from rc_channels_raw message
+ *
+ * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ */
+static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  20);
+}
+
+/**
+ * @brief Get field chan1_raw from rc_channels_raw message
+ *
+ * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field chan2_raw from rc_channels_raw message
+ *
+ * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field chan3_raw from rc_channels_raw message
+ *
+ * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field chan4_raw from rc_channels_raw message
+ *
+ * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field chan5_raw from rc_channels_raw message
+ *
+ * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field chan6_raw from rc_channels_raw message
+ *
+ * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Get field chan7_raw from rc_channels_raw message
+ *
+ * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field chan8_raw from rc_channels_raw message
+ *
+ * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
+ */
+static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field rssi from rc_channels_raw message
+ *
+ * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  21);
+}
+
+/**
+ * @brief Decode a rc_channels_raw message into a struct
+ *
+ * @param msg The message to decode
+ * @param rc_channels_raw C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t* msg, mavlink_rc_channels_raw_t* rc_channels_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	rc_channels_raw->time_boot_ms = mavlink_msg_rc_channels_raw_get_time_boot_ms(msg);
+	rc_channels_raw->chan1_raw = mavlink_msg_rc_channels_raw_get_chan1_raw(msg);
+	rc_channels_raw->chan2_raw = mavlink_msg_rc_channels_raw_get_chan2_raw(msg);
+	rc_channels_raw->chan3_raw = mavlink_msg_rc_channels_raw_get_chan3_raw(msg);
+	rc_channels_raw->chan4_raw = mavlink_msg_rc_channels_raw_get_chan4_raw(msg);
+	rc_channels_raw->chan5_raw = mavlink_msg_rc_channels_raw_get_chan5_raw(msg);
+	rc_channels_raw->chan6_raw = mavlink_msg_rc_channels_raw_get_chan6_raw(msg);
+	rc_channels_raw->chan7_raw = mavlink_msg_rc_channels_raw_get_chan7_raw(msg);
+	rc_channels_raw->chan8_raw = mavlink_msg_rc_channels_raw_get_chan8_raw(msg);
+	rc_channels_raw->port = mavlink_msg_rc_channels_raw_get_port(msg);
+	rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN;
+        memset(rc_channels_raw, 0, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
+	memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_scaled.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_scaled.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_rc_channels_scaled.h	(revision 209)
@@ -0,0 +1,462 @@
+// MESSAGE RC_CHANNELS_SCALED PACKING
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34
+
+typedef struct MAVLINK_PACKED __mavlink_rc_channels_scaled_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int16_t chan1_scaled; /*< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan2_scaled; /*< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan3_scaled; /*< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan4_scaled; /*< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan5_scaled; /*< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan6_scaled; /*< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan7_scaled; /*< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ int16_t chan8_scaled; /*< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/
+ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/
+ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/
+} mavlink_rc_channels_scaled_t;
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22
+#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN 22
+#define MAVLINK_MSG_ID_34_LEN 22
+#define MAVLINK_MSG_ID_34_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237
+#define MAVLINK_MSG_ID_34_CRC 237
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \
+	34, \
+	"RC_CHANNELS_SCALED", \
+	11, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \
+         { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \
+         { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \
+         { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \
+         { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \
+         { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \
+         { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \
+         { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \
+         { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \
+	"RC_CHANNELS_SCALED", \
+	11, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \
+         { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \
+         { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \
+         { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \
+         { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \
+         { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \
+         { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \
+         { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \
+         { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \
+         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a rc_channels_scaled message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, chan1_scaled);
+	_mav_put_int16_t(buf, 6, chan2_scaled);
+	_mav_put_int16_t(buf, 8, chan3_scaled);
+	_mav_put_int16_t(buf, 10, chan4_scaled);
+	_mav_put_int16_t(buf, 12, chan5_scaled);
+	_mav_put_int16_t(buf, 14, chan6_scaled);
+	_mav_put_int16_t(buf, 16, chan7_scaled);
+	_mav_put_int16_t(buf, 18, chan8_scaled);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
+#else
+	mavlink_rc_channels_scaled_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_scaled = chan1_scaled;
+	packet.chan2_scaled = chan2_scaled;
+	packet.chan3_scaled = chan3_scaled;
+	packet.chan4_scaled = chan4_scaled;
+	packet.chan5_scaled = chan5_scaled;
+	packet.chan6_scaled = chan6_scaled;
+	packet.chan7_scaled = chan7_scaled;
+	packet.chan8_scaled = chan8_scaled;
+	packet.port = port;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+}
+
+/**
+ * @brief Pack a rc_channels_scaled message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t port,int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, chan1_scaled);
+	_mav_put_int16_t(buf, 6, chan2_scaled);
+	_mav_put_int16_t(buf, 8, chan3_scaled);
+	_mav_put_int16_t(buf, 10, chan4_scaled);
+	_mav_put_int16_t(buf, 12, chan5_scaled);
+	_mav_put_int16_t(buf, 14, chan6_scaled);
+	_mav_put_int16_t(buf, 16, chan7_scaled);
+	_mav_put_int16_t(buf, 18, chan8_scaled);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
+#else
+	mavlink_rc_channels_scaled_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_scaled = chan1_scaled;
+	packet.chan2_scaled = chan2_scaled;
+	packet.chan3_scaled = chan3_scaled;
+	packet.chan4_scaled = chan4_scaled;
+	packet.chan5_scaled = chan5_scaled;
+	packet.chan6_scaled = chan6_scaled;
+	packet.chan7_scaled = chan7_scaled;
+	packet.chan8_scaled = chan8_scaled;
+	packet.port = port;
+	packet.rssi = rssi;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+}
+
+/**
+ * @brief Encode a rc_channels_scaled struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_scaled C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
+{
+	return mavlink_msg_rc_channels_scaled_pack(system_id, component_id, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
+}
+
+/**
+ * @brief Encode a rc_channels_scaled struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param rc_channels_scaled C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_rc_channels_scaled_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
+{
+	return mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, chan, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
+}
+
+/**
+ * @brief Send a rc_channels_scaled message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, chan1_scaled);
+	_mav_put_int16_t(buf, 6, chan2_scaled);
+	_mav_put_int16_t(buf, 8, chan3_scaled);
+	_mav_put_int16_t(buf, 10, chan4_scaled);
+	_mav_put_int16_t(buf, 12, chan5_scaled);
+	_mav_put_int16_t(buf, 14, chan6_scaled);
+	_mav_put_int16_t(buf, 16, chan7_scaled);
+	_mav_put_int16_t(buf, 18, chan8_scaled);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+#else
+	mavlink_rc_channels_scaled_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.chan1_scaled = chan1_scaled;
+	packet.chan2_scaled = chan2_scaled;
+	packet.chan3_scaled = chan3_scaled;
+	packet.chan4_scaled = chan4_scaled;
+	packet.chan5_scaled = chan5_scaled;
+	packet.chan6_scaled = chan6_scaled;
+	packet.chan7_scaled = chan7_scaled;
+	packet.chan8_scaled = chan8_scaled;
+	packet.port = port;
+	packet.rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+#endif
+}
+
+/**
+ * @brief Send a rc_channels_scaled message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_rc_channels_scaled_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_rc_channels_scaled_send(chan, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)rc_channels_scaled, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_rc_channels_scaled_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, chan1_scaled);
+	_mav_put_int16_t(buf, 6, chan2_scaled);
+	_mav_put_int16_t(buf, 8, chan3_scaled);
+	_mav_put_int16_t(buf, 10, chan4_scaled);
+	_mav_put_int16_t(buf, 12, chan5_scaled);
+	_mav_put_int16_t(buf, 14, chan6_scaled);
+	_mav_put_int16_t(buf, 16, chan7_scaled);
+	_mav_put_int16_t(buf, 18, chan8_scaled);
+	_mav_put_uint8_t(buf, 20, port);
+	_mav_put_uint8_t(buf, 21, rssi);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+#else
+	mavlink_rc_channels_scaled_t *packet = (mavlink_rc_channels_scaled_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->chan1_scaled = chan1_scaled;
+	packet->chan2_scaled = chan2_scaled;
+	packet->chan3_scaled = chan3_scaled;
+	packet->chan4_scaled = chan4_scaled;
+	packet->chan5_scaled = chan5_scaled;
+	packet->chan6_scaled = chan6_scaled;
+	packet->chan7_scaled = chan7_scaled;
+	packet->chan8_scaled = chan8_scaled;
+	packet->port = port;
+	packet->rssi = rssi;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RC_CHANNELS_SCALED UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from rc_channels_scaled message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field port from rc_channels_scaled message
+ *
+ * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
+ */
+static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  20);
+}
+
+/**
+ * @brief Get field chan1_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  4);
+}
+
+/**
+ * @brief Get field chan2_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  6);
+}
+
+/**
+ * @brief Get field chan3_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field chan4_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field chan5_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field chan6_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Get field chan7_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field chan8_scaled from rc_channels_scaled message
+ *
+ * @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
+ */
+static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  18);
+}
+
+/**
+ * @brief Get field rssi from rc_channels_scaled message
+ *
+ * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
+ */
+static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  21);
+}
+
+/**
+ * @brief Decode a rc_channels_scaled message into a struct
+ *
+ * @param msg The message to decode
+ * @param rc_channels_scaled C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t* msg, mavlink_rc_channels_scaled_t* rc_channels_scaled)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	rc_channels_scaled->time_boot_ms = mavlink_msg_rc_channels_scaled_get_time_boot_ms(msg);
+	rc_channels_scaled->chan1_scaled = mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg);
+	rc_channels_scaled->chan2_scaled = mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg);
+	rc_channels_scaled->chan3_scaled = mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg);
+	rc_channels_scaled->chan4_scaled = mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg);
+	rc_channels_scaled->chan5_scaled = mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg);
+	rc_channels_scaled->chan6_scaled = mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg);
+	rc_channels_scaled->chan7_scaled = mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg);
+	rc_channels_scaled->chan8_scaled = mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg);
+	rc_channels_scaled->port = mavlink_msg_rc_channels_scaled_get_port(msg);
+	rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN;
+        memset(rc_channels_scaled, 0, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
+	memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_request_data_stream.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_request_data_stream.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_request_data_stream.h	(revision 209)
@@ -0,0 +1,312 @@
+// MESSAGE REQUEST_DATA_STREAM PACKING
+
+#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM 66
+
+typedef struct MAVLINK_PACKED __mavlink_request_data_stream_t
+{
+ uint16_t req_message_rate; /*< The requested message rate*/
+ uint8_t target_system; /*< The target requested to send the message stream.*/
+ uint8_t target_component; /*< The target requested to send the message stream.*/
+ uint8_t req_stream_id; /*< The ID of the requested data stream*/
+ uint8_t start_stop; /*< 1 to start sending, 0 to stop sending.*/
+} mavlink_request_data_stream_t;
+
+#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6
+#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN 6
+#define MAVLINK_MSG_ID_66_LEN 6
+#define MAVLINK_MSG_ID_66_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC 148
+#define MAVLINK_MSG_ID_66_CRC 148
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \
+	66, \
+	"REQUEST_DATA_STREAM", \
+	5, \
+	{  { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \
+         { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \
+         { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \
+	"REQUEST_DATA_STREAM", \
+	5, \
+	{  { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \
+         { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \
+         { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a request_data_stream message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system The target requested to send the message stream.
+ * @param target_component The target requested to send the message stream.
+ * @param req_stream_id The ID of the requested data stream
+ * @param req_message_rate The requested message rate
+ * @param start_stop 1 to start sending, 0 to stop sending.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, req_message_rate);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_uint8_t(buf, 4, req_stream_id);
+	_mav_put_uint8_t(buf, 5, start_stop);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN);
+#else
+	mavlink_request_data_stream_t packet;
+	packet.req_message_rate = req_message_rate;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.req_stream_id = req_stream_id;
+	packet.start_stop = start_stop;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+}
+
+/**
+ * @brief Pack a request_data_stream message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system The target requested to send the message stream.
+ * @param target_component The target requested to send the message stream.
+ * @param req_stream_id The ID of the requested data stream
+ * @param req_message_rate The requested message rate
+ * @param start_stop 1 to start sending, 0 to stop sending.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint8_t req_stream_id,uint16_t req_message_rate,uint8_t start_stop)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, req_message_rate);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_uint8_t(buf, 4, req_stream_id);
+	_mav_put_uint8_t(buf, 5, start_stop);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN);
+#else
+	mavlink_request_data_stream_t packet;
+	packet.req_message_rate = req_message_rate;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.req_stream_id = req_stream_id;
+	packet.start_stop = start_stop;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+}
+
+/**
+ * @brief Encode a request_data_stream struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param request_data_stream C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_request_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_request_data_stream_t* request_data_stream)
+{
+	return mavlink_msg_request_data_stream_pack(system_id, component_id, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop);
+}
+
+/**
+ * @brief Encode a request_data_stream struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param request_data_stream C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_request_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_request_data_stream_t* request_data_stream)
+{
+	return mavlink_msg_request_data_stream_pack_chan(system_id, component_id, chan, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop);
+}
+
+/**
+ * @brief Send a request_data_stream message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system The target requested to send the message stream.
+ * @param target_component The target requested to send the message stream.
+ * @param req_stream_id The ID of the requested data stream
+ * @param req_message_rate The requested message rate
+ * @param start_stop 1 to start sending, 0 to stop sending.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN];
+	_mav_put_uint16_t(buf, 0, req_message_rate);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_uint8_t(buf, 4, req_stream_id);
+	_mav_put_uint8_t(buf, 5, start_stop);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+#else
+	mavlink_request_data_stream_t packet;
+	packet.req_message_rate = req_message_rate;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.req_stream_id = req_stream_id;
+	packet.start_stop = start_stop;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+#endif
+}
+
+/**
+ * @brief Send a request_data_stream message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_request_data_stream_send_struct(mavlink_channel_t chan, const mavlink_request_data_stream_t* request_data_stream)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_request_data_stream_send(chan, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)request_data_stream, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_request_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, req_message_rate);
+	_mav_put_uint8_t(buf, 2, target_system);
+	_mav_put_uint8_t(buf, 3, target_component);
+	_mav_put_uint8_t(buf, 4, req_stream_id);
+	_mav_put_uint8_t(buf, 5, start_stop);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+#else
+	mavlink_request_data_stream_t *packet = (mavlink_request_data_stream_t *)msgbuf;
+	packet->req_message_rate = req_message_rate;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->req_stream_id = req_stream_id;
+	packet->start_stop = start_stop;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE REQUEST_DATA_STREAM UNPACKING
+
+
+/**
+ * @brief Get field target_system from request_data_stream message
+ *
+ * @return The target requested to send the message stream.
+ */
+static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_component from request_data_stream message
+ *
+ * @return The target requested to send the message stream.
+ */
+static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field req_stream_id from request_data_stream message
+ *
+ * @return The ID of the requested data stream
+ */
+static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field req_message_rate from request_data_stream message
+ *
+ * @return The requested message rate
+ */
+static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field start_stop from request_data_stream message
+ *
+ * @return 1 to start sending, 0 to stop sending.
+ */
+static inline uint8_t mavlink_msg_request_data_stream_get_start_stop(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Decode a request_data_stream message into a struct
+ *
+ * @param msg The message to decode
+ * @param request_data_stream C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_request_data_stream_decode(const mavlink_message_t* msg, mavlink_request_data_stream_t* request_data_stream)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	request_data_stream->req_message_rate = mavlink_msg_request_data_stream_get_req_message_rate(msg);
+	request_data_stream->target_system = mavlink_msg_request_data_stream_get_target_system(msg);
+	request_data_stream->target_component = mavlink_msg_request_data_stream_get_target_component(msg);
+	request_data_stream->req_stream_id = mavlink_msg_request_data_stream_get_req_stream_id(msg);
+	request_data_stream->start_stop = mavlink_msg_request_data_stream_get_start_stop(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN;
+        memset(request_data_stream, 0, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN);
+	memcpy(request_data_stream, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_resource_request.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_resource_request.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_resource_request.h	(revision 209)
@@ -0,0 +1,305 @@
+// MESSAGE RESOURCE_REQUEST PACKING
+
+#define MAVLINK_MSG_ID_RESOURCE_REQUEST 142
+
+typedef struct MAVLINK_PACKED __mavlink_resource_request_t
+{
+ uint8_t request_id; /*< Request ID. This ID should be re-used when sending back URI contents*/
+ uint8_t uri_type; /*< The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary*/
+ uint8_t uri[120]; /*< The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)*/
+ uint8_t transfer_type; /*< The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.*/
+ uint8_t storage[120]; /*< The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).*/
+} mavlink_resource_request_t;
+
+#define MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN 243
+#define MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN 243
+#define MAVLINK_MSG_ID_142_LEN 243
+#define MAVLINK_MSG_ID_142_MIN_LEN 243
+
+#define MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC 72
+#define MAVLINK_MSG_ID_142_CRC 72
+
+#define MAVLINK_MSG_RESOURCE_REQUEST_FIELD_URI_LEN 120
+#define MAVLINK_MSG_RESOURCE_REQUEST_FIELD_STORAGE_LEN 120
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST { \
+	142, \
+	"RESOURCE_REQUEST", \
+	5, \
+	{  { "request_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_resource_request_t, request_id) }, \
+         { "uri_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_resource_request_t, uri_type) }, \
+         { "uri", NULL, MAVLINK_TYPE_UINT8_T, 120, 2, offsetof(mavlink_resource_request_t, uri) }, \
+         { "transfer_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_resource_request_t, transfer_type) }, \
+         { "storage", NULL, MAVLINK_TYPE_UINT8_T, 120, 123, offsetof(mavlink_resource_request_t, storage) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST { \
+	"RESOURCE_REQUEST", \
+	5, \
+	{  { "request_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_resource_request_t, request_id) }, \
+         { "uri_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_resource_request_t, uri_type) }, \
+         { "uri", NULL, MAVLINK_TYPE_UINT8_T, 120, 2, offsetof(mavlink_resource_request_t, uri) }, \
+         { "transfer_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_resource_request_t, transfer_type) }, \
+         { "storage", NULL, MAVLINK_TYPE_UINT8_T, 120, 123, offsetof(mavlink_resource_request_t, storage) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a resource_request message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param request_id Request ID. This ID should be re-used when sending back URI contents
+ * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary
+ * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)
+ * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.
+ * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_resource_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN];
+	_mav_put_uint8_t(buf, 0, request_id);
+	_mav_put_uint8_t(buf, 1, uri_type);
+	_mav_put_uint8_t(buf, 122, transfer_type);
+	_mav_put_uint8_t_array(buf, 2, uri, 120);
+	_mav_put_uint8_t_array(buf, 123, storage, 120);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN);
+#else
+	mavlink_resource_request_t packet;
+	packet.request_id = request_id;
+	packet.uri_type = uri_type;
+	packet.transfer_type = transfer_type;
+	mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120);
+	mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+}
+
+/**
+ * @brief Pack a resource_request message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param request_id Request ID. This ID should be re-used when sending back URI contents
+ * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary
+ * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)
+ * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.
+ * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_resource_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t request_id,uint8_t uri_type,const uint8_t *uri,uint8_t transfer_type,const uint8_t *storage)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN];
+	_mav_put_uint8_t(buf, 0, request_id);
+	_mav_put_uint8_t(buf, 1, uri_type);
+	_mav_put_uint8_t(buf, 122, transfer_type);
+	_mav_put_uint8_t_array(buf, 2, uri, 120);
+	_mav_put_uint8_t_array(buf, 123, storage, 120);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN);
+#else
+	mavlink_resource_request_t packet;
+	packet.request_id = request_id;
+	packet.uri_type = uri_type;
+	packet.transfer_type = transfer_type;
+	mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120);
+	mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+}
+
+/**
+ * @brief Encode a resource_request struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param resource_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_resource_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_resource_request_t* resource_request)
+{
+	return mavlink_msg_resource_request_pack(system_id, component_id, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage);
+}
+
+/**
+ * @brief Encode a resource_request struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param resource_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_resource_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_resource_request_t* resource_request)
+{
+	return mavlink_msg_resource_request_pack_chan(system_id, component_id, chan, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage);
+}
+
+/**
+ * @brief Send a resource_request message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param request_id Request ID. This ID should be re-used when sending back URI contents
+ * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary
+ * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)
+ * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.
+ * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_resource_request_send(mavlink_channel_t chan, uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN];
+	_mav_put_uint8_t(buf, 0, request_id);
+	_mav_put_uint8_t(buf, 1, uri_type);
+	_mav_put_uint8_t(buf, 122, transfer_type);
+	_mav_put_uint8_t_array(buf, 2, uri, 120);
+	_mav_put_uint8_t_array(buf, 123, storage, 120);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+#else
+	mavlink_resource_request_t packet;
+	packet.request_id = request_id;
+	packet.uri_type = uri_type;
+	packet.transfer_type = transfer_type;
+	mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120);
+	mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a resource_request message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_resource_request_send_struct(mavlink_channel_t chan, const mavlink_resource_request_t* resource_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_resource_request_send(chan, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)resource_request, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_resource_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, request_id);
+	_mav_put_uint8_t(buf, 1, uri_type);
+	_mav_put_uint8_t(buf, 122, transfer_type);
+	_mav_put_uint8_t_array(buf, 2, uri, 120);
+	_mav_put_uint8_t_array(buf, 123, storage, 120);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+#else
+	mavlink_resource_request_t *packet = (mavlink_resource_request_t *)msgbuf;
+	packet->request_id = request_id;
+	packet->uri_type = uri_type;
+	packet->transfer_type = transfer_type;
+	mav_array_memcpy(packet->uri, uri, sizeof(uint8_t)*120);
+	mav_array_memcpy(packet->storage, storage, sizeof(uint8_t)*120);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE RESOURCE_REQUEST UNPACKING
+
+
+/**
+ * @brief Get field request_id from resource_request message
+ *
+ * @return Request ID. This ID should be re-used when sending back URI contents
+ */
+static inline uint8_t mavlink_msg_resource_request_get_request_id(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field uri_type from resource_request message
+ *
+ * @return The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary
+ */
+static inline uint8_t mavlink_msg_resource_request_get_uri_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  1);
+}
+
+/**
+ * @brief Get field uri from resource_request message
+ *
+ * @return The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)
+ */
+static inline uint16_t mavlink_msg_resource_request_get_uri(const mavlink_message_t* msg, uint8_t *uri)
+{
+	return _MAV_RETURN_uint8_t_array(msg, uri, 120,  2);
+}
+
+/**
+ * @brief Get field transfer_type from resource_request message
+ *
+ * @return The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.
+ */
+static inline uint8_t mavlink_msg_resource_request_get_transfer_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  122);
+}
+
+/**
+ * @brief Get field storage from resource_request message
+ *
+ * @return The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).
+ */
+static inline uint16_t mavlink_msg_resource_request_get_storage(const mavlink_message_t* msg, uint8_t *storage)
+{
+	return _MAV_RETURN_uint8_t_array(msg, storage, 120,  123);
+}
+
+/**
+ * @brief Decode a resource_request message into a struct
+ *
+ * @param msg The message to decode
+ * @param resource_request C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_resource_request_decode(const mavlink_message_t* msg, mavlink_resource_request_t* resource_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	resource_request->request_id = mavlink_msg_resource_request_get_request_id(msg);
+	resource_request->uri_type = mavlink_msg_resource_request_get_uri_type(msg);
+	mavlink_msg_resource_request_get_uri(msg, resource_request->uri);
+	resource_request->transfer_type = mavlink_msg_resource_request_get_transfer_type(msg);
+	mavlink_msg_resource_request_get_storage(msg, resource_request->storage);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN;
+        memset(resource_request, 0, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN);
+	memcpy(resource_request, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_allowed_area.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_allowed_area.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_allowed_area.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE SAFETY_ALLOWED_AREA PACKING
+
+#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 55
+
+typedef struct MAVLINK_PACKED __mavlink_safety_allowed_area_t
+{
+ float p1x; /*< x position 1 / Latitude 1*/
+ float p1y; /*< y position 1 / Longitude 1*/
+ float p1z; /*< z position 1 / Altitude 1*/
+ float p2x; /*< x position 2 / Latitude 2*/
+ float p2y; /*< y position 2 / Longitude 2*/
+ float p2z; /*< z position 2 / Altitude 2*/
+ uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/
+} mavlink_safety_allowed_area_t;
+
+#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25
+#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN 25
+#define MAVLINK_MSG_ID_55_LEN 25
+#define MAVLINK_MSG_ID_55_MIN_LEN 25
+
+#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC 3
+#define MAVLINK_MSG_ID_55_CRC 3
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \
+	55, \
+	"SAFETY_ALLOWED_AREA", \
+	7, \
+	{  { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \
+         { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \
+         { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \
+         { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \
+         { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_allowed_area_t, p2y) }, \
+         { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_allowed_area_t, p2z) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \
+	"SAFETY_ALLOWED_AREA", \
+	7, \
+	{  { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \
+         { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \
+         { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \
+         { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \
+         { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_allowed_area_t, p2y) }, \
+         { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_allowed_area_t, p2z) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a safety_allowed_area message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN);
+#else
+	mavlink_safety_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+}
+
+/**
+ * @brief Pack a safety_allowed_area message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN);
+#else
+	mavlink_safety_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+}
+
+/**
+ * @brief Encode a safety_allowed_area struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param safety_allowed_area C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area)
+{
+	return mavlink_msg_safety_allowed_area_pack(system_id, component_id, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z);
+}
+
+/**
+ * @brief Encode a safety_allowed_area struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param safety_allowed_area C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_safety_allowed_area_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area)
+{
+	return mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z);
+}
+
+/**
+ * @brief Send a safety_allowed_area message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+#else
+	mavlink_safety_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a safety_allowed_area message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_safety_allowed_area_send_struct(mavlink_channel_t chan, const mavlink_safety_allowed_area_t* safety_allowed_area)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_safety_allowed_area_send(chan, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)safety_allowed_area, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_safety_allowed_area_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+#else
+	mavlink_safety_allowed_area_t *packet = (mavlink_safety_allowed_area_t *)msgbuf;
+	packet->p1x = p1x;
+	packet->p1y = p1y;
+	packet->p1z = p1z;
+	packet->p2x = p2x;
+	packet->p2y = p2y;
+	packet->p2z = p2z;
+	packet->frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SAFETY_ALLOWED_AREA UNPACKING
+
+
+/**
+ * @brief Get field frame from safety_allowed_area message
+ *
+ * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ */
+static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  24);
+}
+
+/**
+ * @brief Get field p1x from safety_allowed_area message
+ *
+ * @return x position 1 / Latitude 1
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field p1y from safety_allowed_area message
+ *
+ * @return y position 1 / Longitude 1
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field p1z from safety_allowed_area message
+ *
+ * @return z position 1 / Altitude 1
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field p2x from safety_allowed_area message
+ *
+ * @return x position 2 / Latitude 2
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field p2y from safety_allowed_area message
+ *
+ * @return y position 2 / Longitude 2
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field p2z from safety_allowed_area message
+ *
+ * @return z position 2 / Altitude 2
+ */
+static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Decode a safety_allowed_area message into a struct
+ *
+ * @param msg The message to decode
+ * @param safety_allowed_area C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_safety_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_allowed_area_t* safety_allowed_area)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	safety_allowed_area->p1x = mavlink_msg_safety_allowed_area_get_p1x(msg);
+	safety_allowed_area->p1y = mavlink_msg_safety_allowed_area_get_p1y(msg);
+	safety_allowed_area->p1z = mavlink_msg_safety_allowed_area_get_p1z(msg);
+	safety_allowed_area->p2x = mavlink_msg_safety_allowed_area_get_p2x(msg);
+	safety_allowed_area->p2y = mavlink_msg_safety_allowed_area_get_p2y(msg);
+	safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg);
+	safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN? msg->len : MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN;
+        memset(safety_allowed_area, 0, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN);
+	memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_set_allowed_area.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_set_allowed_area.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_safety_set_allowed_area.h	(revision 209)
@@ -0,0 +1,412 @@
+// MESSAGE SAFETY_SET_ALLOWED_AREA PACKING
+
+#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 54
+
+typedef struct MAVLINK_PACKED __mavlink_safety_set_allowed_area_t
+{
+ float p1x; /*< x position 1 / Latitude 1*/
+ float p1y; /*< y position 1 / Longitude 1*/
+ float p1z; /*< z position 1 / Altitude 1*/
+ float p2x; /*< x position 2 / Latitude 2*/
+ float p2y; /*< y position 2 / Longitude 2*/
+ float p2z; /*< z position 2 / Altitude 2*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/
+} mavlink_safety_set_allowed_area_t;
+
+#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27
+#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN 27
+#define MAVLINK_MSG_ID_54_LEN 27
+#define MAVLINK_MSG_ID_54_MIN_LEN 27
+
+#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC 15
+#define MAVLINK_MSG_ID_54_CRC 15
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \
+	54, \
+	"SAFETY_SET_ALLOWED_AREA", \
+	9, \
+	{  { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \
+         { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \
+         { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \
+         { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \
+         { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \
+         { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \
+	"SAFETY_SET_ALLOWED_AREA", \
+	9, \
+	{  { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \
+         { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \
+         { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \
+         { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \
+         { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \
+         { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \
+         { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a safety_set_allowed_area message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, target_system);
+	_mav_put_uint8_t(buf, 25, target_component);
+	_mav_put_uint8_t(buf, 26, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
+#else
+	mavlink_safety_set_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+}
+
+/**
+ * @brief Pack a safety_set_allowed_area message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, target_system);
+	_mav_put_uint8_t(buf, 25, target_component);
+	_mav_put_uint8_t(buf, 26, frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
+#else
+	mavlink_safety_set_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+}
+
+/**
+ * @brief Encode a safety_set_allowed_area struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param safety_set_allowed_area C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
+{
+	return mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
+}
+
+/**
+ * @brief Encode a safety_set_allowed_area struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param safety_set_allowed_area C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
+{
+	return mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
+}
+
+/**
+ * @brief Send a safety_set_allowed_area message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ * @param p1x x position 1 / Latitude 1
+ * @param p1y y position 1 / Longitude 1
+ * @param p1z z position 1 / Altitude 1
+ * @param p2x x position 2 / Latitude 2
+ * @param p2y y position 2 / Longitude 2
+ * @param p2z z position 2 / Altitude 2
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN];
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, target_system);
+	_mav_put_uint8_t(buf, 25, target_component);
+	_mav_put_uint8_t(buf, 26, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+#else
+	mavlink_safety_set_allowed_area_t packet;
+	packet.p1x = p1x;
+	packet.p1y = p1y;
+	packet.p1z = p1z;
+	packet.p2x = p2x;
+	packet.p2y = p2y;
+	packet.p2z = p2z;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a safety_set_allowed_area message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_safety_set_allowed_area_send_struct(mavlink_channel_t chan, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_safety_set_allowed_area_send(chan, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)safety_set_allowed_area, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_safety_set_allowed_area_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, p1x);
+	_mav_put_float(buf, 4, p1y);
+	_mav_put_float(buf, 8, p1z);
+	_mav_put_float(buf, 12, p2x);
+	_mav_put_float(buf, 16, p2y);
+	_mav_put_float(buf, 20, p2z);
+	_mav_put_uint8_t(buf, 24, target_system);
+	_mav_put_uint8_t(buf, 25, target_component);
+	_mav_put_uint8_t(buf, 26, frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+#else
+	mavlink_safety_set_allowed_area_t *packet = (mavlink_safety_set_allowed_area_t *)msgbuf;
+	packet->p1x = p1x;
+	packet->p1y = p1y;
+	packet->p1z = p1z;
+	packet->p2x = p2x;
+	packet->p2y = p2y;
+	packet->p2z = p2z;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->frame = frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SAFETY_SET_ALLOWED_AREA UNPACKING
+
+
+/**
+ * @brief Get field target_system from safety_set_allowed_area message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  24);
+}
+
+/**
+ * @brief Get field target_component from safety_set_allowed_area message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  25);
+}
+
+/**
+ * @brief Get field frame from safety_set_allowed_area message
+ *
+ * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
+ */
+static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  26);
+}
+
+/**
+ * @brief Get field p1x from safety_set_allowed_area message
+ *
+ * @return x position 1 / Latitude 1
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field p1y from safety_set_allowed_area message
+ *
+ * @return y position 1 / Longitude 1
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field p1z from safety_set_allowed_area message
+ *
+ * @return z position 1 / Altitude 1
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field p2x from safety_set_allowed_area message
+ *
+ * @return x position 2 / Latitude 2
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field p2y from safety_set_allowed_area message
+ *
+ * @return y position 2 / Longitude 2
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field p2z from safety_set_allowed_area message
+ *
+ * @return z position 2 / Altitude 2
+ */
+static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Decode a safety_set_allowed_area message into a struct
+ *
+ * @param msg The message to decode
+ * @param safety_set_allowed_area C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_safety_set_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	safety_set_allowed_area->p1x = mavlink_msg_safety_set_allowed_area_get_p1x(msg);
+	safety_set_allowed_area->p1y = mavlink_msg_safety_set_allowed_area_get_p1y(msg);
+	safety_set_allowed_area->p1z = mavlink_msg_safety_set_allowed_area_get_p1z(msg);
+	safety_set_allowed_area->p2x = mavlink_msg_safety_set_allowed_area_get_p2x(msg);
+	safety_set_allowed_area->p2y = mavlink_msg_safety_set_allowed_area_get_p2y(msg);
+	safety_set_allowed_area->p2z = mavlink_msg_safety_set_allowed_area_get_p2z(msg);
+	safety_set_allowed_area->target_system = mavlink_msg_safety_set_allowed_area_get_target_system(msg);
+	safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg);
+	safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN? msg->len : MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN;
+        memset(safety_set_allowed_area, 0, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
+	memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE SCALED_IMU PACKING
+
+#define MAVLINK_MSG_ID_SCALED_IMU 26
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_imu_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int16_t xacc; /*< X acceleration (mg)*/
+ int16_t yacc; /*< Y acceleration (mg)*/
+ int16_t zacc; /*< Z acceleration (mg)*/
+ int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/
+ int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/
+ int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/
+ int16_t xmag; /*< X Magnetic field (milli tesla)*/
+ int16_t ymag; /*< Y Magnetic field (milli tesla)*/
+ int16_t zmag; /*< Z Magnetic field (milli tesla)*/
+} mavlink_scaled_imu_t;
+
+#define MAVLINK_MSG_ID_SCALED_IMU_LEN 22
+#define MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN 22
+#define MAVLINK_MSG_ID_26_LEN 22
+#define MAVLINK_MSG_ID_26_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_SCALED_IMU_CRC 170
+#define MAVLINK_MSG_ID_26_CRC 170
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU { \
+	26, \
+	"SCALED_IMU", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu_t, zmag) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU { \
+	"SCALED_IMU", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu_t, zmag) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_imu message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN);
+#else
+	mavlink_scaled_imu_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+}
+
+/**
+ * @brief Pack a scaled_imu message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN);
+#else
+	mavlink_scaled_imu_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+}
+
+/**
+ * @brief Encode a scaled_imu struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu_t* scaled_imu)
+{
+	return mavlink_msg_scaled_imu_pack(system_id, component_id, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag);
+}
+
+/**
+ * @brief Encode a scaled_imu struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu_t* scaled_imu)
+{
+	return mavlink_msg_scaled_imu_pack_chan(system_id, component_id, chan, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag);
+}
+
+/**
+ * @brief Send a scaled_imu message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+#else
+	mavlink_scaled_imu_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_imu message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_imu_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu_t* scaled_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_imu_send(chan, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)scaled_imu, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+#else
+	mavlink_scaled_imu_t *packet = (mavlink_scaled_imu_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_IMU UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_imu message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_imu_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from scaled_imu message
+ *
+ * @return X acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  4);
+}
+
+/**
+ * @brief Get field yacc from scaled_imu message
+ *
+ * @return Y acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  6);
+}
+
+/**
+ * @brief Get field zacc from scaled_imu message
+ *
+ * @return Z acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field xgyro from scaled_imu message
+ *
+ * @return Angular speed around X axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field ygyro from scaled_imu message
+ *
+ * @return Angular speed around Y axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field zgyro from scaled_imu message
+ *
+ * @return Angular speed around Z axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Get field xmag from scaled_imu message
+ *
+ * @return X Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field ymag from scaled_imu message
+ *
+ * @return Y Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  18);
+}
+
+/**
+ * @brief Get field zmag from scaled_imu message
+ *
+ * @return Z Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Decode a scaled_imu message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_imu C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_imu_decode(const mavlink_message_t* msg, mavlink_scaled_imu_t* scaled_imu)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_imu->time_boot_ms = mavlink_msg_scaled_imu_get_time_boot_ms(msg);
+	scaled_imu->xacc = mavlink_msg_scaled_imu_get_xacc(msg);
+	scaled_imu->yacc = mavlink_msg_scaled_imu_get_yacc(msg);
+	scaled_imu->zacc = mavlink_msg_scaled_imu_get_zacc(msg);
+	scaled_imu->xgyro = mavlink_msg_scaled_imu_get_xgyro(msg);
+	scaled_imu->ygyro = mavlink_msg_scaled_imu_get_ygyro(msg);
+	scaled_imu->zgyro = mavlink_msg_scaled_imu_get_zgyro(msg);
+	scaled_imu->xmag = mavlink_msg_scaled_imu_get_xmag(msg);
+	scaled_imu->ymag = mavlink_msg_scaled_imu_get_ymag(msg);
+	scaled_imu->zmag = mavlink_msg_scaled_imu_get_zmag(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU_LEN;
+        memset(scaled_imu, 0, MAVLINK_MSG_ID_SCALED_IMU_LEN);
+	memcpy(scaled_imu, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu2.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu2.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu2.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE SCALED_IMU2 PACKING
+
+#define MAVLINK_MSG_ID_SCALED_IMU2 116
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_imu2_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int16_t xacc; /*< X acceleration (mg)*/
+ int16_t yacc; /*< Y acceleration (mg)*/
+ int16_t zacc; /*< Z acceleration (mg)*/
+ int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/
+ int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/
+ int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/
+ int16_t xmag; /*< X Magnetic field (milli tesla)*/
+ int16_t ymag; /*< Y Magnetic field (milli tesla)*/
+ int16_t zmag; /*< Z Magnetic field (milli tesla)*/
+} mavlink_scaled_imu2_t;
+
+#define MAVLINK_MSG_ID_SCALED_IMU2_LEN 22
+#define MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN 22
+#define MAVLINK_MSG_ID_116_LEN 22
+#define MAVLINK_MSG_ID_116_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_SCALED_IMU2_CRC 76
+#define MAVLINK_MSG_ID_116_CRC 76
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU2 { \
+	116, \
+	"SCALED_IMU2", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu2_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu2_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu2_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu2_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu2_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu2_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu2_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu2_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu2_t, zmag) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU2 { \
+	"SCALED_IMU2", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu2_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu2_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu2_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu2_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu2_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu2_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu2_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu2_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu2_t, zmag) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_imu2 message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
+#else
+	mavlink_scaled_imu2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+}
+
+/**
+ * @brief Pack a scaled_imu2 message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
+#else
+	mavlink_scaled_imu2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+}
+
+/**
+ * @brief Encode a scaled_imu2 struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu2 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2)
+{
+	return mavlink_msg_scaled_imu2_pack(system_id, component_id, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag);
+}
+
+/**
+ * @brief Encode a scaled_imu2 struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu2 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2)
+{
+	return mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, chan, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag);
+}
+
+/**
+ * @brief Send a scaled_imu2 message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_imu2_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+#else
+	mavlink_scaled_imu2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_imu2 message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_imu2_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu2_t* scaled_imu2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_imu2_send(chan, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)scaled_imu2, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_IMU2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_imu2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+#else
+	mavlink_scaled_imu2_t *packet = (mavlink_scaled_imu2_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_IMU2 UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_imu2 message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from scaled_imu2 message
+ *
+ * @return X acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  4);
+}
+
+/**
+ * @brief Get field yacc from scaled_imu2 message
+ *
+ * @return Y acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  6);
+}
+
+/**
+ * @brief Get field zacc from scaled_imu2 message
+ *
+ * @return Z acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field xgyro from scaled_imu2 message
+ *
+ * @return Angular speed around X axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field ygyro from scaled_imu2 message
+ *
+ * @return Angular speed around Y axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field zgyro from scaled_imu2 message
+ *
+ * @return Angular speed around Z axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Get field xmag from scaled_imu2 message
+ *
+ * @return X Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field ymag from scaled_imu2 message
+ *
+ * @return Y Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  18);
+}
+
+/**
+ * @brief Get field zmag from scaled_imu2 message
+ *
+ * @return Z Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu2_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Decode a scaled_imu2 message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_imu2 C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_imu2_decode(const mavlink_message_t* msg, mavlink_scaled_imu2_t* scaled_imu2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_imu2->time_boot_ms = mavlink_msg_scaled_imu2_get_time_boot_ms(msg);
+	scaled_imu2->xacc = mavlink_msg_scaled_imu2_get_xacc(msg);
+	scaled_imu2->yacc = mavlink_msg_scaled_imu2_get_yacc(msg);
+	scaled_imu2->zacc = mavlink_msg_scaled_imu2_get_zacc(msg);
+	scaled_imu2->xgyro = mavlink_msg_scaled_imu2_get_xgyro(msg);
+	scaled_imu2->ygyro = mavlink_msg_scaled_imu2_get_ygyro(msg);
+	scaled_imu2->zgyro = mavlink_msg_scaled_imu2_get_zgyro(msg);
+	scaled_imu2->xmag = mavlink_msg_scaled_imu2_get_xmag(msg);
+	scaled_imu2->ymag = mavlink_msg_scaled_imu2_get_ymag(msg);
+	scaled_imu2->zmag = mavlink_msg_scaled_imu2_get_zmag(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU2_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU2_LEN;
+        memset(scaled_imu2, 0, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
+	memcpy(scaled_imu2, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu3.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu3.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_imu3.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE SCALED_IMU3 PACKING
+
+#define MAVLINK_MSG_ID_SCALED_IMU3 129
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_imu3_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ int16_t xacc; /*< X acceleration (mg)*/
+ int16_t yacc; /*< Y acceleration (mg)*/
+ int16_t zacc; /*< Z acceleration (mg)*/
+ int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/
+ int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/
+ int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/
+ int16_t xmag; /*< X Magnetic field (milli tesla)*/
+ int16_t ymag; /*< Y Magnetic field (milli tesla)*/
+ int16_t zmag; /*< Z Magnetic field (milli tesla)*/
+} mavlink_scaled_imu3_t;
+
+#define MAVLINK_MSG_ID_SCALED_IMU3_LEN 22
+#define MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN 22
+#define MAVLINK_MSG_ID_129_LEN 22
+#define MAVLINK_MSG_ID_129_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_SCALED_IMU3_CRC 46
+#define MAVLINK_MSG_ID_129_CRC 46
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU3 { \
+	129, \
+	"SCALED_IMU3", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu3_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu3_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu3_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu3_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu3_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu3_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu3_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu3_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu3_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu3_t, zmag) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_IMU3 { \
+	"SCALED_IMU3", \
+	10, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu3_t, time_boot_ms) }, \
+         { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu3_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu3_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu3_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu3_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu3_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu3_t, zgyro) }, \
+         { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu3_t, xmag) }, \
+         { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu3_t, ymag) }, \
+         { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu3_t, zmag) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_imu3 message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN);
+#else
+	mavlink_scaled_imu3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+}
+
+/**
+ * @brief Pack a scaled_imu3 message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_imu3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN);
+#else
+	mavlink_scaled_imu3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+}
+
+/**
+ * @brief Encode a scaled_imu3 struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu3 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu3_t* scaled_imu3)
+{
+	return mavlink_msg_scaled_imu3_pack(system_id, component_id, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag);
+}
+
+/**
+ * @brief Encode a scaled_imu3 struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_imu3 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_imu3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu3_t* scaled_imu3)
+{
+	return mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, chan, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag);
+}
+
+/**
+ * @brief Send a scaled_imu3 message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param xacc X acceleration (mg)
+ * @param yacc Y acceleration (mg)
+ * @param zacc Z acceleration (mg)
+ * @param xgyro Angular speed around X axis (millirad /sec)
+ * @param ygyro Angular speed around Y axis (millirad /sec)
+ * @param zgyro Angular speed around Z axis (millirad /sec)
+ * @param xmag X Magnetic field (milli tesla)
+ * @param ymag Y Magnetic field (milli tesla)
+ * @param zmag Z Magnetic field (milli tesla)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_imu3_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+#else
+	mavlink_scaled_imu3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.xmag = xmag;
+	packet.ymag = ymag;
+	packet.zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_imu3 message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_imu3_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu3_t* scaled_imu3)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_imu3_send(chan, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)scaled_imu3, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_IMU3_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_imu3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int16_t(buf, 4, xacc);
+	_mav_put_int16_t(buf, 6, yacc);
+	_mav_put_int16_t(buf, 8, zacc);
+	_mav_put_int16_t(buf, 10, xgyro);
+	_mav_put_int16_t(buf, 12, ygyro);
+	_mav_put_int16_t(buf, 14, zgyro);
+	_mav_put_int16_t(buf, 16, xmag);
+	_mav_put_int16_t(buf, 18, ymag);
+	_mav_put_int16_t(buf, 20, zmag);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+#else
+	mavlink_scaled_imu3_t *packet = (mavlink_scaled_imu3_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->xmag = xmag;
+	packet->ymag = ymag;
+	packet->zmag = zmag;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_IMU3 UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_imu3 message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_imu3_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field xacc from scaled_imu3 message
+ *
+ * @return X acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  4);
+}
+
+/**
+ * @brief Get field yacc from scaled_imu3 message
+ *
+ * @return Y acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  6);
+}
+
+/**
+ * @brief Get field zacc from scaled_imu3 message
+ *
+ * @return Z acceleration (mg)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  8);
+}
+
+/**
+ * @brief Get field xgyro from scaled_imu3 message
+ *
+ * @return Angular speed around X axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  10);
+}
+
+/**
+ * @brief Get field ygyro from scaled_imu3 message
+ *
+ * @return Angular speed around Y axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Get field zgyro from scaled_imu3 message
+ *
+ * @return Angular speed around Z axis (millirad /sec)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  14);
+}
+
+/**
+ * @brief Get field xmag from scaled_imu3 message
+ *
+ * @return X Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_xmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field ymag from scaled_imu3 message
+ *
+ * @return Y Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_ymag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  18);
+}
+
+/**
+ * @brief Get field zmag from scaled_imu3 message
+ *
+ * @return Z Magnetic field (milli tesla)
+ */
+static inline int16_t mavlink_msg_scaled_imu3_get_zmag(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  20);
+}
+
+/**
+ * @brief Decode a scaled_imu3 message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_imu3 C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_imu3_decode(const mavlink_message_t* msg, mavlink_scaled_imu3_t* scaled_imu3)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_imu3->time_boot_ms = mavlink_msg_scaled_imu3_get_time_boot_ms(msg);
+	scaled_imu3->xacc = mavlink_msg_scaled_imu3_get_xacc(msg);
+	scaled_imu3->yacc = mavlink_msg_scaled_imu3_get_yacc(msg);
+	scaled_imu3->zacc = mavlink_msg_scaled_imu3_get_zacc(msg);
+	scaled_imu3->xgyro = mavlink_msg_scaled_imu3_get_xgyro(msg);
+	scaled_imu3->ygyro = mavlink_msg_scaled_imu3_get_ygyro(msg);
+	scaled_imu3->zgyro = mavlink_msg_scaled_imu3_get_zgyro(msg);
+	scaled_imu3->xmag = mavlink_msg_scaled_imu3_get_xmag(msg);
+	scaled_imu3->ymag = mavlink_msg_scaled_imu3_get_ymag(msg);
+	scaled_imu3->zmag = mavlink_msg_scaled_imu3_get_zmag(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU3_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU3_LEN;
+        memset(scaled_imu3, 0, MAVLINK_MSG_ID_SCALED_IMU3_LEN);
+	memcpy(scaled_imu3, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE SCALED_PRESSURE PACKING
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE 29
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_pressure_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float press_abs; /*< Absolute pressure (hectopascal)*/
+ float press_diff; /*< Differential pressure 1 (hectopascal)*/
+ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/
+} mavlink_scaled_pressure_t;
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 14
+#define MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN 14
+#define MAVLINK_MSG_ID_29_LEN 14
+#define MAVLINK_MSG_ID_29_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE_CRC 115
+#define MAVLINK_MSG_ID_29_CRC 115
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \
+	29, \
+	"SCALED_PRESSURE", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure_t, temperature) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \
+	"SCALED_PRESSURE", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure_t, temperature) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_pressure message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN);
+#else
+	mavlink_scaled_pressure_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+}
+
+/**
+ * @brief Pack a scaled_pressure message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN);
+#else
+	mavlink_scaled_pressure_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+}
+
+/**
+ * @brief Encode a scaled_pressure struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure_t* scaled_pressure)
+{
+	return mavlink_msg_scaled_pressure_pack(system_id, component_id, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature);
+}
+
+/**
+ * @brief Encode a scaled_pressure struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure_t* scaled_pressure)
+{
+	return mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, chan, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature);
+}
+
+/**
+ * @brief Send a scaled_pressure message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+#else
+	mavlink_scaled_pressure_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_pressure message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_pressure_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure_t* scaled_pressure)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_pressure_send(chan, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)scaled_pressure, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_PRESSURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_pressure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+#else
+	mavlink_scaled_pressure_t *packet = (mavlink_scaled_pressure_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->press_abs = press_abs;
+	packet->press_diff = press_diff;
+	packet->temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_PRESSURE UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_pressure message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field press_abs from scaled_pressure message
+ *
+ * @return Absolute pressure (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field press_diff from scaled_pressure message
+ *
+ * @return Differential pressure 1 (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field temperature from scaled_pressure message
+ *
+ * @return Temperature measurement (0.01 degrees celsius)
+ */
+static inline int16_t mavlink_msg_scaled_pressure_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Decode a scaled_pressure message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_pressure C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_pressure_decode(const mavlink_message_t* msg, mavlink_scaled_pressure_t* scaled_pressure)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_pressure->time_boot_ms = mavlink_msg_scaled_pressure_get_time_boot_ms(msg);
+	scaled_pressure->press_abs = mavlink_msg_scaled_pressure_get_press_abs(msg);
+	scaled_pressure->press_diff = mavlink_msg_scaled_pressure_get_press_diff(msg);
+	scaled_pressure->temperature = mavlink_msg_scaled_pressure_get_temperature(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE_LEN;
+        memset(scaled_pressure, 0, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN);
+	memcpy(scaled_pressure, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure2.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure2.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure2.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE SCALED_PRESSURE2 PACKING
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE2 137
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_pressure2_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float press_abs; /*< Absolute pressure (hectopascal)*/
+ float press_diff; /*< Differential pressure 1 (hectopascal)*/
+ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/
+} mavlink_scaled_pressure2_t;
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN 14
+#define MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN 14
+#define MAVLINK_MSG_ID_137_LEN 14
+#define MAVLINK_MSG_ID_137_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC 195
+#define MAVLINK_MSG_ID_137_CRC 195
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2 { \
+	137, \
+	"SCALED_PRESSURE2", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure2_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure2_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure2_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure2_t, temperature) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2 { \
+	"SCALED_PRESSURE2", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure2_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure2_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure2_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure2_t, temperature) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_pressure2 message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN);
+#else
+	mavlink_scaled_pressure2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+}
+
+/**
+ * @brief Pack a scaled_pressure2 message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN);
+#else
+	mavlink_scaled_pressure2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+}
+
+/**
+ * @brief Encode a scaled_pressure2 struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure2 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure2_t* scaled_pressure2)
+{
+	return mavlink_msg_scaled_pressure2_pack(system_id, component_id, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature);
+}
+
+/**
+ * @brief Encode a scaled_pressure2 struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure2 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure2_t* scaled_pressure2)
+{
+	return mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, chan, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature);
+}
+
+/**
+ * @brief Send a scaled_pressure2 message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_pressure2_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+#else
+	mavlink_scaled_pressure2_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_pressure2 message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_pressure2_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure2_t* scaled_pressure2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_pressure2_send(chan, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)scaled_pressure2, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_pressure2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+#else
+	mavlink_scaled_pressure2_t *packet = (mavlink_scaled_pressure2_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->press_abs = press_abs;
+	packet->press_diff = press_diff;
+	packet->temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_PRESSURE2 UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_pressure2 message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_pressure2_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field press_abs from scaled_pressure2 message
+ *
+ * @return Absolute pressure (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure2_get_press_abs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field press_diff from scaled_pressure2 message
+ *
+ * @return Differential pressure 1 (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure2_get_press_diff(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field temperature from scaled_pressure2 message
+ *
+ * @return Temperature measurement (0.01 degrees celsius)
+ */
+static inline int16_t mavlink_msg_scaled_pressure2_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Decode a scaled_pressure2 message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_pressure2 C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_pressure2_decode(const mavlink_message_t* msg, mavlink_scaled_pressure2_t* scaled_pressure2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_pressure2->time_boot_ms = mavlink_msg_scaled_pressure2_get_time_boot_ms(msg);
+	scaled_pressure2->press_abs = mavlink_msg_scaled_pressure2_get_press_abs(msg);
+	scaled_pressure2->press_diff = mavlink_msg_scaled_pressure2_get_press_diff(msg);
+	scaled_pressure2->temperature = mavlink_msg_scaled_pressure2_get_temperature(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN;
+        memset(scaled_pressure2, 0, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN);
+	memcpy(scaled_pressure2, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure3.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure3.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_scaled_pressure3.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE SCALED_PRESSURE3 PACKING
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE3 143
+
+typedef struct MAVLINK_PACKED __mavlink_scaled_pressure3_t
+{
+ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
+ float press_abs; /*< Absolute pressure (hectopascal)*/
+ float press_diff; /*< Differential pressure 1 (hectopascal)*/
+ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/
+} mavlink_scaled_pressure3_t;
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN 14
+#define MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN 14
+#define MAVLINK_MSG_ID_143_LEN 14
+#define MAVLINK_MSG_ID_143_MIN_LEN 14
+
+#define MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC 131
+#define MAVLINK_MSG_ID_143_CRC 131
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3 { \
+	143, \
+	"SCALED_PRESSURE3", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure3_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure3_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure3_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure3_t, temperature) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3 { \
+	"SCALED_PRESSURE3", \
+	4, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure3_t, time_boot_ms) }, \
+         { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure3_t, press_abs) }, \
+         { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure3_t, press_diff) }, \
+         { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure3_t, temperature) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a scaled_pressure3 message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN);
+#else
+	mavlink_scaled_pressure3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+}
+
+/**
+ * @brief Pack a scaled_pressure3 message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_scaled_pressure3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN);
+#else
+	mavlink_scaled_pressure3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+}
+
+/**
+ * @brief Encode a scaled_pressure3 struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure3 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure3_t* scaled_pressure3)
+{
+	return mavlink_msg_scaled_pressure3_pack(system_id, component_id, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature);
+}
+
+/**
+ * @brief Encode a scaled_pressure3 struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param scaled_pressure3 C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_scaled_pressure3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure3_t* scaled_pressure3)
+{
+	return mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, chan, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature);
+}
+
+/**
+ * @brief Send a scaled_pressure3 message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp (milliseconds since system boot)
+ * @param press_abs Absolute pressure (hectopascal)
+ * @param press_diff Differential pressure 1 (hectopascal)
+ * @param temperature Temperature measurement (0.01 degrees celsius)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_scaled_pressure3_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+#else
+	mavlink_scaled_pressure3_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.press_abs = press_abs;
+	packet.press_diff = press_diff;
+	packet.temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+#endif
+}
+
+/**
+ * @brief Send a scaled_pressure3 message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_scaled_pressure3_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure3_t* scaled_pressure3)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_scaled_pressure3_send(chan, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)scaled_pressure3, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_scaled_pressure3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, press_abs);
+	_mav_put_float(buf, 8, press_diff);
+	_mav_put_int16_t(buf, 12, temperature);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+#else
+	mavlink_scaled_pressure3_t *packet = (mavlink_scaled_pressure3_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->press_abs = press_abs;
+	packet->press_diff = press_diff;
+	packet->temperature = temperature;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SCALED_PRESSURE3 UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from scaled_pressure3 message
+ *
+ * @return Timestamp (milliseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_scaled_pressure3_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field press_abs from scaled_pressure3 message
+ *
+ * @return Absolute pressure (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure3_get_press_abs(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field press_diff from scaled_pressure3 message
+ *
+ * @return Differential pressure 1 (hectopascal)
+ */
+static inline float mavlink_msg_scaled_pressure3_get_press_diff(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field temperature from scaled_pressure3 message
+ *
+ * @return Temperature measurement (0.01 degrees celsius)
+ */
+static inline int16_t mavlink_msg_scaled_pressure3_get_temperature(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  12);
+}
+
+/**
+ * @brief Decode a scaled_pressure3 message into a struct
+ *
+ * @param msg The message to decode
+ * @param scaled_pressure3 C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_scaled_pressure3_decode(const mavlink_message_t* msg, mavlink_scaled_pressure3_t* scaled_pressure3)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	scaled_pressure3->time_boot_ms = mavlink_msg_scaled_pressure3_get_time_boot_ms(msg);
+	scaled_pressure3->press_abs = mavlink_msg_scaled_pressure3_get_press_abs(msg);
+	scaled_pressure3->press_diff = mavlink_msg_scaled_pressure3_get_press_diff(msg);
+	scaled_pressure3->temperature = mavlink_msg_scaled_pressure3_get_temperature(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN;
+        memset(scaled_pressure3, 0, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN);
+	memcpy(scaled_pressure3, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_serial_control.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_serial_control.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_serial_control.h	(revision 209)
@@ -0,0 +1,329 @@
+// MESSAGE SERIAL_CONTROL PACKING
+
+#define MAVLINK_MSG_ID_SERIAL_CONTROL 126
+
+typedef struct MAVLINK_PACKED __mavlink_serial_control_t
+{
+ uint32_t baudrate; /*< Baudrate of transfer. Zero means no change.*/
+ uint16_t timeout; /*< Timeout for reply data in milliseconds*/
+ uint8_t device; /*< See SERIAL_CONTROL_DEV enum*/
+ uint8_t flags; /*< See SERIAL_CONTROL_FLAG enum*/
+ uint8_t count; /*< how many bytes in this transfer*/
+ uint8_t data[70]; /*< serial data*/
+} mavlink_serial_control_t;
+
+#define MAVLINK_MSG_ID_SERIAL_CONTROL_LEN 79
+#define MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN 79
+#define MAVLINK_MSG_ID_126_LEN 79
+#define MAVLINK_MSG_ID_126_MIN_LEN 79
+
+#define MAVLINK_MSG_ID_SERIAL_CONTROL_CRC 220
+#define MAVLINK_MSG_ID_126_CRC 220
+
+#define MAVLINK_MSG_SERIAL_CONTROL_FIELD_DATA_LEN 70
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \
+	126, \
+	"SERIAL_CONTROL", \
+	6, \
+	{  { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \
+         { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \
+         { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \
+	"SERIAL_CONTROL", \
+	6, \
+	{  { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \
+         { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \
+         { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \
+         { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \
+         { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \
+         { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a serial_control message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param device See SERIAL_CONTROL_DEV enum
+ * @param flags See SERIAL_CONTROL_FLAG enum
+ * @param timeout Timeout for reply data in milliseconds
+ * @param baudrate Baudrate of transfer. Zero means no change.
+ * @param count how many bytes in this transfer
+ * @param data serial data
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN];
+	_mav_put_uint32_t(buf, 0, baudrate);
+	_mav_put_uint16_t(buf, 4, timeout);
+	_mav_put_uint8_t(buf, 6, device);
+	_mav_put_uint8_t(buf, 7, flags);
+	_mav_put_uint8_t(buf, 8, count);
+	_mav_put_uint8_t_array(buf, 9, data, 70);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN);
+#else
+	mavlink_serial_control_t packet;
+	packet.baudrate = baudrate;
+	packet.timeout = timeout;
+	packet.device = device;
+	packet.flags = flags;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+}
+
+/**
+ * @brief Pack a serial_control message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param device See SERIAL_CONTROL_DEV enum
+ * @param flags See SERIAL_CONTROL_FLAG enum
+ * @param timeout Timeout for reply data in milliseconds
+ * @param baudrate Baudrate of transfer. Zero means no change.
+ * @param count how many bytes in this transfer
+ * @param data serial data
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_serial_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t device,uint8_t flags,uint16_t timeout,uint32_t baudrate,uint8_t count,const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN];
+	_mav_put_uint32_t(buf, 0, baudrate);
+	_mav_put_uint16_t(buf, 4, timeout);
+	_mav_put_uint8_t(buf, 6, device);
+	_mav_put_uint8_t(buf, 7, flags);
+	_mav_put_uint8_t(buf, 8, count);
+	_mav_put_uint8_t_array(buf, 9, data, 70);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN);
+#else
+	mavlink_serial_control_t packet;
+	packet.baudrate = baudrate;
+	packet.timeout = timeout;
+	packet.device = device;
+	packet.flags = flags;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+}
+
+/**
+ * @brief Encode a serial_control struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param serial_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_serial_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_serial_control_t* serial_control)
+{
+	return mavlink_msg_serial_control_pack(system_id, component_id, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data);
+}
+
+/**
+ * @brief Encode a serial_control struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param serial_control C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_serial_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_serial_control_t* serial_control)
+{
+	return mavlink_msg_serial_control_pack_chan(system_id, component_id, chan, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data);
+}
+
+/**
+ * @brief Send a serial_control message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param device See SERIAL_CONTROL_DEV enum
+ * @param flags See SERIAL_CONTROL_FLAG enum
+ * @param timeout Timeout for reply data in milliseconds
+ * @param baudrate Baudrate of transfer. Zero means no change.
+ * @param count how many bytes in this transfer
+ * @param data serial data
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_serial_control_send(mavlink_channel_t chan, uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN];
+	_mav_put_uint32_t(buf, 0, baudrate);
+	_mav_put_uint16_t(buf, 4, timeout);
+	_mav_put_uint8_t(buf, 6, device);
+	_mav_put_uint8_t(buf, 7, flags);
+	_mav_put_uint8_t(buf, 8, count);
+	_mav_put_uint8_t_array(buf, 9, data, 70);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+#else
+	mavlink_serial_control_t packet;
+	packet.baudrate = baudrate;
+	packet.timeout = timeout;
+	packet.device = device;
+	packet.flags = flags;
+	packet.count = count;
+	mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+#endif
+}
+
+/**
+ * @brief Send a serial_control message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_serial_control_send_struct(mavlink_channel_t chan, const mavlink_serial_control_t* serial_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_serial_control_send(chan, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)serial_control, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SERIAL_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_serial_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, baudrate);
+	_mav_put_uint16_t(buf, 4, timeout);
+	_mav_put_uint8_t(buf, 6, device);
+	_mav_put_uint8_t(buf, 7, flags);
+	_mav_put_uint8_t(buf, 8, count);
+	_mav_put_uint8_t_array(buf, 9, data, 70);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+#else
+	mavlink_serial_control_t *packet = (mavlink_serial_control_t *)msgbuf;
+	packet->baudrate = baudrate;
+	packet->timeout = timeout;
+	packet->device = device;
+	packet->flags = flags;
+	packet->count = count;
+	mav_array_memcpy(packet->data, data, sizeof(uint8_t)*70);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SERIAL_CONTROL UNPACKING
+
+
+/**
+ * @brief Get field device from serial_control message
+ *
+ * @return See SERIAL_CONTROL_DEV enum
+ */
+static inline uint8_t mavlink_msg_serial_control_get_device(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  6);
+}
+
+/**
+ * @brief Get field flags from serial_control message
+ *
+ * @return See SERIAL_CONTROL_FLAG enum
+ */
+static inline uint8_t mavlink_msg_serial_control_get_flags(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  7);
+}
+
+/**
+ * @brief Get field timeout from serial_control message
+ *
+ * @return Timeout for reply data in milliseconds
+ */
+static inline uint16_t mavlink_msg_serial_control_get_timeout(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field baudrate from serial_control message
+ *
+ * @return Baudrate of transfer. Zero means no change.
+ */
+static inline uint32_t mavlink_msg_serial_control_get_baudrate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field count from serial_control message
+ *
+ * @return how many bytes in this transfer
+ */
+static inline uint8_t mavlink_msg_serial_control_get_count(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  8);
+}
+
+/**
+ * @brief Get field data from serial_control message
+ *
+ * @return serial data
+ */
+static inline uint16_t mavlink_msg_serial_control_get_data(const mavlink_message_t* msg, uint8_t *data)
+{
+	return _MAV_RETURN_uint8_t_array(msg, data, 70,  9);
+}
+
+/**
+ * @brief Decode a serial_control message into a struct
+ *
+ * @param msg The message to decode
+ * @param serial_control C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_serial_control_decode(const mavlink_message_t* msg, mavlink_serial_control_t* serial_control)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	serial_control->baudrate = mavlink_msg_serial_control_get_baudrate(msg);
+	serial_control->timeout = mavlink_msg_serial_control_get_timeout(msg);
+	serial_control->device = mavlink_msg_serial_control_get_device(msg);
+	serial_control->flags = mavlink_msg_serial_control_get_flags(msg);
+	serial_control->count = mavlink_msg_serial_control_get_count(msg);
+	mavlink_msg_serial_control_get_data(msg, serial_control->data);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SERIAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_SERIAL_CONTROL_LEN;
+        memset(serial_control, 0, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN);
+	memcpy(serial_control, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_servo_output_raw.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_servo_output_raw.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_servo_output_raw.h	(revision 209)
@@ -0,0 +1,437 @@
+// MESSAGE SERVO_OUTPUT_RAW PACKING
+
+#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36
+
+typedef struct MAVLINK_PACKED __mavlink_servo_output_raw_t
+{
+ uint32_t time_usec; /*< Timestamp (microseconds since system boot)*/
+ uint16_t servo1_raw; /*< Servo output 1 value, in microseconds*/
+ uint16_t servo2_raw; /*< Servo output 2 value, in microseconds*/
+ uint16_t servo3_raw; /*< Servo output 3 value, in microseconds*/
+ uint16_t servo4_raw; /*< Servo output 4 value, in microseconds*/
+ uint16_t servo5_raw; /*< Servo output 5 value, in microseconds*/
+ uint16_t servo6_raw; /*< Servo output 6 value, in microseconds*/
+ uint16_t servo7_raw; /*< Servo output 7 value, in microseconds*/
+ uint16_t servo8_raw; /*< Servo output 8 value, in microseconds*/
+ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.*/
+} mavlink_servo_output_raw_t;
+
+#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21
+#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN 21
+#define MAVLINK_MSG_ID_36_LEN 21
+#define MAVLINK_MSG_ID_36_MIN_LEN 21
+
+#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222
+#define MAVLINK_MSG_ID_36_CRC 222
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
+	36, \
+	"SERVO_OUTPUT_RAW", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
+         { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
+         { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
+         { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
+         { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
+         { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
+         { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
+         { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
+         { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
+	"SERVO_OUTPUT_RAW", \
+	10, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
+         { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
+         { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
+         { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
+         { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
+         { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
+         { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
+         { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
+         { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
+         { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a servo_output_raw message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (microseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
+ * @param servo1_raw Servo output 1 value, in microseconds
+ * @param servo2_raw Servo output 2 value, in microseconds
+ * @param servo3_raw Servo output 3 value, in microseconds
+ * @param servo4_raw Servo output 4 value, in microseconds
+ * @param servo5_raw Servo output 5 value, in microseconds
+ * @param servo6_raw Servo output 6 value, in microseconds
+ * @param servo7_raw Servo output 7 value, in microseconds
+ * @param servo8_raw Servo output 8 value, in microseconds
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 4, servo1_raw);
+	_mav_put_uint16_t(buf, 6, servo2_raw);
+	_mav_put_uint16_t(buf, 8, servo3_raw);
+	_mav_put_uint16_t(buf, 10, servo4_raw);
+	_mav_put_uint16_t(buf, 12, servo5_raw);
+	_mav_put_uint16_t(buf, 14, servo6_raw);
+	_mav_put_uint16_t(buf, 16, servo7_raw);
+	_mav_put_uint16_t(buf, 18, servo8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
+#else
+	mavlink_servo_output_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.servo1_raw = servo1_raw;
+	packet.servo2_raw = servo2_raw;
+	packet.servo3_raw = servo3_raw;
+	packet.servo4_raw = servo4_raw;
+	packet.servo5_raw = servo5_raw;
+	packet.servo6_raw = servo6_raw;
+	packet.servo7_raw = servo7_raw;
+	packet.servo8_raw = servo8_raw;
+	packet.port = port;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+}
+
+/**
+ * @brief Pack a servo_output_raw message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (microseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
+ * @param servo1_raw Servo output 1 value, in microseconds
+ * @param servo2_raw Servo output 2 value, in microseconds
+ * @param servo3_raw Servo output 3 value, in microseconds
+ * @param servo4_raw Servo output 4 value, in microseconds
+ * @param servo5_raw Servo output 5 value, in microseconds
+ * @param servo6_raw Servo output 6 value, in microseconds
+ * @param servo7_raw Servo output 7 value, in microseconds
+ * @param servo8_raw Servo output 8 value, in microseconds
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 4, servo1_raw);
+	_mav_put_uint16_t(buf, 6, servo2_raw);
+	_mav_put_uint16_t(buf, 8, servo3_raw);
+	_mav_put_uint16_t(buf, 10, servo4_raw);
+	_mav_put_uint16_t(buf, 12, servo5_raw);
+	_mav_put_uint16_t(buf, 14, servo6_raw);
+	_mav_put_uint16_t(buf, 16, servo7_raw);
+	_mav_put_uint16_t(buf, 18, servo8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
+#else
+	mavlink_servo_output_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.servo1_raw = servo1_raw;
+	packet.servo2_raw = servo2_raw;
+	packet.servo3_raw = servo3_raw;
+	packet.servo4_raw = servo4_raw;
+	packet.servo5_raw = servo5_raw;
+	packet.servo6_raw = servo6_raw;
+	packet.servo7_raw = servo7_raw;
+	packet.servo8_raw = servo8_raw;
+	packet.port = port;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+}
+
+/**
+ * @brief Encode a servo_output_raw struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param servo_output_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
+{
+	return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
+}
+
+/**
+ * @brief Encode a servo_output_raw struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param servo_output_raw C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
+{
+	return mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, chan, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
+}
+
+/**
+ * @brief Send a servo_output_raw message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (microseconds since system boot)
+ * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
+ * @param servo1_raw Servo output 1 value, in microseconds
+ * @param servo2_raw Servo output 2 value, in microseconds
+ * @param servo3_raw Servo output 3 value, in microseconds
+ * @param servo4_raw Servo output 4 value, in microseconds
+ * @param servo5_raw Servo output 5 value, in microseconds
+ * @param servo6_raw Servo output 6 value, in microseconds
+ * @param servo7_raw Servo output 7 value, in microseconds
+ * @param servo8_raw Servo output 8 value, in microseconds
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
+	_mav_put_uint32_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 4, servo1_raw);
+	_mav_put_uint16_t(buf, 6, servo2_raw);
+	_mav_put_uint16_t(buf, 8, servo3_raw);
+	_mav_put_uint16_t(buf, 10, servo4_raw);
+	_mav_put_uint16_t(buf, 12, servo5_raw);
+	_mav_put_uint16_t(buf, 14, servo6_raw);
+	_mav_put_uint16_t(buf, 16, servo7_raw);
+	_mav_put_uint16_t(buf, 18, servo8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+#else
+	mavlink_servo_output_raw_t packet;
+	packet.time_usec = time_usec;
+	packet.servo1_raw = servo1_raw;
+	packet.servo2_raw = servo2_raw;
+	packet.servo3_raw = servo3_raw;
+	packet.servo4_raw = servo4_raw;
+	packet.servo5_raw = servo5_raw;
+	packet.servo6_raw = servo6_raw;
+	packet.servo7_raw = servo7_raw;
+	packet.servo8_raw = servo8_raw;
+	packet.port = port;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+#endif
+}
+
+/**
+ * @brief Send a servo_output_raw message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_servo_output_raw_send_struct(mavlink_channel_t chan, const mavlink_servo_output_raw_t* servo_output_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_servo_output_raw_send(chan, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)servo_output_raw, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_usec);
+	_mav_put_uint16_t(buf, 4, servo1_raw);
+	_mav_put_uint16_t(buf, 6, servo2_raw);
+	_mav_put_uint16_t(buf, 8, servo3_raw);
+	_mav_put_uint16_t(buf, 10, servo4_raw);
+	_mav_put_uint16_t(buf, 12, servo5_raw);
+	_mav_put_uint16_t(buf, 14, servo6_raw);
+	_mav_put_uint16_t(buf, 16, servo7_raw);
+	_mav_put_uint16_t(buf, 18, servo8_raw);
+	_mav_put_uint8_t(buf, 20, port);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+#else
+	mavlink_servo_output_raw_t *packet = (mavlink_servo_output_raw_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->servo1_raw = servo1_raw;
+	packet->servo2_raw = servo2_raw;
+	packet->servo3_raw = servo3_raw;
+	packet->servo4_raw = servo4_raw;
+	packet->servo5_raw = servo5_raw;
+	packet->servo6_raw = servo6_raw;
+	packet->servo7_raw = servo7_raw;
+	packet->servo8_raw = servo8_raw;
+	packet->port = port;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SERVO_OUTPUT_RAW UNPACKING
+
+
+/**
+ * @brief Get field time_usec from servo_output_raw message
+ *
+ * @return Timestamp (microseconds since system boot)
+ */
+static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field port from servo_output_raw message
+ *
+ * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
+ */
+static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  20);
+}
+
+/**
+ * @brief Get field servo1_raw from servo_output_raw message
+ *
+ * @return Servo output 1 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  4);
+}
+
+/**
+ * @brief Get field servo2_raw from servo_output_raw message
+ *
+ * @return Servo output 2 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  6);
+}
+
+/**
+ * @brief Get field servo3_raw from servo_output_raw message
+ *
+ * @return Servo output 3 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field servo4_raw from servo_output_raw message
+ *
+ * @return Servo output 4 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  10);
+}
+
+/**
+ * @brief Get field servo5_raw from servo_output_raw message
+ *
+ * @return Servo output 5 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field servo6_raw from servo_output_raw message
+ *
+ * @return Servo output 6 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Get field servo7_raw from servo_output_raw message
+ *
+ * @return Servo output 7 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field servo8_raw from servo_output_raw message
+ *
+ * @return Servo output 8 value, in microseconds
+ */
+static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Decode a servo_output_raw message into a struct
+ *
+ * @param msg The message to decode
+ * @param servo_output_raw C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg);
+	servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg);
+	servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg);
+	servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg);
+	servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg);
+	servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg);
+	servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg);
+	servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg);
+	servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg);
+	servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN? msg->len : MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN;
+        memset(servo_output_raw, 0, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
+	memcpy(servo_output_raw, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_actuator_control_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_actuator_control_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_actuator_control_target.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE SET_ACTUATOR_CONTROL_TARGET PACKING
+
+#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET 139
+
+typedef struct MAVLINK_PACKED __mavlink_set_actuator_control_target_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/
+ uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+} mavlink_set_actuator_control_target_t;
+
+#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN 43
+#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN 43
+#define MAVLINK_MSG_ID_139_LEN 43
+#define MAVLINK_MSG_ID_139_MIN_LEN 43
+
+#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC 168
+#define MAVLINK_MSG_ID_139_CRC 168
+
+#define MAVLINK_MSG_SET_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \
+	139, \
+	"SET_ACTUATOR_CONTROL_TARGET", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \
+         { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \
+         { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \
+	"SET_ACTUATOR_CONTROL_TARGET", \
+	5, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \
+         { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \
+         { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_actuator_control_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_uint8_t(buf, 41, target_system);
+	_mav_put_uint8_t(buf, 42, target_component);
+	_mav_put_float_array(buf, 8, controls, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
+#else
+	mavlink_set_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a set_actuator_control_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,uint8_t group_mlx,uint8_t target_system,uint8_t target_component,const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_uint8_t(buf, 41, target_system);
+	_mav_put_uint8_t(buf, 42, target_component);
+	_mav_put_float_array(buf, 8, controls, 8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
+#else
+	mavlink_set_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a set_actuator_control_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_actuator_control_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
+{
+	return mavlink_msg_set_actuator_control_target_pack(system_id, component_id, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
+}
+
+/**
+ * @brief Encode a set_actuator_control_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_actuator_control_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
+{
+	return mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, chan, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
+}
+
+/**
+ * @brief Send a set_actuator_control_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_uint8_t(buf, 41, target_system);
+	_mav_put_uint8_t(buf, 42, target_component);
+	_mav_put_float_array(buf, 8, controls, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+#else
+	mavlink_set_actuator_control_target_t packet;
+	packet.time_usec = time_usec;
+	packet.group_mlx = group_mlx;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_actuator_control_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_actuator_control_target_send(chan, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)set_actuator_control_target, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_uint8_t(buf, 40, group_mlx);
+	_mav_put_uint8_t(buf, 41, target_system);
+	_mav_put_uint8_t(buf, 42, target_component);
+	_mav_put_float_array(buf, 8, controls, 8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+#else
+	mavlink_set_actuator_control_target_t *packet = (mavlink_set_actuator_control_target_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->group_mlx = group_mlx;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_ACTUATOR_CONTROL_TARGET UNPACKING
+
+
+/**
+ * @brief Get field time_usec from set_actuator_control_target message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field group_mlx from set_actuator_control_target message
+ *
+ * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
+ */
+static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  40);
+}
+
+/**
+ * @brief Get field target_system from set_actuator_control_target message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  41);
+}
+
+/**
+ * @brief Get field target_component from set_actuator_control_target message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  42);
+}
+
+/**
+ * @brief Get field controls from set_actuator_control_target message
+ *
+ * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
+ */
+static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
+{
+	return _MAV_RETURN_float_array(msg, controls, 8,  8);
+}
+
+/**
+ * @brief Decode a set_actuator_control_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_actuator_control_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_set_actuator_control_target_t* set_actuator_control_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_actuator_control_target->time_usec = mavlink_msg_set_actuator_control_target_get_time_usec(msg);
+	mavlink_msg_set_actuator_control_target_get_controls(msg, set_actuator_control_target->controls);
+	set_actuator_control_target->group_mlx = mavlink_msg_set_actuator_control_target_get_group_mlx(msg);
+	set_actuator_control_target->target_system = mavlink_msg_set_actuator_control_target_get_target_system(msg);
+	set_actuator_control_target->target_component = mavlink_msg_set_actuator_control_target_get_target_component(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN;
+        memset(set_actuator_control_target, 0, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
+	memcpy(set_actuator_control_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_attitude_target.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_attitude_target.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_attitude_target.h	(revision 209)
@@ -0,0 +1,404 @@
+// MESSAGE SET_ATTITUDE_TARGET PACKING
+
+#define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET 82
+
+typedef struct MAVLINK_PACKED __mavlink_set_attitude_target_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
+ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
+ float body_roll_rate; /*< Body roll rate in radians per second*/
+ float body_pitch_rate; /*< Body roll rate in radians per second*/
+ float body_yaw_rate; /*< Body roll rate in radians per second*/
+ float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude*/
+} mavlink_set_attitude_target_t;
+
+#define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN 39
+#define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN 39
+#define MAVLINK_MSG_ID_82_LEN 39
+#define MAVLINK_MSG_ID_82_MIN_LEN 39
+
+#define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC 49
+#define MAVLINK_MSG_ID_82_CRC 49
+
+#define MAVLINK_MSG_SET_ATTITUDE_TARGET_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \
+	82, \
+	"SET_ATTITUDE_TARGET", \
+	9, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \
+         { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \
+         { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \
+         { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \
+	"SET_ATTITUDE_TARGET", \
+	9, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \
+         { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \
+         { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \
+         { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \
+         { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_attitude_target message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, target_system);
+	_mav_put_uint8_t(buf, 37, target_component);
+	_mav_put_uint8_t(buf, 38, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
+#else
+	mavlink_set_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+}
+
+/**
+ * @brief Pack a set_attitude_target message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, target_system);
+	_mav_put_uint8_t(buf, 37, target_component);
+	_mav_put_uint8_t(buf, 38, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
+#else
+	mavlink_set_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+}
+
+/**
+ * @brief Encode a set_attitude_target struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_attitude_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target)
+{
+	return mavlink_msg_set_attitude_target_pack(system_id, component_id, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
+}
+
+/**
+ * @brief Encode a set_attitude_target struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_attitude_target C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target)
+{
+	return mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, chan, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
+}
+
+/**
+ * @brief Send a set_attitude_target message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
+ * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ * @param body_roll_rate Body roll rate in radians per second
+ * @param body_pitch_rate Body roll rate in radians per second
+ * @param body_yaw_rate Body roll rate in radians per second
+ * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, target_system);
+	_mav_put_uint8_t(buf, 37, target_component);
+	_mav_put_uint8_t(buf, 38, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+#else
+	mavlink_set_attitude_target_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.body_roll_rate = body_roll_rate;
+	packet.body_pitch_rate = body_pitch_rate;
+	packet.body_yaw_rate = body_yaw_rate;
+	packet.thrust = thrust;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.type_mask = type_mask;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_attitude_target message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_set_attitude_target_t* set_attitude_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_attitude_target_send(chan, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)set_attitude_target, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 20, body_roll_rate);
+	_mav_put_float(buf, 24, body_pitch_rate);
+	_mav_put_float(buf, 28, body_yaw_rate);
+	_mav_put_float(buf, 32, thrust);
+	_mav_put_uint8_t(buf, 36, target_system);
+	_mav_put_uint8_t(buf, 37, target_component);
+	_mav_put_uint8_t(buf, 38, type_mask);
+	_mav_put_float_array(buf, 4, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+#else
+	mavlink_set_attitude_target_t *packet = (mavlink_set_attitude_target_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->body_roll_rate = body_roll_rate;
+	packet->body_pitch_rate = body_pitch_rate;
+	packet->body_yaw_rate = body_yaw_rate;
+	packet->thrust = thrust;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->type_mask = type_mask;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_ATTITUDE_TARGET UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from set_attitude_target message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_system from set_attitude_target message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  36);
+}
+
+/**
+ * @brief Get field target_component from set_attitude_target message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  37);
+}
+
+/**
+ * @brief Get field type_mask from set_attitude_target message
+ *
+ * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude
+ */
+static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  38);
+}
+
+/**
+ * @brief Get field q from set_attitude_target message
+ *
+ * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
+ */
+static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  4);
+}
+
+/**
+ * @brief Get field body_roll_rate from set_attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field body_pitch_rate from set_attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field body_yaw_rate from set_attitude_target message
+ *
+ * @return Body roll rate in radians per second
+ */
+static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field thrust from set_attitude_target message
+ *
+ * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
+ */
+static inline float mavlink_msg_set_attitude_target_get_thrust(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Decode a set_attitude_target message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_attitude_target C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_attitude_target_decode(const mavlink_message_t* msg, mavlink_set_attitude_target_t* set_attitude_target)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_attitude_target->time_boot_ms = mavlink_msg_set_attitude_target_get_time_boot_ms(msg);
+	mavlink_msg_set_attitude_target_get_q(msg, set_attitude_target->q);
+	set_attitude_target->body_roll_rate = mavlink_msg_set_attitude_target_get_body_roll_rate(msg);
+	set_attitude_target->body_pitch_rate = mavlink_msg_set_attitude_target_get_body_pitch_rate(msg);
+	set_attitude_target->body_yaw_rate = mavlink_msg_set_attitude_target_get_body_yaw_rate(msg);
+	set_attitude_target->thrust = mavlink_msg_set_attitude_target_get_thrust(msg);
+	set_attitude_target->target_system = mavlink_msg_set_attitude_target_get_target_system(msg);
+	set_attitude_target->target_component = mavlink_msg_set_attitude_target_get_target_component(msg);
+	set_attitude_target->type_mask = mavlink_msg_set_attitude_target_get_type_mask(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN;
+        memset(set_attitude_target, 0, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN);
+	memcpy(set_attitude_target, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_gps_global_origin.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_gps_global_origin.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_gps_global_origin.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE SET_GPS_GLOBAL_ORIGIN PACKING
+
+#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN 48
+
+typedef struct MAVLINK_PACKED __mavlink_set_gps_global_origin_t
+{
+ int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/
+ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
+ uint8_t target_system; /*< System ID*/
+} mavlink_set_gps_global_origin_t;
+
+#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN 13
+#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN 13
+#define MAVLINK_MSG_ID_48_LEN 13
+#define MAVLINK_MSG_ID_48_MIN_LEN 13
+
+#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC 41
+#define MAVLINK_MSG_ID_48_CRC 41
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \
+	48, \
+	"SET_GPS_GLOBAL_ORIGIN", \
+	4, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \
+	"SET_GPS_GLOBAL_ORIGIN", \
+	4, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_gps_global_origin message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_uint8_t(buf, 12, target_system);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN);
+#else
+	mavlink_set_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.target_system = target_system;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+}
+
+/**
+ * @brief Pack a set_gps_global_origin message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_uint8_t(buf, 12, target_system);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN);
+#else
+	mavlink_set_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.target_system = target_system;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+}
+
+/**
+ * @brief Encode a set_gps_global_origin struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_gps_global_origin C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_gps_global_origin_t* set_gps_global_origin)
+{
+	return mavlink_msg_set_gps_global_origin_pack(system_id, component_id, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude);
+}
+
+/**
+ * @brief Encode a set_gps_global_origin struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_gps_global_origin C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_gps_global_origin_t* set_gps_global_origin)
+{
+	return mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, chan, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude);
+}
+
+/**
+ * @brief Send a set_gps_global_origin message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_gps_global_origin_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_uint8_t(buf, 12, target_system);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+#else
+	mavlink_set_gps_global_origin_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.target_system = target_system;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_gps_global_origin message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_set_gps_global_origin_t* set_gps_global_origin)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_gps_global_origin_send(chan, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)set_gps_global_origin, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_uint8_t(buf, 12, target_system);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+#else
+	mavlink_set_gps_global_origin_t *packet = (mavlink_set_gps_global_origin_t *)msgbuf;
+	packet->latitude = latitude;
+	packet->longitude = longitude;
+	packet->altitude = altitude;
+	packet->target_system = target_system;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_GPS_GLOBAL_ORIGIN UNPACKING
+
+
+/**
+ * @brief Get field target_system from set_gps_global_origin message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  12);
+}
+
+/**
+ * @brief Get field latitude from set_gps_global_origin message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field longitude from set_gps_global_origin message
+ *
+ * @return Longitude (WGS84, in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field altitude from set_gps_global_origin message
+ *
+ * @return Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Decode a set_gps_global_origin message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_gps_global_origin C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_set_gps_global_origin_t* set_gps_global_origin)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_gps_global_origin->latitude = mavlink_msg_set_gps_global_origin_get_latitude(msg);
+	set_gps_global_origin->longitude = mavlink_msg_set_gps_global_origin_get_longitude(msg);
+	set_gps_global_origin->altitude = mavlink_msg_set_gps_global_origin_get_altitude(msg);
+	set_gps_global_origin->target_system = mavlink_msg_set_gps_global_origin_get_target_system(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN;
+        memset(set_gps_global_origin, 0, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN);
+	memcpy(set_gps_global_origin, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_home_position.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_home_position.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_home_position.h	(revision 209)
@@ -0,0 +1,454 @@
+// MESSAGE SET_HOME_POSITION PACKING
+
+#define MAVLINK_MSG_ID_SET_HOME_POSITION 243
+
+typedef struct MAVLINK_PACKED __mavlink_set_home_position_t
+{
+ int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
+ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/
+ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
+ float x; /*< Local X position of this position in the local coordinate frame*/
+ float y; /*< Local Y position of this position in the local coordinate frame*/
+ float z; /*< Local Z position of this position in the local coordinate frame*/
+ float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/
+ float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+ float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+ float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
+ uint8_t target_system; /*< System ID.*/
+} mavlink_set_home_position_t;
+
+#define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 53
+#define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53
+#define MAVLINK_MSG_ID_243_LEN 53
+#define MAVLINK_MSG_ID_243_MIN_LEN 53
+
+#define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC 85
+#define MAVLINK_MSG_ID_243_CRC 85
+
+#define MAVLINK_MSG_SET_HOME_POSITION_FIELD_Q_LEN 4
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
+	243, \
+	"SET_HOME_POSITION", \
+	11, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
+         { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
+         { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
+         { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
+	"SET_HOME_POSITION", \
+	11, \
+	{  { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
+         { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
+         { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
+         { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
+         { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
+         { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
+         { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_home_position message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system System ID.
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_uint8_t(buf, 52, target_system);
+	_mav_put_float_array(buf, 24, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
+#else
+	mavlink_set_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	packet.target_system = target_system;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+}
+
+/**
+ * @brief Pack a set_home_position message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system System ID.
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_uint8_t(buf, 52, target_system);
+	_mav_put_float_array(buf, 24, q, 4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
+#else
+	mavlink_set_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	packet.target_system = target_system;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+}
+
+/**
+ * @brief Encode a set_home_position struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_home_position C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
+{
+	return mavlink_msg_set_home_position_pack(system_id, component_id, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
+}
+
+/**
+ * @brief Encode a set_home_position struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_home_position C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
+{
+	return mavlink_msg_set_home_position_pack_chan(system_id, component_id, chan, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
+}
+
+/**
+ * @brief Send a set_home_position message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system System ID.
+ * @param latitude Latitude (WGS84), in degrees * 1E7
+ * @param longitude Longitude (WGS84, in degrees * 1E7
+ * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
+ * @param x Local X position of this position in the local coordinate frame
+ * @param y Local Y position of this position in the local coordinate frame
+ * @param z Local Z position of this position in the local coordinate frame
+ * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_uint8_t(buf, 52, target_system);
+	_mav_put_float_array(buf, 24, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+#else
+	mavlink_set_home_position_t packet;
+	packet.latitude = latitude;
+	packet.longitude = longitude;
+	packet.altitude = altitude;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.approach_x = approach_x;
+	packet.approach_y = approach_y;
+	packet.approach_z = approach_z;
+	packet.target_system = target_system;
+	mav_array_memcpy(packet.q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_home_position message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t chan, const mavlink_set_home_position_t* set_home_position)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_home_position_send(chan, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)set_home_position, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, latitude);
+	_mav_put_int32_t(buf, 4, longitude);
+	_mav_put_int32_t(buf, 8, altitude);
+	_mav_put_float(buf, 12, x);
+	_mav_put_float(buf, 16, y);
+	_mav_put_float(buf, 20, z);
+	_mav_put_float(buf, 40, approach_x);
+	_mav_put_float(buf, 44, approach_y);
+	_mav_put_float(buf, 48, approach_z);
+	_mav_put_uint8_t(buf, 52, target_system);
+	_mav_put_float_array(buf, 24, q, 4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+#else
+	mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf;
+	packet->latitude = latitude;
+	packet->longitude = longitude;
+	packet->altitude = altitude;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->approach_x = approach_x;
+	packet->approach_y = approach_y;
+	packet->approach_z = approach_z;
+	packet->target_system = target_system;
+	mav_array_memcpy(packet->q, q, sizeof(float)*4);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_HOME_POSITION UNPACKING
+
+
+/**
+ * @brief Get field target_system from set_home_position message
+ *
+ * @return System ID.
+ */
+static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  52);
+}
+
+/**
+ * @brief Get field latitude from set_home_position message
+ *
+ * @return Latitude (WGS84), in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field longitude from set_home_position message
+ *
+ * @return Longitude (WGS84, in degrees * 1E7
+ */
+static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field altitude from set_home_position message
+ *
+ * @return Altitude (AMSL), in meters * 1000 (positive for up)
+ */
+static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field x from set_home_position message
+ *
+ * @return Local X position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field y from set_home_position message
+ *
+ * @return Local Y position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field z from set_home_position message
+ *
+ * @return Local Z position of this position in the local coordinate frame
+ */
+static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field q from set_home_position message
+ *
+ * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
+ */
+static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message_t* msg, float *q)
+{
+	return _MAV_RETURN_float_array(msg, q, 4,  24);
+}
+
+/**
+ * @brief Get field approach_x from set_home_position message
+ *
+ * @return Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field approach_y from set_home_position message
+ *
+ * @return Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field approach_z from set_home_position message
+ *
+ * @return Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
+ */
+static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  48);
+}
+
+/**
+ * @brief Decode a set_home_position message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_home_position C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_home_position_decode(const mavlink_message_t* msg, mavlink_set_home_position_t* set_home_position)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg);
+	set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg);
+	set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg);
+	set_home_position->x = mavlink_msg_set_home_position_get_x(msg);
+	set_home_position->y = mavlink_msg_set_home_position_get_y(msg);
+	set_home_position->z = mavlink_msg_set_home_position_get_z(msg);
+	mavlink_msg_set_home_position_get_q(msg, set_home_position->q);
+	set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg);
+	set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg);
+	set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg);
+	set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_SET_HOME_POSITION_LEN;
+        memset(set_home_position, 0, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
+	memcpy(set_home_position, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_mode.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_mode.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_mode.h	(revision 209)
@@ -0,0 +1,262 @@
+// MESSAGE SET_MODE PACKING
+
+#define MAVLINK_MSG_ID_SET_MODE 11
+
+typedef struct MAVLINK_PACKED __mavlink_set_mode_t
+{
+ uint32_t custom_mode; /*< The new autopilot-specific mode. This field can be ignored by an autopilot.*/
+ uint8_t target_system; /*< The system setting the mode*/
+ uint8_t base_mode; /*< The new base mode*/
+} mavlink_set_mode_t;
+
+#define MAVLINK_MSG_ID_SET_MODE_LEN 6
+#define MAVLINK_MSG_ID_SET_MODE_MIN_LEN 6
+#define MAVLINK_MSG_ID_11_LEN 6
+#define MAVLINK_MSG_ID_11_MIN_LEN 6
+
+#define MAVLINK_MSG_ID_SET_MODE_CRC 89
+#define MAVLINK_MSG_ID_11_CRC 89
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_MODE { \
+	11, \
+	"SET_MODE", \
+	3, \
+	{  { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \
+         { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_MODE { \
+	"SET_MODE", \
+	3, \
+	{  { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \
+         { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_mode message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_system The system setting the mode
+ * @param base_mode The new base mode
+ * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_system, uint8_t base_mode, uint32_t custom_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_MODE_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, base_mode);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN);
+#else
+	mavlink_set_mode_t packet;
+	packet.custom_mode = custom_mode;
+	packet.target_system = target_system;
+	packet.base_mode = base_mode;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_MODE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+}
+
+/**
+ * @brief Pack a set_mode message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_system The system setting the mode
+ * @param base_mode The new base mode
+ * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_system,uint8_t base_mode,uint32_t custom_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_MODE_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, base_mode);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN);
+#else
+	mavlink_set_mode_t packet;
+	packet.custom_mode = custom_mode;
+	packet.target_system = target_system;
+	packet.base_mode = base_mode;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_MODE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+}
+
+/**
+ * @brief Encode a set_mode struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_mode C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode)
+{
+	return mavlink_msg_set_mode_pack(system_id, component_id, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode);
+}
+
+/**
+ * @brief Encode a set_mode struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_mode C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_mode_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode)
+{
+	return mavlink_msg_set_mode_pack_chan(system_id, component_id, chan, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode);
+}
+
+/**
+ * @brief Send a set_mode message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_system The system setting the mode
+ * @param base_mode The new base mode
+ * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t target_system, uint8_t base_mode, uint32_t custom_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_MODE_LEN];
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, base_mode);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+#else
+	mavlink_set_mode_t packet;
+	packet.custom_mode = custom_mode;
+	packet.target_system = target_system;
+	packet.base_mode = base_mode;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_mode message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_mode_send_struct(mavlink_channel_t chan, const mavlink_set_mode_t* set_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_mode_send(chan, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)set_mode, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_MODE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_mode_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t base_mode, uint32_t custom_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, custom_mode);
+	_mav_put_uint8_t(buf, 4, target_system);
+	_mav_put_uint8_t(buf, 5, base_mode);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+#else
+	mavlink_set_mode_t *packet = (mavlink_set_mode_t *)msgbuf;
+	packet->custom_mode = custom_mode;
+	packet->target_system = target_system;
+	packet->base_mode = base_mode;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)packet, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_MODE UNPACKING
+
+
+/**
+ * @brief Get field target_system from set_mode message
+ *
+ * @return The system setting the mode
+ */
+static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field base_mode from set_mode message
+ *
+ * @return The new base mode
+ */
+static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  5);
+}
+
+/**
+ * @brief Get field custom_mode from set_mode message
+ *
+ * @return The new autopilot-specific mode. This field can be ignored by an autopilot.
+ */
+static inline uint32_t mavlink_msg_set_mode_get_custom_mode(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Decode a set_mode message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_mode C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_mode_decode(const mavlink_message_t* msg, mavlink_set_mode_t* set_mode)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_mode->custom_mode = mavlink_msg_set_mode_get_custom_mode(msg);
+	set_mode->target_system = mavlink_msg_set_mode_get_target_system(msg);
+	set_mode->base_mode = mavlink_msg_set_mode_get_base_mode(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_MODE_LEN? msg->len : MAVLINK_MSG_ID_SET_MODE_LEN;
+        memset(set_mode, 0, MAVLINK_MSG_ID_SET_MODE_LEN);
+	memcpy(set_mode, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_global_int.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_global_int.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_global_int.h	(revision 209)
@@ -0,0 +1,587 @@
+// MESSAGE SET_POSITION_TARGET_GLOBAL_INT PACKING
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT 86
+
+typedef struct MAVLINK_PACKED __mavlink_set_position_target_global_int_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/
+ int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/
+ int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/
+ float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/
+ float vx; /*< X velocity in NED frame in meter / s*/
+ float vy; /*< Y velocity in NED frame in meter / s*/
+ float vz; /*< Z velocity in NED frame in meter / s*/
+ float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float yaw; /*< yaw setpoint in rad*/
+ float yaw_rate; /*< yaw rate setpoint in rad/s*/
+ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/
+} mavlink_set_position_target_global_int_t;
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN 53
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN 53
+#define MAVLINK_MSG_ID_86_LEN 53
+#define MAVLINK_MSG_ID_86_MIN_LEN 53
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC 5
+#define MAVLINK_MSG_ID_86_CRC 5
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \
+	86, \
+	"SET_POSITION_TARGET_GLOBAL_INT", \
+	16, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \
+         { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \
+         { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_global_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_global_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_global_int_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_global_int_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_global_int_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_global_int_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_global_int_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_global_int_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \
+	"SET_POSITION_TARGET_GLOBAL_INT", \
+	16, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \
+         { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \
+         { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_global_int_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_global_int_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_global_int_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_global_int_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_global_int_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_global_int_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_global_int_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_global_int_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_position_target_global_int message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN);
+#else
+	mavlink_set_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+}
+
+/**
+ * @brief Pack a set_position_target_global_int message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN);
+#else
+	mavlink_set_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+}
+
+/**
+ * @brief Encode a set_position_target_global_int struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_position_target_global_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_target_global_int_t* set_position_target_global_int)
+{
+	return mavlink_msg_set_position_target_global_int_pack(system_id, component_id, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate);
+}
+
+/**
+ * @brief Encode a set_position_target_global_int struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_position_target_global_int C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_target_global_int_t* set_position_target_global_int)
+{
+	return mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, chan, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate);
+}
+
+/**
+ * @brief Send a set_position_target_global_int message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param lat_int X Position in WGS84 frame in 1e7 * meters
+ * @param lon_int Y Position in WGS84 frame in 1e7 * meters
+ * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+#else
+	mavlink_set_position_target_global_int_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.lat_int = lat_int;
+	packet.lon_int = lon_int;
+	packet.alt = alt;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_position_target_global_int message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_set_position_target_global_int_t* set_position_target_global_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_position_target_global_int_send(chan, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)set_position_target_global_int, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_int32_t(buf, 4, lat_int);
+	_mav_put_int32_t(buf, 8, lon_int);
+	_mav_put_float(buf, 12, alt);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+#else
+	mavlink_set_position_target_global_int_t *packet = (mavlink_set_position_target_global_int_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->lat_int = lat_int;
+	packet->lon_int = lon_int;
+	packet->alt = alt;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->afx = afx;
+	packet->afy = afy;
+	packet->afz = afz;
+	packet->yaw = yaw;
+	packet->yaw_rate = yaw_rate;
+	packet->type_mask = type_mask;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_POSITION_TARGET_GLOBAL_INT UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from set_position_target_global_int message
+ *
+ * @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
+ */
+static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_system from set_position_target_global_int message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  50);
+}
+
+/**
+ * @brief Get field target_component from set_position_target_global_int message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  51);
+}
+
+/**
+ * @brief Get field coordinate_frame from set_position_target_global_int message
+ *
+ * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
+ */
+static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  52);
+}
+
+/**
+ * @brief Get field type_mask from set_position_target_global_int message
+ *
+ * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ */
+static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  48);
+}
+
+/**
+ * @brief Get field lat_int from set_position_target_global_int message
+ *
+ * @return X Position in WGS84 frame in 1e7 * meters
+ */
+static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field lon_int from set_position_target_global_int message
+ *
+ * @return Y Position in WGS84 frame in 1e7 * meters
+ */
+static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field alt from set_position_target_global_int message
+ *
+ * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vx from set_position_target_global_int message
+ *
+ * @return X velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field vy from set_position_target_global_int message
+ *
+ * @return Y velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vz from set_position_target_global_int message
+ *
+ * @return Z velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field afx from set_position_target_global_int message
+ *
+ * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_afx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field afy from set_position_target_global_int message
+ *
+ * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_afy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field afz from set_position_target_global_int message
+ *
+ * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_afz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field yaw from set_position_target_global_int message
+ *
+ * @return yaw setpoint in rad
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field yaw_rate from set_position_target_global_int message
+ *
+ * @return yaw rate setpoint in rad/s
+ */
+static inline float mavlink_msg_set_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Decode a set_position_target_global_int message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_position_target_global_int C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_set_position_target_global_int_t* set_position_target_global_int)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_position_target_global_int->time_boot_ms = mavlink_msg_set_position_target_global_int_get_time_boot_ms(msg);
+	set_position_target_global_int->lat_int = mavlink_msg_set_position_target_global_int_get_lat_int(msg);
+	set_position_target_global_int->lon_int = mavlink_msg_set_position_target_global_int_get_lon_int(msg);
+	set_position_target_global_int->alt = mavlink_msg_set_position_target_global_int_get_alt(msg);
+	set_position_target_global_int->vx = mavlink_msg_set_position_target_global_int_get_vx(msg);
+	set_position_target_global_int->vy = mavlink_msg_set_position_target_global_int_get_vy(msg);
+	set_position_target_global_int->vz = mavlink_msg_set_position_target_global_int_get_vz(msg);
+	set_position_target_global_int->afx = mavlink_msg_set_position_target_global_int_get_afx(msg);
+	set_position_target_global_int->afy = mavlink_msg_set_position_target_global_int_get_afy(msg);
+	set_position_target_global_int->afz = mavlink_msg_set_position_target_global_int_get_afz(msg);
+	set_position_target_global_int->yaw = mavlink_msg_set_position_target_global_int_get_yaw(msg);
+	set_position_target_global_int->yaw_rate = mavlink_msg_set_position_target_global_int_get_yaw_rate(msg);
+	set_position_target_global_int->type_mask = mavlink_msg_set_position_target_global_int_get_type_mask(msg);
+	set_position_target_global_int->target_system = mavlink_msg_set_position_target_global_int_get_target_system(msg);
+	set_position_target_global_int->target_component = mavlink_msg_set_position_target_global_int_get_target_component(msg);
+	set_position_target_global_int->coordinate_frame = mavlink_msg_set_position_target_global_int_get_coordinate_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN;
+        memset(set_position_target_global_int, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN);
+	memcpy(set_position_target_global_int, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_local_ned.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_local_ned.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_local_ned.h	(revision 209)
@@ -0,0 +1,587 @@
+// MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84
+
+typedef struct MAVLINK_PACKED __mavlink_set_position_target_local_ned_t
+{
+ uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
+ float x; /*< X Position in NED frame in meters*/
+ float y; /*< Y Position in NED frame in meters*/
+ float z; /*< Z Position in NED frame in meters (note, altitude is negative in NED)*/
+ float vx; /*< X velocity in NED frame in meter / s*/
+ float vy; /*< Y velocity in NED frame in meter / s*/
+ float vz; /*< Z velocity in NED frame in meter / s*/
+ float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
+ float yaw; /*< yaw setpoint in rad*/
+ float yaw_rate; /*< yaw rate setpoint in rad/s*/
+ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
+ uint8_t target_system; /*< System ID*/
+ uint8_t target_component; /*< Component ID*/
+ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/
+} mavlink_set_position_target_local_ned_t;
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN 53
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN 53
+#define MAVLINK_MSG_ID_84_LEN 53
+#define MAVLINK_MSG_ID_84_MIN_LEN 53
+
+#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC 143
+#define MAVLINK_MSG_ID_84_CRC 143
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \
+	84, \
+	"SET_POSITION_TARGET_LOCAL_NED", \
+	16, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \
+	"SET_POSITION_TARGET_LOCAL_NED", \
+	16, \
+	{  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \
+         { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \
+         { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \
+         { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \
+         { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \
+         { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \
+         { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \
+         { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \
+         { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \
+         { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a set_position_target_local_ned message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
+#else
+	mavlink_set_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+}
+
+/**
+ * @brief Pack a set_position_target_local_ned message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_set_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
+#else
+	mavlink_set_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+}
+
+/**
+ * @brief Encode a set_position_target_local_ned struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param set_position_target_local_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
+{
+	return mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
+}
+
+/**
+ * @brief Encode a set_position_target_local_ned struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param set_position_target_local_ned C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_set_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
+{
+	return mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
+}
+
+/**
+ * @brief Send a set_position_target_local_ned message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_boot_ms Timestamp in milliseconds since system boot
+ * @param target_system System ID
+ * @param target_component Component ID
+ * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ * @param x X Position in NED frame in meters
+ * @param y Y Position in NED frame in meters
+ * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
+ * @param vx X velocity in NED frame in meter / s
+ * @param vy Y velocity in NED frame in meter / s
+ * @param vz Z velocity in NED frame in meter / s
+ * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ * @param yaw yaw setpoint in rad
+ * @param yaw_rate yaw rate setpoint in rad/s
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_set_position_target_local_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+#else
+	mavlink_set_position_target_local_ned_t packet;
+	packet.time_boot_ms = time_boot_ms;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.vx = vx;
+	packet.vy = vy;
+	packet.vz = vz;
+	packet.afx = afx;
+	packet.afy = afy;
+	packet.afz = afz;
+	packet.yaw = yaw;
+	packet.yaw_rate = yaw_rate;
+	packet.type_mask = type_mask;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	packet.coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+
+/**
+ * @brief Send a set_position_target_local_ned message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_set_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_set_position_target_local_ned_send(chan, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)set_position_target_local_ned, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_set_position_target_local_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, time_boot_ms);
+	_mav_put_float(buf, 4, x);
+	_mav_put_float(buf, 8, y);
+	_mav_put_float(buf, 12, z);
+	_mav_put_float(buf, 16, vx);
+	_mav_put_float(buf, 20, vy);
+	_mav_put_float(buf, 24, vz);
+	_mav_put_float(buf, 28, afx);
+	_mav_put_float(buf, 32, afy);
+	_mav_put_float(buf, 36, afz);
+	_mav_put_float(buf, 40, yaw);
+	_mav_put_float(buf, 44, yaw_rate);
+	_mav_put_uint16_t(buf, 48, type_mask);
+	_mav_put_uint8_t(buf, 50, target_system);
+	_mav_put_uint8_t(buf, 51, target_component);
+	_mav_put_uint8_t(buf, 52, coordinate_frame);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+#else
+	mavlink_set_position_target_local_ned_t *packet = (mavlink_set_position_target_local_ned_t *)msgbuf;
+	packet->time_boot_ms = time_boot_ms;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->vx = vx;
+	packet->vy = vy;
+	packet->vz = vz;
+	packet->afx = afx;
+	packet->afy = afy;
+	packet->afz = afz;
+	packet->yaw = yaw;
+	packet->yaw_rate = yaw_rate;
+	packet->type_mask = type_mask;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	packet->coordinate_frame = coordinate_frame;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SET_POSITION_TARGET_LOCAL_NED UNPACKING
+
+
+/**
+ * @brief Get field time_boot_ms from set_position_target_local_ned message
+ *
+ * @return Timestamp in milliseconds since system boot
+ */
+static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field target_system from set_position_target_local_ned message
+ *
+ * @return System ID
+ */
+static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  50);
+}
+
+/**
+ * @brief Get field target_component from set_position_target_local_ned message
+ *
+ * @return Component ID
+ */
+static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  51);
+}
+
+/**
+ * @brief Get field coordinate_frame from set_position_target_local_ned message
+ *
+ * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
+ */
+static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  52);
+}
+
+/**
+ * @brief Get field type_mask from set_position_target_local_ned message
+ *
+ * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
+ */
+static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  48);
+}
+
+/**
+ * @brief Get field x from set_position_target_local_ned message
+ *
+ * @return X Position in NED frame in meters
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field y from set_position_target_local_ned message
+ *
+ * @return Y Position in NED frame in meters
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field z from set_position_target_local_ned message
+ *
+ * @return Z Position in NED frame in meters (note, altitude is negative in NED)
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vx from set_position_target_local_ned message
+ *
+ * @return X velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field vy from set_position_target_local_ned message
+ *
+ * @return Y velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field vz from set_position_target_local_ned message
+ *
+ * @return Z velocity in NED frame in meter / s
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field afx from set_position_target_local_ned message
+ *
+ * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field afy from set_position_target_local_ned message
+ *
+ * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field afz from set_position_target_local_ned message
+ *
+ * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field yaw from set_position_target_local_ned message
+ *
+ * @return yaw setpoint in rad
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field yaw_rate from set_position_target_local_ned message
+ *
+ * @return yaw rate setpoint in rad/s
+ */
+static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Decode a set_position_target_local_ned message into a struct
+ *
+ * @param msg The message to decode
+ * @param set_position_target_local_ned C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_set_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	set_position_target_local_ned->time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(msg);
+	set_position_target_local_ned->x = mavlink_msg_set_position_target_local_ned_get_x(msg);
+	set_position_target_local_ned->y = mavlink_msg_set_position_target_local_ned_get_y(msg);
+	set_position_target_local_ned->z = mavlink_msg_set_position_target_local_ned_get_z(msg);
+	set_position_target_local_ned->vx = mavlink_msg_set_position_target_local_ned_get_vx(msg);
+	set_position_target_local_ned->vy = mavlink_msg_set_position_target_local_ned_get_vy(msg);
+	set_position_target_local_ned->vz = mavlink_msg_set_position_target_local_ned_get_vz(msg);
+	set_position_target_local_ned->afx = mavlink_msg_set_position_target_local_ned_get_afx(msg);
+	set_position_target_local_ned->afy = mavlink_msg_set_position_target_local_ned_get_afy(msg);
+	set_position_target_local_ned->afz = mavlink_msg_set_position_target_local_ned_get_afz(msg);
+	set_position_target_local_ned->yaw = mavlink_msg_set_position_target_local_ned_get_yaw(msg);
+	set_position_target_local_ned->yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(msg);
+	set_position_target_local_ned->type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(msg);
+	set_position_target_local_ned->target_system = mavlink_msg_set_position_target_local_ned_get_target_system(msg);
+	set_position_target_local_ned->target_component = mavlink_msg_set_position_target_local_ned_get_target_component(msg);
+	set_position_target_local_ned->coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN;
+        memset(set_position_target_local_ned, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
+	memcpy(set_position_target_local_ned, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sim_state.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sim_state.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sim_state.h	(revision 209)
@@ -0,0 +1,712 @@
+// MESSAGE SIM_STATE PACKING
+
+#define MAVLINK_MSG_ID_SIM_STATE 108
+
+typedef struct MAVLINK_PACKED __mavlink_sim_state_t
+{
+ float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/
+ float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/
+ float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/
+ float q4; /*< True attitude quaternion component 4, z (0 in null-rotation)*/
+ float roll; /*< Attitude roll expressed as Euler angles, not recommended except for human-readable outputs*/
+ float pitch; /*< Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs*/
+ float yaw; /*< Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs*/
+ float xacc; /*< X acceleration m/s/s*/
+ float yacc; /*< Y acceleration m/s/s*/
+ float zacc; /*< Z acceleration m/s/s*/
+ float xgyro; /*< Angular speed around X axis rad/s*/
+ float ygyro; /*< Angular speed around Y axis rad/s*/
+ float zgyro; /*< Angular speed around Z axis rad/s*/
+ float lat; /*< Latitude in degrees*/
+ float lon; /*< Longitude in degrees*/
+ float alt; /*< Altitude in meters*/
+ float std_dev_horz; /*< Horizontal position standard deviation*/
+ float std_dev_vert; /*< Vertical position standard deviation*/
+ float vn; /*< True velocity in m/s in NORTH direction in earth-fixed NED frame*/
+ float ve; /*< True velocity in m/s in EAST direction in earth-fixed NED frame*/
+ float vd; /*< True velocity in m/s in DOWN direction in earth-fixed NED frame*/
+} mavlink_sim_state_t;
+
+#define MAVLINK_MSG_ID_SIM_STATE_LEN 84
+#define MAVLINK_MSG_ID_SIM_STATE_MIN_LEN 84
+#define MAVLINK_MSG_ID_108_LEN 84
+#define MAVLINK_MSG_ID_108_MIN_LEN 84
+
+#define MAVLINK_MSG_ID_SIM_STATE_CRC 32
+#define MAVLINK_MSG_ID_108_CRC 32
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SIM_STATE { \
+	108, \
+	"SIM_STATE", \
+	21, \
+	{  { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \
+         { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \
+         { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \
+         { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) }, \
+         { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) }, \
+         { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) }, \
+         { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) }, \
+         { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) }, \
+         { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) }, \
+         { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SIM_STATE { \
+	"SIM_STATE", \
+	21, \
+	{  { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \
+         { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \
+         { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \
+         { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) }, \
+         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) }, \
+         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) }, \
+         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) }, \
+         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) }, \
+         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) }, \
+         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) }, \
+         { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) }, \
+         { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) }, \
+         { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) }, \
+         { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) }, \
+         { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) }, \
+         { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a sim_state message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
+ * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
+ * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
+ * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
+ * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
+ * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
+ * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
+ * @param xacc X acceleration m/s/s
+ * @param yacc Y acceleration m/s/s
+ * @param zacc Z acceleration m/s/s
+ * @param xgyro Angular speed around X axis rad/s
+ * @param ygyro Angular speed around Y axis rad/s
+ * @param zgyro Angular speed around Z axis rad/s
+ * @param lat Latitude in degrees
+ * @param lon Longitude in degrees
+ * @param alt Altitude in meters
+ * @param std_dev_horz Horizontal position standard deviation
+ * @param std_dev_vert Vertical position standard deviation
+ * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame
+ * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame
+ * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
+	_mav_put_float(buf, 0, q1);
+	_mav_put_float(buf, 4, q2);
+	_mav_put_float(buf, 8, q3);
+	_mav_put_float(buf, 12, q4);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+	_mav_put_float(buf, 28, xacc);
+	_mav_put_float(buf, 32, yacc);
+	_mav_put_float(buf, 36, zacc);
+	_mav_put_float(buf, 40, xgyro);
+	_mav_put_float(buf, 44, ygyro);
+	_mav_put_float(buf, 48, zgyro);
+	_mav_put_float(buf, 52, lat);
+	_mav_put_float(buf, 56, lon);
+	_mav_put_float(buf, 60, alt);
+	_mav_put_float(buf, 64, std_dev_horz);
+	_mav_put_float(buf, 68, std_dev_vert);
+	_mav_put_float(buf, 72, vn);
+	_mav_put_float(buf, 76, ve);
+	_mav_put_float(buf, 80, vd);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
+#else
+	mavlink_sim_state_t packet;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.std_dev_horz = std_dev_horz;
+	packet.std_dev_vert = std_dev_vert;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+}
+
+/**
+ * @brief Pack a sim_state message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
+ * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
+ * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
+ * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
+ * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
+ * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
+ * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
+ * @param xacc X acceleration m/s/s
+ * @param yacc Y acceleration m/s/s
+ * @param zacc Z acceleration m/s/s
+ * @param xgyro Angular speed around X axis rad/s
+ * @param ygyro Angular speed around Y axis rad/s
+ * @param zgyro Angular speed around Z axis rad/s
+ * @param lat Latitude in degrees
+ * @param lon Longitude in degrees
+ * @param alt Altitude in meters
+ * @param std_dev_horz Horizontal position standard deviation
+ * @param std_dev_vert Vertical position standard deviation
+ * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame
+ * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame
+ * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           float q1,float q2,float q3,float q4,float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lon,float alt,float std_dev_horz,float std_dev_vert,float vn,float ve,float vd)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
+	_mav_put_float(buf, 0, q1);
+	_mav_put_float(buf, 4, q2);
+	_mav_put_float(buf, 8, q3);
+	_mav_put_float(buf, 12, q4);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+	_mav_put_float(buf, 28, xacc);
+	_mav_put_float(buf, 32, yacc);
+	_mav_put_float(buf, 36, zacc);
+	_mav_put_float(buf, 40, xgyro);
+	_mav_put_float(buf, 44, ygyro);
+	_mav_put_float(buf, 48, zgyro);
+	_mav_put_float(buf, 52, lat);
+	_mav_put_float(buf, 56, lon);
+	_mav_put_float(buf, 60, alt);
+	_mav_put_float(buf, 64, std_dev_horz);
+	_mav_put_float(buf, 68, std_dev_vert);
+	_mav_put_float(buf, 72, vn);
+	_mav_put_float(buf, 76, ve);
+	_mav_put_float(buf, 80, vd);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN);
+#else
+	mavlink_sim_state_t packet;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.std_dev_horz = std_dev_horz;
+	packet.std_dev_vert = std_dev_vert;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SIM_STATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+}
+
+/**
+ * @brief Encode a sim_state struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param sim_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_sim_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state)
+{
+	return mavlink_msg_sim_state_pack(system_id, component_id, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd);
+}
+
+/**
+ * @brief Encode a sim_state struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param sim_state C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state)
+{
+	return mavlink_msg_sim_state_pack_chan(system_id, component_id, chan, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd);
+}
+
+/**
+ * @brief Send a sim_state message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param q1 True attitude quaternion component 1, w (1 in null-rotation)
+ * @param q2 True attitude quaternion component 2, x (0 in null-rotation)
+ * @param q3 True attitude quaternion component 3, y (0 in null-rotation)
+ * @param q4 True attitude quaternion component 4, z (0 in null-rotation)
+ * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
+ * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
+ * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
+ * @param xacc X acceleration m/s/s
+ * @param yacc Y acceleration m/s/s
+ * @param zacc Z acceleration m/s/s
+ * @param xgyro Angular speed around X axis rad/s
+ * @param ygyro Angular speed around Y axis rad/s
+ * @param zgyro Angular speed around Z axis rad/s
+ * @param lat Latitude in degrees
+ * @param lon Longitude in degrees
+ * @param alt Altitude in meters
+ * @param std_dev_horz Horizontal position standard deviation
+ * @param std_dev_vert Vertical position standard deviation
+ * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame
+ * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame
+ * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_sim_state_send(mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SIM_STATE_LEN];
+	_mav_put_float(buf, 0, q1);
+	_mav_put_float(buf, 4, q2);
+	_mav_put_float(buf, 8, q3);
+	_mav_put_float(buf, 12, q4);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+	_mav_put_float(buf, 28, xacc);
+	_mav_put_float(buf, 32, yacc);
+	_mav_put_float(buf, 36, zacc);
+	_mav_put_float(buf, 40, xgyro);
+	_mav_put_float(buf, 44, ygyro);
+	_mav_put_float(buf, 48, zgyro);
+	_mav_put_float(buf, 52, lat);
+	_mav_put_float(buf, 56, lon);
+	_mav_put_float(buf, 60, alt);
+	_mav_put_float(buf, 64, std_dev_horz);
+	_mav_put_float(buf, 68, std_dev_vert);
+	_mav_put_float(buf, 72, vn);
+	_mav_put_float(buf, 76, ve);
+	_mav_put_float(buf, 80, vd);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+#else
+	mavlink_sim_state_t packet;
+	packet.q1 = q1;
+	packet.q2 = q2;
+	packet.q3 = q3;
+	packet.q4 = q4;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+	packet.xacc = xacc;
+	packet.yacc = yacc;
+	packet.zacc = zacc;
+	packet.xgyro = xgyro;
+	packet.ygyro = ygyro;
+	packet.zgyro = zgyro;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.alt = alt;
+	packet.std_dev_horz = std_dev_horz;
+	packet.std_dev_vert = std_dev_vert;
+	packet.vn = vn;
+	packet.ve = ve;
+	packet.vd = vd;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a sim_state message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_sim_state_send_struct(mavlink_channel_t chan, const mavlink_sim_state_t* sim_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_sim_state_send(chan, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)sim_state, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SIM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, q1);
+	_mav_put_float(buf, 4, q2);
+	_mav_put_float(buf, 8, q3);
+	_mav_put_float(buf, 12, q4);
+	_mav_put_float(buf, 16, roll);
+	_mav_put_float(buf, 20, pitch);
+	_mav_put_float(buf, 24, yaw);
+	_mav_put_float(buf, 28, xacc);
+	_mav_put_float(buf, 32, yacc);
+	_mav_put_float(buf, 36, zacc);
+	_mav_put_float(buf, 40, xgyro);
+	_mav_put_float(buf, 44, ygyro);
+	_mav_put_float(buf, 48, zgyro);
+	_mav_put_float(buf, 52, lat);
+	_mav_put_float(buf, 56, lon);
+	_mav_put_float(buf, 60, alt);
+	_mav_put_float(buf, 64, std_dev_horz);
+	_mav_put_float(buf, 68, std_dev_vert);
+	_mav_put_float(buf, 72, vn);
+	_mav_put_float(buf, 76, ve);
+	_mav_put_float(buf, 80, vd);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+#else
+	mavlink_sim_state_t *packet = (mavlink_sim_state_t *)msgbuf;
+	packet->q1 = q1;
+	packet->q2 = q2;
+	packet->q3 = q3;
+	packet->q4 = q4;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+	packet->xacc = xacc;
+	packet->yacc = yacc;
+	packet->zacc = zacc;
+	packet->xgyro = xgyro;
+	packet->ygyro = ygyro;
+	packet->zgyro = zgyro;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->alt = alt;
+	packet->std_dev_horz = std_dev_horz;
+	packet->std_dev_vert = std_dev_vert;
+	packet->vn = vn;
+	packet->ve = ve;
+	packet->vd = vd;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SIM_STATE UNPACKING
+
+
+/**
+ * @brief Get field q1 from sim_state message
+ *
+ * @return True attitude quaternion component 1, w (1 in null-rotation)
+ */
+static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field q2 from sim_state message
+ *
+ * @return True attitude quaternion component 2, x (0 in null-rotation)
+ */
+static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field q3 from sim_state message
+ *
+ * @return True attitude quaternion component 3, y (0 in null-rotation)
+ */
+static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field q4 from sim_state message
+ *
+ * @return True attitude quaternion component 4, z (0 in null-rotation)
+ */
+static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field roll from sim_state message
+ *
+ * @return Attitude roll expressed as Euler angles, not recommended except for human-readable outputs
+ */
+static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field pitch from sim_state message
+ *
+ * @return Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs
+ */
+static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field yaw from sim_state message
+ *
+ * @return Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs
+ */
+static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field xacc from sim_state message
+ *
+ * @return X acceleration m/s/s
+ */
+static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field yacc from sim_state message
+ *
+ * @return Y acceleration m/s/s
+ */
+static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field zacc from sim_state message
+ *
+ * @return Z acceleration m/s/s
+ */
+static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Get field xgyro from sim_state message
+ *
+ * @return Angular speed around X axis rad/s
+ */
+static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  40);
+}
+
+/**
+ * @brief Get field ygyro from sim_state message
+ *
+ * @return Angular speed around Y axis rad/s
+ */
+static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  44);
+}
+
+/**
+ * @brief Get field zgyro from sim_state message
+ *
+ * @return Angular speed around Z axis rad/s
+ */
+static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  48);
+}
+
+/**
+ * @brief Get field lat from sim_state message
+ *
+ * @return Latitude in degrees
+ */
+static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  52);
+}
+
+/**
+ * @brief Get field lon from sim_state message
+ *
+ * @return Longitude in degrees
+ */
+static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  56);
+}
+
+/**
+ * @brief Get field alt from sim_state message
+ *
+ * @return Altitude in meters
+ */
+static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  60);
+}
+
+/**
+ * @brief Get field std_dev_horz from sim_state message
+ *
+ * @return Horizontal position standard deviation
+ */
+static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  64);
+}
+
+/**
+ * @brief Get field std_dev_vert from sim_state message
+ *
+ * @return Vertical position standard deviation
+ */
+static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  68);
+}
+
+/**
+ * @brief Get field vn from sim_state message
+ *
+ * @return True velocity in m/s in NORTH direction in earth-fixed NED frame
+ */
+static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  72);
+}
+
+/**
+ * @brief Get field ve from sim_state message
+ *
+ * @return True velocity in m/s in EAST direction in earth-fixed NED frame
+ */
+static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  76);
+}
+
+/**
+ * @brief Get field vd from sim_state message
+ *
+ * @return True velocity in m/s in DOWN direction in earth-fixed NED frame
+ */
+static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  80);
+}
+
+/**
+ * @brief Decode a sim_state message into a struct
+ *
+ * @param msg The message to decode
+ * @param sim_state C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_sim_state_decode(const mavlink_message_t* msg, mavlink_sim_state_t* sim_state)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	sim_state->q1 = mavlink_msg_sim_state_get_q1(msg);
+	sim_state->q2 = mavlink_msg_sim_state_get_q2(msg);
+	sim_state->q3 = mavlink_msg_sim_state_get_q3(msg);
+	sim_state->q4 = mavlink_msg_sim_state_get_q4(msg);
+	sim_state->roll = mavlink_msg_sim_state_get_roll(msg);
+	sim_state->pitch = mavlink_msg_sim_state_get_pitch(msg);
+	sim_state->yaw = mavlink_msg_sim_state_get_yaw(msg);
+	sim_state->xacc = mavlink_msg_sim_state_get_xacc(msg);
+	sim_state->yacc = mavlink_msg_sim_state_get_yacc(msg);
+	sim_state->zacc = mavlink_msg_sim_state_get_zacc(msg);
+	sim_state->xgyro = mavlink_msg_sim_state_get_xgyro(msg);
+	sim_state->ygyro = mavlink_msg_sim_state_get_ygyro(msg);
+	sim_state->zgyro = mavlink_msg_sim_state_get_zgyro(msg);
+	sim_state->lat = mavlink_msg_sim_state_get_lat(msg);
+	sim_state->lon = mavlink_msg_sim_state_get_lon(msg);
+	sim_state->alt = mavlink_msg_sim_state_get_alt(msg);
+	sim_state->std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg);
+	sim_state->std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg);
+	sim_state->vn = mavlink_msg_sim_state_get_vn(msg);
+	sim_state->ve = mavlink_msg_sim_state_get_ve(msg);
+	sim_state->vd = mavlink_msg_sim_state_get_vd(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SIM_STATE_LEN? msg->len : MAVLINK_MSG_ID_SIM_STATE_LEN;
+        memset(sim_state, 0, MAVLINK_MSG_ID_SIM_STATE_LEN);
+	memcpy(sim_state, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_statustext.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_statustext.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_statustext.h	(revision 209)
@@ -0,0 +1,229 @@
+// MESSAGE STATUSTEXT PACKING
+
+#define MAVLINK_MSG_ID_STATUSTEXT 253
+
+typedef struct MAVLINK_PACKED __mavlink_statustext_t
+{
+ uint8_t severity; /*< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.*/
+ char text[50]; /*< Status text message, without null termination character*/
+} mavlink_statustext_t;
+
+#define MAVLINK_MSG_ID_STATUSTEXT_LEN 51
+#define MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN 51
+#define MAVLINK_MSG_ID_253_LEN 51
+#define MAVLINK_MSG_ID_253_MIN_LEN 51
+
+#define MAVLINK_MSG_ID_STATUSTEXT_CRC 83
+#define MAVLINK_MSG_ID_253_CRC 83
+
+#define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_STATUSTEXT { \
+	253, \
+	"STATUSTEXT", \
+	2, \
+	{  { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \
+         { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_STATUSTEXT { \
+	"STATUSTEXT", \
+	2, \
+	{  { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \
+         { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a statustext message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
+ * @param text Status text message, without null termination character
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t severity, const char *text)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
+	_mav_put_uint8_t(buf, 0, severity);
+	_mav_put_char_array(buf, 1, text, 50);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
+#else
+	mavlink_statustext_t packet;
+	packet.severity = severity;
+	mav_array_memcpy(packet.text, text, sizeof(char)*50);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+}
+
+/**
+ * @brief Pack a statustext message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
+ * @param text Status text message, without null termination character
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t severity,const char *text)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
+	_mav_put_uint8_t(buf, 0, severity);
+	_mav_put_char_array(buf, 1, text, 50);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
+#else
+	mavlink_statustext_t packet;
+	packet.severity = severity;
+	mav_array_memcpy(packet.text, text, sizeof(char)*50);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+}
+
+/**
+ * @brief Encode a statustext struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param statustext C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_statustext_t* statustext)
+{
+	return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->severity, statustext->text);
+}
+
+/**
+ * @brief Encode a statustext struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param statustext C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_statustext_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_statustext_t* statustext)
+{
+	return mavlink_msg_statustext_pack_chan(system_id, component_id, chan, msg, statustext->severity, statustext->text);
+}
+
+/**
+ * @brief Send a statustext message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
+ * @param text Status text message, without null termination character
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const char *text)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
+	_mav_put_uint8_t(buf, 0, severity);
+	_mav_put_char_array(buf, 1, text, 50);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+#else
+	mavlink_statustext_t packet;
+	packet.severity = severity;
+	mav_array_memcpy(packet.text, text, sizeof(char)*50);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a statustext message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_statustext_send_struct(mavlink_channel_t chan, const mavlink_statustext_t* statustext)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_statustext_send(chan, statustext->severity, statustext->text);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)statustext, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_STATUSTEXT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_statustext_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t severity, const char *text)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint8_t(buf, 0, severity);
+	_mav_put_char_array(buf, 1, text, 50);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+#else
+	mavlink_statustext_t *packet = (mavlink_statustext_t *)msgbuf;
+	packet->severity = severity;
+	mav_array_memcpy(packet->text, text, sizeof(char)*50);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE STATUSTEXT UNPACKING
+
+
+/**
+ * @brief Get field severity from statustext message
+ *
+ * @return Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
+ */
+static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  0);
+}
+
+/**
+ * @brief Get field text from statustext message
+ *
+ * @return Status text message, without null termination character
+ */
+static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* msg, char *text)
+{
+	return _MAV_RETURN_char_array(msg, text, 50,  1);
+}
+
+/**
+ * @brief Decode a statustext message into a struct
+ *
+ * @param msg The message to decode
+ * @param statustext C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_statustext_decode(const mavlink_message_t* msg, mavlink_statustext_t* statustext)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	statustext->severity = mavlink_msg_statustext_get_severity(msg);
+	mavlink_msg_statustext_get_text(msg, statustext->text);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_STATUSTEXT_LEN? msg->len : MAVLINK_MSG_ID_STATUSTEXT_LEN;
+        memset(statustext, 0, MAVLINK_MSG_ID_STATUSTEXT_LEN);
+	memcpy(statustext, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sys_status.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sys_status.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_sys_status.h	(revision 209)
@@ -0,0 +1,512 @@
+// MESSAGE SYS_STATUS PACKING
+
+#define MAVLINK_MSG_ID_SYS_STATUS 1
+
+typedef struct MAVLINK_PACKED __mavlink_sys_status_t
+{
+ uint32_t onboard_control_sensors_present; /*< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
+ uint32_t onboard_control_sensors_enabled; /*< Bitmask showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
+ uint32_t onboard_control_sensors_health; /*< Bitmask showing which onboard controllers and sensors are operational or have an error:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
+ uint16_t load; /*< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000*/
+ uint16_t voltage_battery; /*< Battery voltage, in millivolts (1 = 1 millivolt)*/
+ int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/
+ uint16_t drop_rate_comm; /*< Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/
+ uint16_t errors_comm; /*< Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/
+ uint16_t errors_count1; /*< Autopilot-specific errors*/
+ uint16_t errors_count2; /*< Autopilot-specific errors*/
+ uint16_t errors_count3; /*< Autopilot-specific errors*/
+ uint16_t errors_count4; /*< Autopilot-specific errors*/
+ int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery*/
+} mavlink_sys_status_t;
+
+#define MAVLINK_MSG_ID_SYS_STATUS_LEN 31
+#define MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN 31
+#define MAVLINK_MSG_ID_1_LEN 31
+#define MAVLINK_MSG_ID_1_MIN_LEN 31
+
+#define MAVLINK_MSG_ID_SYS_STATUS_CRC 124
+#define MAVLINK_MSG_ID_1_CRC 124
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \
+	1, \
+	"SYS_STATUS", \
+	13, \
+	{  { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \
+         { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \
+         { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \
+         { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \
+         { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \
+         { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \
+         { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \
+         { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \
+         { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \
+         { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \
+         { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \
+         { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \
+         { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \
+	"SYS_STATUS", \
+	13, \
+	{  { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \
+         { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \
+         { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \
+         { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \
+         { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \
+         { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \
+         { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \
+         { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \
+         { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \
+         { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \
+         { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \
+         { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \
+         { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a sys_status message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
+ * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery
+ * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_count1 Autopilot-specific errors
+ * @param errors_count2 Autopilot-specific errors
+ * @param errors_count3 Autopilot-specific errors
+ * @param errors_count4 Autopilot-specific errors
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
+	_mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
+	_mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
+	_mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
+	_mav_put_uint16_t(buf, 12, load);
+	_mav_put_uint16_t(buf, 14, voltage_battery);
+	_mav_put_int16_t(buf, 16, current_battery);
+	_mav_put_uint16_t(buf, 18, drop_rate_comm);
+	_mav_put_uint16_t(buf, 20, errors_comm);
+	_mav_put_uint16_t(buf, 22, errors_count1);
+	_mav_put_uint16_t(buf, 24, errors_count2);
+	_mav_put_uint16_t(buf, 26, errors_count3);
+	_mav_put_uint16_t(buf, 28, errors_count4);
+	_mav_put_int8_t(buf, 30, battery_remaining);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN);
+#else
+	mavlink_sys_status_t packet;
+	packet.onboard_control_sensors_present = onboard_control_sensors_present;
+	packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
+	packet.onboard_control_sensors_health = onboard_control_sensors_health;
+	packet.load = load;
+	packet.voltage_battery = voltage_battery;
+	packet.current_battery = current_battery;
+	packet.drop_rate_comm = drop_rate_comm;
+	packet.errors_comm = errors_comm;
+	packet.errors_count1 = errors_count1;
+	packet.errors_count2 = errors_count2;
+	packet.errors_count3 = errors_count3;
+	packet.errors_count4 = errors_count4;
+	packet.battery_remaining = battery_remaining;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+}
+
+/**
+ * @brief Pack a sys_status message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
+ * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery
+ * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_count1 Autopilot-specific errors
+ * @param errors_count2 Autopilot-specific errors
+ * @param errors_count3 Autopilot-specific errors
+ * @param errors_count4 Autopilot-specific errors
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint32_t onboard_control_sensors_present,uint32_t onboard_control_sensors_enabled,uint32_t onboard_control_sensors_health,uint16_t load,uint16_t voltage_battery,int16_t current_battery,int8_t battery_remaining,uint16_t drop_rate_comm,uint16_t errors_comm,uint16_t errors_count1,uint16_t errors_count2,uint16_t errors_count3,uint16_t errors_count4)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
+	_mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
+	_mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
+	_mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
+	_mav_put_uint16_t(buf, 12, load);
+	_mav_put_uint16_t(buf, 14, voltage_battery);
+	_mav_put_int16_t(buf, 16, current_battery);
+	_mav_put_uint16_t(buf, 18, drop_rate_comm);
+	_mav_put_uint16_t(buf, 20, errors_comm);
+	_mav_put_uint16_t(buf, 22, errors_count1);
+	_mav_put_uint16_t(buf, 24, errors_count2);
+	_mav_put_uint16_t(buf, 26, errors_count3);
+	_mav_put_uint16_t(buf, 28, errors_count4);
+	_mav_put_int8_t(buf, 30, battery_remaining);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN);
+#else
+	mavlink_sys_status_t packet;
+	packet.onboard_control_sensors_present = onboard_control_sensors_present;
+	packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
+	packet.onboard_control_sensors_health = onboard_control_sensors_health;
+	packet.load = load;
+	packet.voltage_battery = voltage_battery;
+	packet.current_battery = current_battery;
+	packet.drop_rate_comm = drop_rate_comm;
+	packet.errors_comm = errors_comm;
+	packet.errors_count1 = errors_count1;
+	packet.errors_count2 = errors_count2;
+	packet.errors_count3 = errors_count3;
+	packet.errors_count4 = errors_count4;
+	packet.battery_remaining = battery_remaining;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+}
+
+/**
+ * @brief Encode a sys_status struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param sys_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status)
+{
+	return mavlink_msg_sys_status_pack(system_id, component_id, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
+}
+
+/**
+ * @brief Encode a sys_status struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param sys_status C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status)
+{
+	return mavlink_msg_sys_status_pack_chan(system_id, component_id, chan, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
+}
+
+/**
+ * @brief Send a sys_status message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
+ * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
+ * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery
+ * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ * @param errors_count1 Autopilot-specific errors
+ * @param errors_count2 Autopilot-specific errors
+ * @param errors_count3 Autopilot-specific errors
+ * @param errors_count4 Autopilot-specific errors
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
+	_mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
+	_mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
+	_mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
+	_mav_put_uint16_t(buf, 12, load);
+	_mav_put_uint16_t(buf, 14, voltage_battery);
+	_mav_put_int16_t(buf, 16, current_battery);
+	_mav_put_uint16_t(buf, 18, drop_rate_comm);
+	_mav_put_uint16_t(buf, 20, errors_comm);
+	_mav_put_uint16_t(buf, 22, errors_count1);
+	_mav_put_uint16_t(buf, 24, errors_count2);
+	_mav_put_uint16_t(buf, 26, errors_count3);
+	_mav_put_uint16_t(buf, 28, errors_count4);
+	_mav_put_int8_t(buf, 30, battery_remaining);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+#else
+	mavlink_sys_status_t packet;
+	packet.onboard_control_sensors_present = onboard_control_sensors_present;
+	packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
+	packet.onboard_control_sensors_health = onboard_control_sensors_health;
+	packet.load = load;
+	packet.voltage_battery = voltage_battery;
+	packet.current_battery = current_battery;
+	packet.drop_rate_comm = drop_rate_comm;
+	packet.errors_comm = errors_comm;
+	packet.errors_count1 = errors_count1;
+	packet.errors_count2 = errors_count2;
+	packet.errors_count3 = errors_count3;
+	packet.errors_count4 = errors_count4;
+	packet.battery_remaining = battery_remaining;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+#endif
+}
+
+/**
+ * @brief Send a sys_status message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_sys_status_send_struct(mavlink_channel_t chan, const mavlink_sys_status_t* sys_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_sys_status_send(chan, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)sys_status, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SYS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_sys_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
+	_mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
+	_mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
+	_mav_put_uint16_t(buf, 12, load);
+	_mav_put_uint16_t(buf, 14, voltage_battery);
+	_mav_put_int16_t(buf, 16, current_battery);
+	_mav_put_uint16_t(buf, 18, drop_rate_comm);
+	_mav_put_uint16_t(buf, 20, errors_comm);
+	_mav_put_uint16_t(buf, 22, errors_count1);
+	_mav_put_uint16_t(buf, 24, errors_count2);
+	_mav_put_uint16_t(buf, 26, errors_count3);
+	_mav_put_uint16_t(buf, 28, errors_count4);
+	_mav_put_int8_t(buf, 30, battery_remaining);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+#else
+	mavlink_sys_status_t *packet = (mavlink_sys_status_t *)msgbuf;
+	packet->onboard_control_sensors_present = onboard_control_sensors_present;
+	packet->onboard_control_sensors_enabled = onboard_control_sensors_enabled;
+	packet->onboard_control_sensors_health = onboard_control_sensors_health;
+	packet->load = load;
+	packet->voltage_battery = voltage_battery;
+	packet->current_battery = current_battery;
+	packet->drop_rate_comm = drop_rate_comm;
+	packet->errors_comm = errors_comm;
+	packet->errors_count1 = errors_count1;
+	packet->errors_count2 = errors_count2;
+	packet->errors_count3 = errors_count3;
+	packet->errors_count4 = errors_count4;
+	packet->battery_remaining = battery_remaining;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SYS_STATUS UNPACKING
+
+
+/**
+ * @brief Get field onboard_control_sensors_present from sys_status message
+ *
+ * @return Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ */
+static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_present(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  0);
+}
+
+/**
+ * @brief Get field onboard_control_sensors_enabled from sys_status message
+ *
+ * @return Bitmask showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ */
+static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enabled(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  4);
+}
+
+/**
+ * @brief Get field onboard_control_sensors_health from sys_status message
+ *
+ * @return Bitmask showing which onboard controllers and sensors are operational or have an error:  Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
+ */
+static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Get field load from sys_status message
+ *
+ * @return Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
+ */
+static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  12);
+}
+
+/**
+ * @brief Get field voltage_battery from sys_status message
+ *
+ * @return Battery voltage, in millivolts (1 = 1 millivolt)
+ */
+static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  14);
+}
+
+/**
+ * @brief Get field current_battery from sys_status message
+ *
+ * @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
+ */
+static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field battery_remaining from sys_status message
+ *
+ * @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery
+ */
+static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int8_t(msg,  30);
+}
+
+/**
+ * @brief Get field drop_rate_comm from sys_status message
+ *
+ * @return Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ */
+static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field errors_comm from sys_status message
+ *
+ * @return Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)
+ */
+static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Get field errors_count1 from sys_status message
+ *
+ * @return Autopilot-specific errors
+ */
+static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  22);
+}
+
+/**
+ * @brief Get field errors_count2 from sys_status message
+ *
+ * @return Autopilot-specific errors
+ */
+static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  24);
+}
+
+/**
+ * @brief Get field errors_count3 from sys_status message
+ *
+ * @return Autopilot-specific errors
+ */
+static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  26);
+}
+
+/**
+ * @brief Get field errors_count4 from sys_status message
+ *
+ * @return Autopilot-specific errors
+ */
+static inline uint16_t mavlink_msg_sys_status_get_errors_count4(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  28);
+}
+
+/**
+ * @brief Decode a sys_status message into a struct
+ *
+ * @param msg The message to decode
+ * @param sys_status C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_sys_status_decode(const mavlink_message_t* msg, mavlink_sys_status_t* sys_status)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	sys_status->onboard_control_sensors_present = mavlink_msg_sys_status_get_onboard_control_sensors_present(msg);
+	sys_status->onboard_control_sensors_enabled = mavlink_msg_sys_status_get_onboard_control_sensors_enabled(msg);
+	sys_status->onboard_control_sensors_health = mavlink_msg_sys_status_get_onboard_control_sensors_health(msg);
+	sys_status->load = mavlink_msg_sys_status_get_load(msg);
+	sys_status->voltage_battery = mavlink_msg_sys_status_get_voltage_battery(msg);
+	sys_status->current_battery = mavlink_msg_sys_status_get_current_battery(msg);
+	sys_status->drop_rate_comm = mavlink_msg_sys_status_get_drop_rate_comm(msg);
+	sys_status->errors_comm = mavlink_msg_sys_status_get_errors_comm(msg);
+	sys_status->errors_count1 = mavlink_msg_sys_status_get_errors_count1(msg);
+	sys_status->errors_count2 = mavlink_msg_sys_status_get_errors_count2(msg);
+	sys_status->errors_count3 = mavlink_msg_sys_status_get_errors_count3(msg);
+	sys_status->errors_count4 = mavlink_msg_sys_status_get_errors_count4(msg);
+	sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SYS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_SYS_STATUS_LEN;
+        memset(sys_status, 0, MAVLINK_MSG_ID_SYS_STATUS_LEN);
+	memcpy(sys_status, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_system_time.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_system_time.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_system_time.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE SYSTEM_TIME PACKING
+
+#define MAVLINK_MSG_ID_SYSTEM_TIME 2
+
+typedef struct MAVLINK_PACKED __mavlink_system_time_t
+{
+ uint64_t time_unix_usec; /*< Timestamp of the master clock in microseconds since UNIX epoch.*/
+ uint32_t time_boot_ms; /*< Timestamp of the component clock since boot time in milliseconds.*/
+} mavlink_system_time_t;
+
+#define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12
+#define MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN 12
+#define MAVLINK_MSG_ID_2_LEN 12
+#define MAVLINK_MSG_ID_2_MIN_LEN 12
+
+#define MAVLINK_MSG_ID_SYSTEM_TIME_CRC 137
+#define MAVLINK_MSG_ID_2_CRC 137
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \
+	2, \
+	"SYSTEM_TIME", \
+	2, \
+	{  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \
+	"SYSTEM_TIME", \
+	2, \
+	{  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \
+         { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a system_time message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch.
+ * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_unix_usec, uint32_t time_boot_ms)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
+	_mav_put_uint64_t(buf, 0, time_unix_usec);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
+#else
+	mavlink_system_time_t packet;
+	packet.time_unix_usec = time_unix_usec;
+	packet.time_boot_ms = time_boot_ms;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+}
+
+/**
+ * @brief Pack a system_time message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch.
+ * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_unix_usec,uint32_t time_boot_ms)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
+	_mav_put_uint64_t(buf, 0, time_unix_usec);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
+#else
+	mavlink_system_time_t packet;
+	packet.time_unix_usec = time_unix_usec;
+	packet.time_boot_ms = time_boot_ms;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+}
+
+/**
+ * @brief Encode a system_time struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param system_time C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_t* system_time)
+{
+	return mavlink_msg_system_time_pack(system_id, component_id, msg, system_time->time_unix_usec, system_time->time_boot_ms);
+}
+
+/**
+ * @brief Encode a system_time struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param system_time C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_system_time_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_system_time_t* system_time)
+{
+	return mavlink_msg_system_time_pack_chan(system_id, component_id, chan, msg, system_time->time_unix_usec, system_time->time_boot_ms);
+}
+
+/**
+ * @brief Send a system_time message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch.
+ * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
+	_mav_put_uint64_t(buf, 0, time_unix_usec);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+#else
+	mavlink_system_time_t packet;
+	packet.time_unix_usec = time_unix_usec;
+	packet.time_boot_ms = time_boot_ms;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+#endif
+}
+
+/**
+ * @brief Send a system_time message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_system_time_send_struct(mavlink_channel_t chan, const mavlink_system_time_t* system_time)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_system_time_send(chan, system_time->time_unix_usec, system_time->time_boot_ms);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)system_time, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_SYSTEM_TIME_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_system_time_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_unix_usec, uint32_t time_boot_ms)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_unix_usec);
+	_mav_put_uint32_t(buf, 8, time_boot_ms);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+#else
+	mavlink_system_time_t *packet = (mavlink_system_time_t *)msgbuf;
+	packet->time_unix_usec = time_unix_usec;
+	packet->time_boot_ms = time_boot_ms;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE SYSTEM_TIME UNPACKING
+
+
+/**
+ * @brief Get field time_unix_usec from system_time message
+ *
+ * @return Timestamp of the master clock in microseconds since UNIX epoch.
+ */
+static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field time_boot_ms from system_time message
+ *
+ * @return Timestamp of the component clock since boot time in milliseconds.
+ */
+static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  8);
+}
+
+/**
+ * @brief Decode a system_time message into a struct
+ *
+ * @param msg The message to decode
+ * @param system_time C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_system_time_decode(const mavlink_message_t* msg, mavlink_system_time_t* system_time)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	system_time->time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg);
+	system_time->time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_SYSTEM_TIME_LEN? msg->len : MAVLINK_MSG_ID_SYSTEM_TIME_LEN;
+        memset(system_time, 0, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
+	memcpy(system_time, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_check.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_check.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_check.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE TERRAIN_CHECK PACKING
+
+#define MAVLINK_MSG_ID_TERRAIN_CHECK 135
+
+typedef struct MAVLINK_PACKED __mavlink_terrain_check_t
+{
+ int32_t lat; /*< Latitude (degrees *10^7)*/
+ int32_t lon; /*< Longitude (degrees *10^7)*/
+} mavlink_terrain_check_t;
+
+#define MAVLINK_MSG_ID_TERRAIN_CHECK_LEN 8
+#define MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN 8
+#define MAVLINK_MSG_ID_135_LEN 8
+#define MAVLINK_MSG_ID_135_MIN_LEN 8
+
+#define MAVLINK_MSG_ID_TERRAIN_CHECK_CRC 203
+#define MAVLINK_MSG_ID_135_CRC 203
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_TERRAIN_CHECK { \
+	135, \
+	"TERRAIN_CHECK", \
+	2, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_check_t, lon) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_TERRAIN_CHECK { \
+	"TERRAIN_CHECK", \
+	2, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_check_t, lon) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a terrain_check message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t lat, int32_t lon)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
+#else
+	mavlink_terrain_check_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+}
+
+/**
+ * @brief Pack a terrain_check message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_check_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t lat,int32_t lon)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
+#else
+	mavlink_terrain_check_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+}
+
+/**
+ * @brief Encode a terrain_check struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_check C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_check_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check)
+{
+	return mavlink_msg_terrain_check_pack(system_id, component_id, msg, terrain_check->lat, terrain_check->lon);
+}
+
+/**
+ * @brief Encode a terrain_check struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_check C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_check_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check)
+{
+	return mavlink_msg_terrain_check_pack_chan(system_id, component_id, chan, msg, terrain_check->lat, terrain_check->lon);
+}
+
+/**
+ * @brief Send a terrain_check message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_terrain_check_send(mavlink_channel_t chan, int32_t lat, int32_t lon)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+#else
+	mavlink_terrain_check_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+#endif
+}
+
+/**
+ * @brief Send a terrain_check message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_terrain_check_send_struct(mavlink_channel_t chan, const mavlink_terrain_check_t* terrain_check)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_terrain_check_send(chan, terrain_check->lat, terrain_check->lon);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)terrain_check, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_TERRAIN_CHECK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_terrain_check_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t lat, int32_t lon)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+#else
+	mavlink_terrain_check_t *packet = (mavlink_terrain_check_t *)msgbuf;
+	packet->lat = lat;
+	packet->lon = lon;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE TERRAIN_CHECK UNPACKING
+
+
+/**
+ * @brief Get field lat from terrain_check message
+ *
+ * @return Latitude (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field lon from terrain_check message
+ *
+ * @return Longitude (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_check_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Decode a terrain_check message into a struct
+ *
+ * @param msg The message to decode
+ * @param terrain_check C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_terrain_check_decode(const mavlink_message_t* msg, mavlink_terrain_check_t* terrain_check)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	terrain_check->lat = mavlink_msg_terrain_check_get_lat(msg);
+	terrain_check->lon = mavlink_msg_terrain_check_get_lon(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_CHECK_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_CHECK_LEN;
+        memset(terrain_check, 0, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
+	memcpy(terrain_check, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_data.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_data.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_data.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE TERRAIN_DATA PACKING
+
+#define MAVLINK_MSG_ID_TERRAIN_DATA 134
+
+typedef struct MAVLINK_PACKED __mavlink_terrain_data_t
+{
+ int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/
+ int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/
+ uint16_t grid_spacing; /*< Grid spacing in meters*/
+ int16_t data[16]; /*< Terrain data in meters AMSL*/
+ uint8_t gridbit; /*< bit within the terrain request mask*/
+} mavlink_terrain_data_t;
+
+#define MAVLINK_MSG_ID_TERRAIN_DATA_LEN 43
+#define MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN 43
+#define MAVLINK_MSG_ID_134_LEN 43
+#define MAVLINK_MSG_ID_134_MIN_LEN 43
+
+#define MAVLINK_MSG_ID_TERRAIN_DATA_CRC 229
+#define MAVLINK_MSG_ID_134_CRC 229
+
+#define MAVLINK_MSG_TERRAIN_DATA_FIELD_DATA_LEN 16
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_TERRAIN_DATA { \
+	134, \
+	"TERRAIN_DATA", \
+	5, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \
+         { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \
+         { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \
+         { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_TERRAIN_DATA { \
+	"TERRAIN_DATA", \
+	5, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \
+         { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \
+         { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \
+         { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a terrain_data message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param gridbit bit within the terrain request mask
+ * @param data Terrain data in meters AMSL
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_uint16_t(buf, 8, grid_spacing);
+	_mav_put_uint8_t(buf, 42, gridbit);
+	_mav_put_int16_t_array(buf, 10, data, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
+#else
+	mavlink_terrain_data_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+	packet.gridbit = gridbit;
+	mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+}
+
+/**
+ * @brief Pack a terrain_data message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param gridbit bit within the terrain request mask
+ * @param data Terrain data in meters AMSL
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t lat,int32_t lon,uint16_t grid_spacing,uint8_t gridbit,const int16_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_uint16_t(buf, 8, grid_spacing);
+	_mav_put_uint8_t(buf, 42, gridbit);
+	_mav_put_int16_t_array(buf, 10, data, 16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
+#else
+	mavlink_terrain_data_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+	packet.gridbit = gridbit;
+	mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+}
+
+/**
+ * @brief Encode a terrain_data struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data)
+{
+	return mavlink_msg_terrain_data_pack(system_id, component_id, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data);
+}
+
+/**
+ * @brief Encode a terrain_data struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_data C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data)
+{
+	return mavlink_msg_terrain_data_pack_chan(system_id, component_id, chan, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data);
+}
+
+/**
+ * @brief Send a terrain_data message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param gridbit bit within the terrain request mask
+ * @param data Terrain data in meters AMSL
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_terrain_data_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_uint16_t(buf, 8, grid_spacing);
+	_mav_put_uint8_t(buf, 42, gridbit);
+	_mav_put_int16_t_array(buf, 10, data, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+#else
+	mavlink_terrain_data_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+	packet.gridbit = gridbit;
+	mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+#endif
+}
+
+/**
+ * @brief Send a terrain_data message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_terrain_data_send_struct(mavlink_channel_t chan, const mavlink_terrain_data_t* terrain_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_terrain_data_send(chan, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)terrain_data, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_TERRAIN_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_terrain_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_uint16_t(buf, 8, grid_spacing);
+	_mav_put_uint8_t(buf, 42, gridbit);
+	_mav_put_int16_t_array(buf, 10, data, 16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+#else
+	mavlink_terrain_data_t *packet = (mavlink_terrain_data_t *)msgbuf;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->grid_spacing = grid_spacing;
+	packet->gridbit = gridbit;
+	mav_array_memcpy(packet->data, data, sizeof(int16_t)*16);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE TERRAIN_DATA UNPACKING
+
+
+/**
+ * @brief Get field lat from terrain_data message
+ *
+ * @return Latitude of SW corner of first grid (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field lon from terrain_data message
+ *
+ * @return Longitude of SW corner of first grid (in degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field grid_spacing from terrain_data message
+ *
+ * @return Grid spacing in meters
+ */
+static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  8);
+}
+
+/**
+ * @brief Get field gridbit from terrain_data message
+ *
+ * @return bit within the terrain request mask
+ */
+static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  42);
+}
+
+/**
+ * @brief Get field data from terrain_data message
+ *
+ * @return Terrain data in meters AMSL
+ */
+static inline uint16_t mavlink_msg_terrain_data_get_data(const mavlink_message_t* msg, int16_t *data)
+{
+	return _MAV_RETURN_int16_t_array(msg, data, 16,  10);
+}
+
+/**
+ * @brief Decode a terrain_data message into a struct
+ *
+ * @param msg The message to decode
+ * @param terrain_data C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_terrain_data_decode(const mavlink_message_t* msg, mavlink_terrain_data_t* terrain_data)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	terrain_data->lat = mavlink_msg_terrain_data_get_lat(msg);
+	terrain_data->lon = mavlink_msg_terrain_data_get_lon(msg);
+	terrain_data->grid_spacing = mavlink_msg_terrain_data_get_grid_spacing(msg);
+	mavlink_msg_terrain_data_get_data(msg, terrain_data->data);
+	terrain_data->gridbit = mavlink_msg_terrain_data_get_gridbit(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_DATA_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_DATA_LEN;
+        memset(terrain_data, 0, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
+	memcpy(terrain_data, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_report.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_report.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_report.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE TERRAIN_REPORT PACKING
+
+#define MAVLINK_MSG_ID_TERRAIN_REPORT 136
+
+typedef struct MAVLINK_PACKED __mavlink_terrain_report_t
+{
+ int32_t lat; /*< Latitude (degrees *10^7)*/
+ int32_t lon; /*< Longitude (degrees *10^7)*/
+ float terrain_height; /*< Terrain height in meters AMSL*/
+ float current_height; /*< Current vehicle height above lat/lon terrain height (meters)*/
+ uint16_t spacing; /*< grid spacing (zero if terrain at this location unavailable)*/
+ uint16_t pending; /*< Number of 4x4 terrain blocks waiting to be received or read from disk*/
+ uint16_t loaded; /*< Number of 4x4 terrain blocks in memory*/
+} mavlink_terrain_report_t;
+
+#define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 22
+#define MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN 22
+#define MAVLINK_MSG_ID_136_LEN 22
+#define MAVLINK_MSG_ID_136_MIN_LEN 22
+
+#define MAVLINK_MSG_ID_TERRAIN_REPORT_CRC 1
+#define MAVLINK_MSG_ID_136_CRC 1
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \
+	136, \
+	"TERRAIN_REPORT", \
+	7, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \
+         { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \
+         { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \
+         { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \
+         { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \
+         { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \
+	"TERRAIN_REPORT", \
+	7, \
+	{  { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \
+         { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \
+         { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \
+         { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \
+         { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \
+         { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a terrain_report message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ * @param spacing grid spacing (zero if terrain at this location unavailable)
+ * @param terrain_height Terrain height in meters AMSL
+ * @param current_height Current vehicle height above lat/lon terrain height (meters)
+ * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
+ * @param loaded Number of 4x4 terrain blocks in memory
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_float(buf, 8, terrain_height);
+	_mav_put_float(buf, 12, current_height);
+	_mav_put_uint16_t(buf, 16, spacing);
+	_mav_put_uint16_t(buf, 18, pending);
+	_mav_put_uint16_t(buf, 20, loaded);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
+#else
+	mavlink_terrain_report_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.terrain_height = terrain_height;
+	packet.current_height = current_height;
+	packet.spacing = spacing;
+	packet.pending = pending;
+	packet.loaded = loaded;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+}
+
+/**
+ * @brief Pack a terrain_report message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ * @param spacing grid spacing (zero if terrain at this location unavailable)
+ * @param terrain_height Terrain height in meters AMSL
+ * @param current_height Current vehicle height above lat/lon terrain height (meters)
+ * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
+ * @param loaded Number of 4x4 terrain blocks in memory
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t lat,int32_t lon,uint16_t spacing,float terrain_height,float current_height,uint16_t pending,uint16_t loaded)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_float(buf, 8, terrain_height);
+	_mav_put_float(buf, 12, current_height);
+	_mav_put_uint16_t(buf, 16, spacing);
+	_mav_put_uint16_t(buf, 18, pending);
+	_mav_put_uint16_t(buf, 20, loaded);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
+#else
+	mavlink_terrain_report_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.terrain_height = terrain_height;
+	packet.current_height = current_height;
+	packet.spacing = spacing;
+	packet.pending = pending;
+	packet.loaded = loaded;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+}
+
+/**
+ * @brief Encode a terrain_report struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_report C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report)
+{
+	return mavlink_msg_terrain_report_pack(system_id, component_id, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
+}
+
+/**
+ * @brief Encode a terrain_report struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_report C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report)
+{
+	return mavlink_msg_terrain_report_pack_chan(system_id, component_id, chan, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
+}
+
+/**
+ * @brief Send a terrain_report message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param lat Latitude (degrees *10^7)
+ * @param lon Longitude (degrees *10^7)
+ * @param spacing grid spacing (zero if terrain at this location unavailable)
+ * @param terrain_height Terrain height in meters AMSL
+ * @param current_height Current vehicle height above lat/lon terrain height (meters)
+ * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
+ * @param loaded Number of 4x4 terrain blocks in memory
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_terrain_report_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_float(buf, 8, terrain_height);
+	_mav_put_float(buf, 12, current_height);
+	_mav_put_uint16_t(buf, 16, spacing);
+	_mav_put_uint16_t(buf, 18, pending);
+	_mav_put_uint16_t(buf, 20, loaded);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+#else
+	mavlink_terrain_report_t packet;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.terrain_height = terrain_height;
+	packet.current_height = current_height;
+	packet.spacing = spacing;
+	packet.pending = pending;
+	packet.loaded = loaded;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+#endif
+}
+
+/**
+ * @brief Send a terrain_report message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_terrain_report_send_struct(mavlink_channel_t chan, const mavlink_terrain_report_t* terrain_report)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_terrain_report_send(chan, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)terrain_report, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_TERRAIN_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_terrain_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int32_t(buf, 0, lat);
+	_mav_put_int32_t(buf, 4, lon);
+	_mav_put_float(buf, 8, terrain_height);
+	_mav_put_float(buf, 12, current_height);
+	_mav_put_uint16_t(buf, 16, spacing);
+	_mav_put_uint16_t(buf, 18, pending);
+	_mav_put_uint16_t(buf, 20, loaded);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+#else
+	mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->terrain_height = terrain_height;
+	packet->current_height = current_height;
+	packet->spacing = spacing;
+	packet->pending = pending;
+	packet->loaded = loaded;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE TERRAIN_REPORT UNPACKING
+
+
+/**
+ * @brief Get field lat from terrain_report message
+ *
+ * @return Latitude (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  0);
+}
+
+/**
+ * @brief Get field lon from terrain_report message
+ *
+ * @return Longitude (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  4);
+}
+
+/**
+ * @brief Get field spacing from terrain_report message
+ *
+ * @return grid spacing (zero if terrain at this location unavailable)
+ */
+static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field terrain_height from terrain_report message
+ *
+ * @return Terrain height in meters AMSL
+ */
+static inline float mavlink_msg_terrain_report_get_terrain_height(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field current_height from terrain_report message
+ *
+ * @return Current vehicle height above lat/lon terrain height (meters)
+ */
+static inline float mavlink_msg_terrain_report_get_current_height(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field pending from terrain_report message
+ *
+ * @return Number of 4x4 terrain blocks waiting to be received or read from disk
+ */
+static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field loaded from terrain_report message
+ *
+ * @return Number of 4x4 terrain blocks in memory
+ */
+static inline uint16_t mavlink_msg_terrain_report_get_loaded(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  20);
+}
+
+/**
+ * @brief Decode a terrain_report message into a struct
+ *
+ * @param msg The message to decode
+ * @param terrain_report C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_terrain_report_decode(const mavlink_message_t* msg, mavlink_terrain_report_t* terrain_report)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg);
+	terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg);
+	terrain_report->terrain_height = mavlink_msg_terrain_report_get_terrain_height(msg);
+	terrain_report->current_height = mavlink_msg_terrain_report_get_current_height(msg);
+	terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg);
+	terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg);
+	terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REPORT_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REPORT_LEN;
+        memset(terrain_report, 0, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
+	memcpy(terrain_report, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_request.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_request.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_terrain_request.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE TERRAIN_REQUEST PACKING
+
+#define MAVLINK_MSG_ID_TERRAIN_REQUEST 133
+
+typedef struct MAVLINK_PACKED __mavlink_terrain_request_t
+{
+ uint64_t mask; /*< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)*/
+ int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/
+ int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/
+ uint16_t grid_spacing; /*< Grid spacing in meters*/
+} mavlink_terrain_request_t;
+
+#define MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18
+#define MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN 18
+#define MAVLINK_MSG_ID_133_LEN 18
+#define MAVLINK_MSG_ID_133_MIN_LEN 18
+
+#define MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC 6
+#define MAVLINK_MSG_ID_133_CRC 6
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \
+	133, \
+	"TERRAIN_REQUEST", \
+	4, \
+	{  { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \
+         { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \
+	"TERRAIN_REQUEST", \
+	4, \
+	{  { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \
+         { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \
+         { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \
+         { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a terrain_request message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
+	_mav_put_uint64_t(buf, 0, mask);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_uint16_t(buf, 16, grid_spacing);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
+#else
+	mavlink_terrain_request_t packet;
+	packet.mask = mask;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+}
+
+/**
+ * @brief Pack a terrain_request message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int32_t lat,int32_t lon,uint16_t grid_spacing,uint64_t mask)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
+	_mav_put_uint64_t(buf, 0, mask);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_uint16_t(buf, 16, grid_spacing);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
+#else
+	mavlink_terrain_request_t packet;
+	packet.mask = mask;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+}
+
+/**
+ * @brief Encode a terrain_request struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request)
+{
+	return mavlink_msg_terrain_request_pack(system_id, component_id, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask);
+}
+
+/**
+ * @brief Encode a terrain_request struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param terrain_request C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request)
+{
+	return mavlink_msg_terrain_request_pack_chan(system_id, component_id, chan, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask);
+}
+
+/**
+ * @brief Send a terrain_request message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param lat Latitude of SW corner of first grid (degrees *10^7)
+ * @param lon Longitude of SW corner of first grid (in degrees *10^7)
+ * @param grid_spacing Grid spacing in meters
+ * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_terrain_request_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
+	_mav_put_uint64_t(buf, 0, mask);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_uint16_t(buf, 16, grid_spacing);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+#else
+	mavlink_terrain_request_t packet;
+	packet.mask = mask;
+	packet.lat = lat;
+	packet.lon = lon;
+	packet.grid_spacing = grid_spacing;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+#endif
+}
+
+/**
+ * @brief Send a terrain_request message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_terrain_request_send_struct(mavlink_channel_t chan, const mavlink_terrain_request_t* terrain_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_terrain_request_send(chan, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)terrain_request, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_terrain_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, mask);
+	_mav_put_int32_t(buf, 8, lat);
+	_mav_put_int32_t(buf, 12, lon);
+	_mav_put_uint16_t(buf, 16, grid_spacing);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+#else
+	mavlink_terrain_request_t *packet = (mavlink_terrain_request_t *)msgbuf;
+	packet->mask = mask;
+	packet->lat = lat;
+	packet->lon = lon;
+	packet->grid_spacing = grid_spacing;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE TERRAIN_REQUEST UNPACKING
+
+
+/**
+ * @brief Get field lat from terrain_request message
+ *
+ * @return Latitude of SW corner of first grid (degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  8);
+}
+
+/**
+ * @brief Get field lon from terrain_request message
+ *
+ * @return Longitude of SW corner of first grid (in degrees *10^7)
+ */
+static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int32_t(msg,  12);
+}
+
+/**
+ * @brief Get field grid_spacing from terrain_request message
+ *
+ * @return Grid spacing in meters
+ */
+static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  16);
+}
+
+/**
+ * @brief Get field mask from terrain_request message
+ *
+ * @return Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
+ */
+static inline uint64_t mavlink_msg_terrain_request_get_mask(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Decode a terrain_request message into a struct
+ *
+ * @param msg The message to decode
+ * @param terrain_request C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_terrain_request_decode(const mavlink_message_t* msg, mavlink_terrain_request_t* terrain_request)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	terrain_request->mask = mavlink_msg_terrain_request_get_mask(msg);
+	terrain_request->lat = mavlink_msg_terrain_request_get_lat(msg);
+	terrain_request->lon = mavlink_msg_terrain_request_get_lon(msg);
+	terrain_request->grid_spacing = mavlink_msg_terrain_request_get_grid_spacing(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN;
+        memset(terrain_request, 0, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
+	memcpy(terrain_request, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_timesync.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_timesync.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_timesync.h	(revision 209)
@@ -0,0 +1,237 @@
+// MESSAGE TIMESYNC PACKING
+
+#define MAVLINK_MSG_ID_TIMESYNC 111
+
+typedef struct MAVLINK_PACKED __mavlink_timesync_t
+{
+ int64_t tc1; /*< Time sync timestamp 1*/
+ int64_t ts1; /*< Time sync timestamp 2*/
+} mavlink_timesync_t;
+
+#define MAVLINK_MSG_ID_TIMESYNC_LEN 16
+#define MAVLINK_MSG_ID_TIMESYNC_MIN_LEN 16
+#define MAVLINK_MSG_ID_111_LEN 16
+#define MAVLINK_MSG_ID_111_MIN_LEN 16
+
+#define MAVLINK_MSG_ID_TIMESYNC_CRC 34
+#define MAVLINK_MSG_ID_111_CRC 34
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_TIMESYNC { \
+	111, \
+	"TIMESYNC", \
+	2, \
+	{  { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_timesync_t, tc1) }, \
+         { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0, 8, offsetof(mavlink_timesync_t, ts1) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_TIMESYNC { \
+	"TIMESYNC", \
+	2, \
+	{  { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_timesync_t, tc1) }, \
+         { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0, 8, offsetof(mavlink_timesync_t, ts1) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a timesync message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param tc1 Time sync timestamp 1
+ * @param ts1 Time sync timestamp 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       int64_t tc1, int64_t ts1)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TIMESYNC_LEN];
+	_mav_put_int64_t(buf, 0, tc1);
+	_mav_put_int64_t(buf, 8, ts1);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIMESYNC_LEN);
+#else
+	mavlink_timesync_t packet;
+	packet.tc1 = tc1;
+	packet.ts1 = ts1;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TIMESYNC;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+}
+
+/**
+ * @brief Pack a timesync message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param tc1 Time sync timestamp 1
+ * @param ts1 Time sync timestamp 2
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_timesync_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           int64_t tc1,int64_t ts1)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TIMESYNC_LEN];
+	_mav_put_int64_t(buf, 0, tc1);
+	_mav_put_int64_t(buf, 8, ts1);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIMESYNC_LEN);
+#else
+	mavlink_timesync_t packet;
+	packet.tc1 = tc1;
+	packet.ts1 = ts1;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_TIMESYNC;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+}
+
+/**
+ * @brief Encode a timesync struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param timesync C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_timesync_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_timesync_t* timesync)
+{
+	return mavlink_msg_timesync_pack(system_id, component_id, msg, timesync->tc1, timesync->ts1);
+}
+
+/**
+ * @brief Encode a timesync struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param timesync C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_timesync_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_timesync_t* timesync)
+{
+	return mavlink_msg_timesync_pack_chan(system_id, component_id, chan, msg, timesync->tc1, timesync->ts1);
+}
+
+/**
+ * @brief Send a timesync message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param tc1 Time sync timestamp 1
+ * @param ts1 Time sync timestamp 2
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_timesync_send(mavlink_channel_t chan, int64_t tc1, int64_t ts1)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_TIMESYNC_LEN];
+	_mav_put_int64_t(buf, 0, tc1);
+	_mav_put_int64_t(buf, 8, ts1);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+#else
+	mavlink_timesync_t packet;
+	packet.tc1 = tc1;
+	packet.ts1 = ts1;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)&packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+#endif
+}
+
+/**
+ * @brief Send a timesync message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_timesync_send_struct(mavlink_channel_t chan, const mavlink_timesync_t* timesync)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_timesync_send(chan, timesync->tc1, timesync->ts1);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)timesync, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_TIMESYNC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_timesync_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int64_t tc1, int64_t ts1)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_int64_t(buf, 0, tc1);
+	_mav_put_int64_t(buf, 8, ts1);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+#else
+	mavlink_timesync_t *packet = (mavlink_timesync_t *)msgbuf;
+	packet->tc1 = tc1;
+	packet->ts1 = ts1;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE TIMESYNC UNPACKING
+
+
+/**
+ * @brief Get field tc1 from timesync message
+ *
+ * @return Time sync timestamp 1
+ */
+static inline int64_t mavlink_msg_timesync_get_tc1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int64_t(msg,  0);
+}
+
+/**
+ * @brief Get field ts1 from timesync message
+ *
+ * @return Time sync timestamp 2
+ */
+static inline int64_t mavlink_msg_timesync_get_ts1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int64_t(msg,  8);
+}
+
+/**
+ * @brief Decode a timesync message into a struct
+ *
+ * @param msg The message to decode
+ * @param timesync C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_timesync_decode(const mavlink_message_t* msg, mavlink_timesync_t* timesync)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	timesync->tc1 = mavlink_msg_timesync_get_tc1(msg);
+	timesync->ts1 = mavlink_msg_timesync_get_ts1(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_TIMESYNC_LEN? msg->len : MAVLINK_MSG_ID_TIMESYNC_LEN;
+        memset(timesync, 0, MAVLINK_MSG_ID_TIMESYNC_LEN);
+	memcpy(timesync, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_v2_extension.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_v2_extension.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_v2_extension.h	(revision 209)
@@ -0,0 +1,304 @@
+// MESSAGE V2_EXTENSION PACKING
+
+#define MAVLINK_MSG_ID_V2_EXTENSION 248
+
+typedef struct MAVLINK_PACKED __mavlink_v2_extension_t
+{
+ uint16_t message_type; /*< A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings).  If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml.  Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.*/
+ uint8_t target_network; /*< Network ID (0 for broadcast)*/
+ uint8_t target_system; /*< System ID (0 for broadcast)*/
+ uint8_t target_component; /*< Component ID (0 for broadcast)*/
+ uint8_t payload[249]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/
+} mavlink_v2_extension_t;
+
+#define MAVLINK_MSG_ID_V2_EXTENSION_LEN 254
+#define MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN 254
+#define MAVLINK_MSG_ID_248_LEN 254
+#define MAVLINK_MSG_ID_248_MIN_LEN 254
+
+#define MAVLINK_MSG_ID_V2_EXTENSION_CRC 8
+#define MAVLINK_MSG_ID_248_CRC 8
+
+#define MAVLINK_MSG_V2_EXTENSION_FIELD_PAYLOAD_LEN 249
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_V2_EXTENSION { \
+	248, \
+	"V2_EXTENSION", \
+	5, \
+	{  { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \
+         { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_V2_EXTENSION { \
+	"V2_EXTENSION", \
+	5, \
+	{  { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \
+         { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \
+         { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \
+         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \
+         { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a v2_extension message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings).  If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml.  Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN];
+	_mav_put_uint16_t(buf, 0, message_type);
+	_mav_put_uint8_t(buf, 2, target_network);
+	_mav_put_uint8_t(buf, 3, target_system);
+	_mav_put_uint8_t(buf, 4, target_component);
+	_mav_put_uint8_t_array(buf, 5, payload, 249);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
+#else
+	mavlink_v2_extension_t packet;
+	packet.message_type = message_type;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+}
+
+/**
+ * @brief Pack a v2_extension message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings).  If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml.  Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_v2_extension_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint8_t target_network,uint8_t target_system,uint8_t target_component,uint16_t message_type,const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN];
+	_mav_put_uint16_t(buf, 0, message_type);
+	_mav_put_uint8_t(buf, 2, target_network);
+	_mav_put_uint8_t(buf, 3, target_system);
+	_mav_put_uint8_t(buf, 4, target_component);
+	_mav_put_uint8_t_array(buf, 5, payload, 249);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
+#else
+	mavlink_v2_extension_t packet;
+	packet.message_type = message_type;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+}
+
+/**
+ * @brief Encode a v2_extension struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param v2_extension C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_v2_extension_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension)
+{
+	return mavlink_msg_v2_extension_pack(system_id, component_id, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
+}
+
+/**
+ * @brief Encode a v2_extension struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param v2_extension C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_v2_extension_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension)
+{
+	return mavlink_msg_v2_extension_pack_chan(system_id, component_id, chan, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
+}
+
+/**
+ * @brief Send a v2_extension message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param target_network Network ID (0 for broadcast)
+ * @param target_system System ID (0 for broadcast)
+ * @param target_component Component ID (0 for broadcast)
+ * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings).  If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml.  Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
+ * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_v2_extension_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN];
+	_mav_put_uint16_t(buf, 0, message_type);
+	_mav_put_uint8_t(buf, 2, target_network);
+	_mav_put_uint8_t(buf, 3, target_system);
+	_mav_put_uint8_t(buf, 4, target_component);
+	_mav_put_uint8_t_array(buf, 5, payload, 249);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+#else
+	mavlink_v2_extension_t packet;
+	packet.message_type = message_type;
+	packet.target_network = target_network;
+	packet.target_system = target_system;
+	packet.target_component = target_component;
+	mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)&packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a v2_extension message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_v2_extension_send_struct(mavlink_channel_t chan, const mavlink_v2_extension_t* v2_extension)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_v2_extension_send(chan, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)v2_extension, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_V2_EXTENSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_v2_extension_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint16_t(buf, 0, message_type);
+	_mav_put_uint8_t(buf, 2, target_network);
+	_mav_put_uint8_t(buf, 3, target_system);
+	_mav_put_uint8_t(buf, 4, target_component);
+	_mav_put_uint8_t_array(buf, 5, payload, 249);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+#else
+	mavlink_v2_extension_t *packet = (mavlink_v2_extension_t *)msgbuf;
+	packet->message_type = message_type;
+	packet->target_network = target_network;
+	packet->target_system = target_system;
+	packet->target_component = target_component;
+	mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*249);
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE V2_EXTENSION UNPACKING
+
+
+/**
+ * @brief Get field target_network from v2_extension message
+ *
+ * @return Network ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  2);
+}
+
+/**
+ * @brief Get field target_system from v2_extension message
+ *
+ * @return System ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  3);
+}
+
+/**
+ * @brief Get field target_component from v2_extension message
+ *
+ * @return Component ID (0 for broadcast)
+ */
+static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint8_t(msg,  4);
+}
+
+/**
+ * @brief Get field message_type from v2_extension message
+ *
+ * @return A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings).  If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml.  Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
+ */
+static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  0);
+}
+
+/**
+ * @brief Get field payload from v2_extension message
+ *
+ * @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields.  The entire content of this block is opaque unless you understand any the encoding message_type.  The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
+ */
+static inline uint16_t mavlink_msg_v2_extension_get_payload(const mavlink_message_t* msg, uint8_t *payload)
+{
+	return _MAV_RETURN_uint8_t_array(msg, payload, 249,  5);
+}
+
+/**
+ * @brief Decode a v2_extension message into a struct
+ *
+ * @param msg The message to decode
+ * @param v2_extension C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_v2_extension_decode(const mavlink_message_t* msg, mavlink_v2_extension_t* v2_extension)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	v2_extension->message_type = mavlink_msg_v2_extension_get_message_type(msg);
+	v2_extension->target_network = mavlink_msg_v2_extension_get_target_network(msg);
+	v2_extension->target_system = mavlink_msg_v2_extension_get_target_system(msg);
+	v2_extension->target_component = mavlink_msg_v2_extension_get_target_component(msg);
+	mavlink_msg_v2_extension_get_payload(msg, v2_extension->payload);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_V2_EXTENSION_LEN? msg->len : MAVLINK_MSG_ID_V2_EXTENSION_LEN;
+        memset(v2_extension, 0, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
+	memcpy(v2_extension, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vfr_hud.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vfr_hud.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vfr_hud.h	(revision 209)
@@ -0,0 +1,337 @@
+// MESSAGE VFR_HUD PACKING
+
+#define MAVLINK_MSG_ID_VFR_HUD 74
+
+typedef struct MAVLINK_PACKED __mavlink_vfr_hud_t
+{
+ float airspeed; /*< Current airspeed in m/s*/
+ float groundspeed; /*< Current ground speed in m/s*/
+ float alt; /*< Current altitude (MSL), in meters*/
+ float climb; /*< Current climb rate in meters/second*/
+ int16_t heading; /*< Current heading in degrees, in compass units (0..360, 0=north)*/
+ uint16_t throttle; /*< Current throttle setting in integer percent, 0 to 100*/
+} mavlink_vfr_hud_t;
+
+#define MAVLINK_MSG_ID_VFR_HUD_LEN 20
+#define MAVLINK_MSG_ID_VFR_HUD_MIN_LEN 20
+#define MAVLINK_MSG_ID_74_LEN 20
+#define MAVLINK_MSG_ID_74_MIN_LEN 20
+
+#define MAVLINK_MSG_ID_VFR_HUD_CRC 20
+#define MAVLINK_MSG_ID_74_CRC 20
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_VFR_HUD { \
+	74, \
+	"VFR_HUD", \
+	6, \
+	{  { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \
+         { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \
+         { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \
+         { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vfr_hud_t, heading) }, \
+         { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_VFR_HUD { \
+	"VFR_HUD", \
+	6, \
+	{  { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \
+         { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \
+         { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \
+         { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \
+         { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vfr_hud_t, heading) }, \
+         { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a vfr_hud message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param airspeed Current airspeed in m/s
+ * @param groundspeed Current ground speed in m/s
+ * @param heading Current heading in degrees, in compass units (0..360, 0=north)
+ * @param throttle Current throttle setting in integer percent, 0 to 100
+ * @param alt Current altitude (MSL), in meters
+ * @param climb Current climb rate in meters/second
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VFR_HUD_LEN];
+	_mav_put_float(buf, 0, airspeed);
+	_mav_put_float(buf, 4, groundspeed);
+	_mav_put_float(buf, 8, alt);
+	_mav_put_float(buf, 12, climb);
+	_mav_put_int16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, throttle);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN);
+#else
+	mavlink_vfr_hud_t packet;
+	packet.airspeed = airspeed;
+	packet.groundspeed = groundspeed;
+	packet.alt = alt;
+	packet.climb = climb;
+	packet.heading = heading;
+	packet.throttle = throttle;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VFR_HUD;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+}
+
+/**
+ * @brief Pack a vfr_hud message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param airspeed Current airspeed in m/s
+ * @param groundspeed Current ground speed in m/s
+ * @param heading Current heading in degrees, in compass units (0..360, 0=north)
+ * @param throttle Current throttle setting in integer percent, 0 to 100
+ * @param alt Current altitude (MSL), in meters
+ * @param climb Current climb rate in meters/second
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           float airspeed,float groundspeed,int16_t heading,uint16_t throttle,float alt,float climb)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VFR_HUD_LEN];
+	_mav_put_float(buf, 0, airspeed);
+	_mav_put_float(buf, 4, groundspeed);
+	_mav_put_float(buf, 8, alt);
+	_mav_put_float(buf, 12, climb);
+	_mav_put_int16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, throttle);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN);
+#else
+	mavlink_vfr_hud_t packet;
+	packet.airspeed = airspeed;
+	packet.groundspeed = groundspeed;
+	packet.alt = alt;
+	packet.climb = climb;
+	packet.heading = heading;
+	packet.throttle = throttle;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VFR_HUD;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+}
+
+/**
+ * @brief Encode a vfr_hud struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param vfr_hud C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vfr_hud_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vfr_hud_t* vfr_hud)
+{
+	return mavlink_msg_vfr_hud_pack(system_id, component_id, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb);
+}
+
+/**
+ * @brief Encode a vfr_hud struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vfr_hud C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vfr_hud_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vfr_hud_t* vfr_hud)
+{
+	return mavlink_msg_vfr_hud_pack_chan(system_id, component_id, chan, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb);
+}
+
+/**
+ * @brief Send a vfr_hud message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param airspeed Current airspeed in m/s
+ * @param groundspeed Current ground speed in m/s
+ * @param heading Current heading in degrees, in compass units (0..360, 0=north)
+ * @param throttle Current throttle setting in integer percent, 0 to 100
+ * @param alt Current altitude (MSL), in meters
+ * @param climb Current climb rate in meters/second
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VFR_HUD_LEN];
+	_mav_put_float(buf, 0, airspeed);
+	_mav_put_float(buf, 4, groundspeed);
+	_mav_put_float(buf, 8, alt);
+	_mav_put_float(buf, 12, climb);
+	_mav_put_int16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, throttle);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+#else
+	mavlink_vfr_hud_t packet;
+	packet.airspeed = airspeed;
+	packet.groundspeed = groundspeed;
+	packet.alt = alt;
+	packet.climb = climb;
+	packet.heading = heading;
+	packet.throttle = throttle;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+#endif
+}
+
+/**
+ * @brief Send a vfr_hud message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_vfr_hud_send_struct(mavlink_channel_t chan, const mavlink_vfr_hud_t* vfr_hud)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_vfr_hud_send(chan, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)vfr_hud, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_VFR_HUD_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_vfr_hud_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_float(buf, 0, airspeed);
+	_mav_put_float(buf, 4, groundspeed);
+	_mav_put_float(buf, 8, alt);
+	_mav_put_float(buf, 12, climb);
+	_mav_put_int16_t(buf, 16, heading);
+	_mav_put_uint16_t(buf, 18, throttle);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+#else
+	mavlink_vfr_hud_t *packet = (mavlink_vfr_hud_t *)msgbuf;
+	packet->airspeed = airspeed;
+	packet->groundspeed = groundspeed;
+	packet->alt = alt;
+	packet->climb = climb;
+	packet->heading = heading;
+	packet->throttle = throttle;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)packet, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE VFR_HUD UNPACKING
+
+
+/**
+ * @brief Get field airspeed from vfr_hud message
+ *
+ * @return Current airspeed in m/s
+ */
+static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  0);
+}
+
+/**
+ * @brief Get field groundspeed from vfr_hud message
+ *
+ * @return Current ground speed in m/s
+ */
+static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  4);
+}
+
+/**
+ * @brief Get field heading from vfr_hud message
+ *
+ * @return Current heading in degrees, in compass units (0..360, 0=north)
+ */
+static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_int16_t(msg,  16);
+}
+
+/**
+ * @brief Get field throttle from vfr_hud message
+ *
+ * @return Current throttle setting in integer percent, 0 to 100
+ */
+static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint16_t(msg,  18);
+}
+
+/**
+ * @brief Get field alt from vfr_hud message
+ *
+ * @return Current altitude (MSL), in meters
+ */
+static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field climb from vfr_hud message
+ *
+ * @return Current climb rate in meters/second
+ */
+static inline float mavlink_msg_vfr_hud_get_climb(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Decode a vfr_hud message into a struct
+ *
+ * @param msg The message to decode
+ * @param vfr_hud C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_vfr_hud_decode(const mavlink_message_t* msg, mavlink_vfr_hud_t* vfr_hud)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	vfr_hud->airspeed = mavlink_msg_vfr_hud_get_airspeed(msg);
+	vfr_hud->groundspeed = mavlink_msg_vfr_hud_get_groundspeed(msg);
+	vfr_hud->alt = mavlink_msg_vfr_hud_get_alt(msg);
+	vfr_hud->climb = mavlink_msg_vfr_hud_get_climb(msg);
+	vfr_hud->heading = mavlink_msg_vfr_hud_get_heading(msg);
+	vfr_hud->throttle = mavlink_msg_vfr_hud_get_throttle(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_VFR_HUD_LEN? msg->len : MAVLINK_MSG_ID_VFR_HUD_LEN;
+        memset(vfr_hud, 0, MAVLINK_MSG_ID_VFR_HUD_LEN);
+	memcpy(vfr_hud, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vibration.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vibration.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vibration.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE VIBRATION PACKING
+
+#define MAVLINK_MSG_ID_VIBRATION 241
+
+typedef struct MAVLINK_PACKED __mavlink_vibration_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float vibration_x; /*< Vibration levels on X-axis*/
+ float vibration_y; /*< Vibration levels on Y-axis*/
+ float vibration_z; /*< Vibration levels on Z-axis*/
+ uint32_t clipping_0; /*< first accelerometer clipping count*/
+ uint32_t clipping_1; /*< second accelerometer clipping count*/
+ uint32_t clipping_2; /*< third accelerometer clipping count*/
+} mavlink_vibration_t;
+
+#define MAVLINK_MSG_ID_VIBRATION_LEN 32
+#define MAVLINK_MSG_ID_VIBRATION_MIN_LEN 32
+#define MAVLINK_MSG_ID_241_LEN 32
+#define MAVLINK_MSG_ID_241_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_VIBRATION_CRC 90
+#define MAVLINK_MSG_ID_241_CRC 90
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_VIBRATION { \
+	241, \
+	"VIBRATION", \
+	7, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vibration_t, time_usec) }, \
+         { "vibration_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vibration_t, vibration_x) }, \
+         { "vibration_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vibration_t, vibration_y) }, \
+         { "vibration_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vibration_t, vibration_z) }, \
+         { "clipping_0", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_vibration_t, clipping_0) }, \
+         { "clipping_1", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_vibration_t, clipping_1) }, \
+         { "clipping_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_vibration_t, clipping_2) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_VIBRATION { \
+	"VIBRATION", \
+	7, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vibration_t, time_usec) }, \
+         { "vibration_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vibration_t, vibration_x) }, \
+         { "vibration_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vibration_t, vibration_y) }, \
+         { "vibration_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vibration_t, vibration_z) }, \
+         { "clipping_0", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_vibration_t, clipping_0) }, \
+         { "clipping_1", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_vibration_t, clipping_1) }, \
+         { "clipping_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_vibration_t, clipping_2) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a vibration message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param vibration_x Vibration levels on X-axis
+ * @param vibration_y Vibration levels on Y-axis
+ * @param vibration_z Vibration levels on Z-axis
+ * @param clipping_0 first accelerometer clipping count
+ * @param clipping_1 second accelerometer clipping count
+ * @param clipping_2 third accelerometer clipping count
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vibration_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VIBRATION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vibration_x);
+	_mav_put_float(buf, 12, vibration_y);
+	_mav_put_float(buf, 16, vibration_z);
+	_mav_put_uint32_t(buf, 20, clipping_0);
+	_mav_put_uint32_t(buf, 24, clipping_1);
+	_mav_put_uint32_t(buf, 28, clipping_2);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIBRATION_LEN);
+#else
+	mavlink_vibration_t packet;
+	packet.time_usec = time_usec;
+	packet.vibration_x = vibration_x;
+	packet.vibration_y = vibration_y;
+	packet.vibration_z = vibration_z;
+	packet.clipping_0 = clipping_0;
+	packet.clipping_1 = clipping_1;
+	packet.clipping_2 = clipping_2;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIBRATION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VIBRATION;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+}
+
+/**
+ * @brief Pack a vibration message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param vibration_x Vibration levels on X-axis
+ * @param vibration_y Vibration levels on Y-axis
+ * @param vibration_z Vibration levels on Z-axis
+ * @param clipping_0 first accelerometer clipping count
+ * @param clipping_1 second accelerometer clipping count
+ * @param clipping_2 third accelerometer clipping count
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vibration_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float vibration_x,float vibration_y,float vibration_z,uint32_t clipping_0,uint32_t clipping_1,uint32_t clipping_2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VIBRATION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vibration_x);
+	_mav_put_float(buf, 12, vibration_y);
+	_mav_put_float(buf, 16, vibration_z);
+	_mav_put_uint32_t(buf, 20, clipping_0);
+	_mav_put_uint32_t(buf, 24, clipping_1);
+	_mav_put_uint32_t(buf, 28, clipping_2);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIBRATION_LEN);
+#else
+	mavlink_vibration_t packet;
+	packet.time_usec = time_usec;
+	packet.vibration_x = vibration_x;
+	packet.vibration_y = vibration_y;
+	packet.vibration_z = vibration_z;
+	packet.clipping_0 = clipping_0;
+	packet.clipping_1 = clipping_1;
+	packet.clipping_2 = clipping_2;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIBRATION_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VIBRATION;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+}
+
+/**
+ * @brief Encode a vibration struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param vibration C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vibration_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vibration_t* vibration)
+{
+	return mavlink_msg_vibration_pack(system_id, component_id, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2);
+}
+
+/**
+ * @brief Encode a vibration struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vibration C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vibration_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vibration_t* vibration)
+{
+	return mavlink_msg_vibration_pack_chan(system_id, component_id, chan, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2);
+}
+
+/**
+ * @brief Send a vibration message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param vibration_x Vibration levels on X-axis
+ * @param vibration_y Vibration levels on Y-axis
+ * @param vibration_z Vibration levels on Z-axis
+ * @param clipping_0 first accelerometer clipping count
+ * @param clipping_1 second accelerometer clipping count
+ * @param clipping_2 third accelerometer clipping count
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_vibration_send(mavlink_channel_t chan, uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VIBRATION_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vibration_x);
+	_mav_put_float(buf, 12, vibration_y);
+	_mav_put_float(buf, 16, vibration_z);
+	_mav_put_uint32_t(buf, 20, clipping_0);
+	_mav_put_uint32_t(buf, 24, clipping_1);
+	_mav_put_uint32_t(buf, 28, clipping_2);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+#else
+	mavlink_vibration_t packet;
+	packet.time_usec = time_usec;
+	packet.vibration_x = vibration_x;
+	packet.vibration_y = vibration_y;
+	packet.vibration_z = vibration_z;
+	packet.clipping_0 = clipping_0;
+	packet.clipping_1 = clipping_1;
+	packet.clipping_2 = clipping_2;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)&packet, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+#endif
+}
+
+/**
+ * @brief Send a vibration message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_vibration_send_struct(mavlink_channel_t chan, const mavlink_vibration_t* vibration)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_vibration_send(chan, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)vibration, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_VIBRATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_vibration_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, vibration_x);
+	_mav_put_float(buf, 12, vibration_y);
+	_mav_put_float(buf, 16, vibration_z);
+	_mav_put_uint32_t(buf, 20, clipping_0);
+	_mav_put_uint32_t(buf, 24, clipping_1);
+	_mav_put_uint32_t(buf, 28, clipping_2);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+#else
+	mavlink_vibration_t *packet = (mavlink_vibration_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->vibration_x = vibration_x;
+	packet->vibration_y = vibration_y;
+	packet->vibration_z = vibration_z;
+	packet->clipping_0 = clipping_0;
+	packet->clipping_1 = clipping_1;
+	packet->clipping_2 = clipping_2;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)packet, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE VIBRATION UNPACKING
+
+
+/**
+ * @brief Get field time_usec from vibration message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_vibration_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field vibration_x from vibration message
+ *
+ * @return Vibration levels on X-axis
+ */
+static inline float mavlink_msg_vibration_get_vibration_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field vibration_y from vibration message
+ *
+ * @return Vibration levels on Y-axis
+ */
+static inline float mavlink_msg_vibration_get_vibration_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field vibration_z from vibration message
+ *
+ * @return Vibration levels on Z-axis
+ */
+static inline float mavlink_msg_vibration_get_vibration_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field clipping_0 from vibration message
+ *
+ * @return first accelerometer clipping count
+ */
+static inline uint32_t mavlink_msg_vibration_get_clipping_0(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  20);
+}
+
+/**
+ * @brief Get field clipping_1 from vibration message
+ *
+ * @return second accelerometer clipping count
+ */
+static inline uint32_t mavlink_msg_vibration_get_clipping_1(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  24);
+}
+
+/**
+ * @brief Get field clipping_2 from vibration message
+ *
+ * @return third accelerometer clipping count
+ */
+static inline uint32_t mavlink_msg_vibration_get_clipping_2(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint32_t(msg,  28);
+}
+
+/**
+ * @brief Decode a vibration message into a struct
+ *
+ * @param msg The message to decode
+ * @param vibration C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_vibration_decode(const mavlink_message_t* msg, mavlink_vibration_t* vibration)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	vibration->time_usec = mavlink_msg_vibration_get_time_usec(msg);
+	vibration->vibration_x = mavlink_msg_vibration_get_vibration_x(msg);
+	vibration->vibration_y = mavlink_msg_vibration_get_vibration_y(msg);
+	vibration->vibration_z = mavlink_msg_vibration_get_vibration_z(msg);
+	vibration->clipping_0 = mavlink_msg_vibration_get_clipping_0(msg);
+	vibration->clipping_1 = mavlink_msg_vibration_get_clipping_1(msg);
+	vibration->clipping_2 = mavlink_msg_vibration_get_clipping_2(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_VIBRATION_LEN? msg->len : MAVLINK_MSG_ID_VIBRATION_LEN;
+        memset(vibration, 0, MAVLINK_MSG_ID_VIBRATION_LEN);
+	memcpy(vibration, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vicon_position_estimate.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vicon_position_estimate.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vicon_position_estimate.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE VICON_POSITION_ESTIMATE PACKING
+
+#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104
+
+typedef struct MAVLINK_PACKED __mavlink_vicon_position_estimate_t
+{
+ uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float x; /*< Global X position*/
+ float y; /*< Global Y position*/
+ float z; /*< Global Z position*/
+ float roll; /*< Roll angle in rad*/
+ float pitch; /*< Pitch angle in rad*/
+ float yaw; /*< Yaw angle in rad*/
+} mavlink_vicon_position_estimate_t;
+
+#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32
+#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN 32
+#define MAVLINK_MSG_ID_104_LEN 32
+#define MAVLINK_MSG_ID_104_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC 56
+#define MAVLINK_MSG_ID_104_CRC 56
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \
+	104, \
+	"VICON_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \
+	"VICON_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a vicon_position_estimate message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_vicon_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Pack a vicon_position_estimate message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_vicon_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Encode a vicon_position_estimate struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param vicon_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
+{
+	return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
+}
+
+/**
+ * @brief Encode a vicon_position_estimate struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vicon_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vicon_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
+{
+	return mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, chan, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
+}
+
+/**
+ * @brief Send a vicon_position_estimate message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_vicon_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a vicon_position_estimate message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_vicon_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_vicon_position_estimate_t* vicon_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_vicon_position_estimate_send(chan, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)vicon_position_estimate, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_vicon_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_vicon_position_estimate_t *packet = (mavlink_vicon_position_estimate_t *)msgbuf;
+	packet->usec = usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE VICON_POSITION_ESTIMATE UNPACKING
+
+
+/**
+ * @brief Get field usec from vicon_position_estimate message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from vicon_position_estimate message
+ *
+ * @return Global X position
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y from vicon_position_estimate message
+ *
+ * @return Global Y position
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z from vicon_position_estimate message
+ *
+ * @return Global Z position
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field roll from vicon_position_estimate message
+ *
+ * @return Roll angle in rad
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitch from vicon_position_estimate message
+ *
+ * @return Pitch angle in rad
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yaw from vicon_position_estimate message
+ *
+ * @return Yaw angle in rad
+ */
+static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Decode a vicon_position_estimate message into a struct
+ *
+ * @param msg The message to decode
+ * @param vicon_position_estimate C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_message_t* msg, mavlink_vicon_position_estimate_t* vicon_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg);
+	vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg);
+	vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg);
+	vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg);
+	vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg);
+	vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg);
+	vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN;
+        memset(vicon_position_estimate, 0, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
+	memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_position_estimate.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_position_estimate.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_position_estimate.h	(revision 209)
@@ -0,0 +1,362 @@
+// MESSAGE VISION_POSITION_ESTIMATE PACKING
+
+#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102
+
+typedef struct MAVLINK_PACKED __mavlink_vision_position_estimate_t
+{
+ uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float x; /*< Global X position*/
+ float y; /*< Global Y position*/
+ float z; /*< Global Z position*/
+ float roll; /*< Roll angle in rad*/
+ float pitch; /*< Pitch angle in rad*/
+ float yaw; /*< Yaw angle in rad*/
+} mavlink_vision_position_estimate_t;
+
+#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32
+#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN 32
+#define MAVLINK_MSG_ID_102_LEN 32
+#define MAVLINK_MSG_ID_102_MIN_LEN 32
+
+#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 158
+#define MAVLINK_MSG_ID_102_CRC 158
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \
+	102, \
+	"VISION_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \
+	"VISION_POSITION_ESTIMATE", \
+	7, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \
+         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \
+         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \
+         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a vision_position_estimate message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Pack a vision_position_estimate message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
+#else
+	mavlink_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Encode a vision_position_estimate struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param vision_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
+{
+	return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
+}
+
+/**
+ * @brief Encode a vision_position_estimate struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vision_position_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate)
+{
+	return mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
+}
+
+/**
+ * @brief Send a vision_position_estimate message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X position
+ * @param y Global Y position
+ * @param z Global Z position
+ * @param roll Roll angle in rad
+ * @param pitch Pitch angle in rad
+ * @param yaw Yaw angle in rad
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_vision_position_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+	packet.roll = roll;
+	packet.pitch = pitch;
+	packet.yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a vision_position_estimate message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_vision_position_estimate_t* vision_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_vision_position_estimate_send(chan, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)vision_position_estimate, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+	_mav_put_float(buf, 20, roll);
+	_mav_put_float(buf, 24, pitch);
+	_mav_put_float(buf, 28, yaw);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+#else
+	mavlink_vision_position_estimate_t *packet = (mavlink_vision_position_estimate_t *)msgbuf;
+	packet->usec = usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+	packet->roll = roll;
+	packet->pitch = pitch;
+	packet->yaw = yaw;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE VISION_POSITION_ESTIMATE UNPACKING
+
+
+/**
+ * @brief Get field usec from vision_position_estimate message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from vision_position_estimate message
+ *
+ * @return Global X position
+ */
+static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y from vision_position_estimate message
+ *
+ * @return Global Y position
+ */
+static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z from vision_position_estimate message
+ *
+ * @return Global Z position
+ */
+static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field roll from vision_position_estimate message
+ *
+ * @return Roll angle in rad
+ */
+static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field pitch from vision_position_estimate message
+ *
+ * @return Pitch angle in rad
+ */
+static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field yaw from vision_position_estimate message
+ *
+ * @return Yaw angle in rad
+ */
+static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Decode a vision_position_estimate message into a struct
+ *
+ * @param msg The message to decode
+ * @param vision_position_estimate C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_vision_position_estimate_t* vision_position_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	vision_position_estimate->usec = mavlink_msg_vision_position_estimate_get_usec(msg);
+	vision_position_estimate->x = mavlink_msg_vision_position_estimate_get_x(msg);
+	vision_position_estimate->y = mavlink_msg_vision_position_estimate_get_y(msg);
+	vision_position_estimate->z = mavlink_msg_vision_position_estimate_get_z(msg);
+	vision_position_estimate->roll = mavlink_msg_vision_position_estimate_get_roll(msg);
+	vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg);
+	vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN;
+        memset(vision_position_estimate, 0, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
+	memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_speed_estimate.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_speed_estimate.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_vision_speed_estimate.h	(revision 209)
@@ -0,0 +1,287 @@
+// MESSAGE VISION_SPEED_ESTIMATE PACKING
+
+#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103
+
+typedef struct MAVLINK_PACKED __mavlink_vision_speed_estimate_t
+{
+ uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
+ float x; /*< Global X speed*/
+ float y; /*< Global Y speed*/
+ float z; /*< Global Z speed*/
+} mavlink_vision_speed_estimate_t;
+
+#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20
+#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 20
+#define MAVLINK_MSG_ID_103_LEN 20
+#define MAVLINK_MSG_ID_103_MIN_LEN 20
+
+#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 208
+#define MAVLINK_MSG_ID_103_CRC 208
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
+	103, \
+	"VISION_SPEED_ESTIMATE", \
+	4, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \
+	"VISION_SPEED_ESTIMATE", \
+	4, \
+	{  { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \
+         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \
+         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \
+         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a vision_speed_estimate message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X speed
+ * @param y Global Y speed
+ * @param z Global Z speed
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
+#else
+	mavlink_vision_speed_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Pack a vision_speed_estimate message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X speed
+ * @param y Global Y speed
+ * @param z Global Z speed
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t usec,float x,float y,float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
+#else
+	mavlink_vision_speed_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+}
+
+/**
+ * @brief Encode a vision_speed_estimate struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param vision_speed_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
+{
+	return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
+}
+
+/**
+ * @brief Encode a vision_speed_estimate struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param vision_speed_estimate C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
+{
+	return mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, chan, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
+}
+
+/**
+ * @brief Send a vision_speed_estimate message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
+ * @param x Global X speed
+ * @param y Global Y speed
+ * @param z Global Z speed
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN];
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+#else
+	mavlink_vision_speed_estimate_t packet;
+	packet.usec = usec;
+	packet.x = x;
+	packet.y = y;
+	packet.z = z;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+#endif
+}
+
+/**
+ * @brief Send a vision_speed_estimate message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_vision_speed_estimate_send_struct(mavlink_channel_t chan, const mavlink_vision_speed_estimate_t* vision_speed_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_vision_speed_estimate_send(chan, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)vision_speed_estimate, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t usec, float x, float y, float z)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, usec);
+	_mav_put_float(buf, 8, x);
+	_mav_put_float(buf, 12, y);
+	_mav_put_float(buf, 16, z);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+#else
+	mavlink_vision_speed_estimate_t *packet = (mavlink_vision_speed_estimate_t *)msgbuf;
+	packet->usec = usec;
+	packet->x = x;
+	packet->y = y;
+	packet->z = z;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE VISION_SPEED_ESTIMATE UNPACKING
+
+
+/**
+ * @brief Get field usec from vision_speed_estimate message
+ *
+ * @return Timestamp (microseconds, synced to UNIX time or since system boot)
+ */
+static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field x from vision_speed_estimate message
+ *
+ * @return Global X speed
+ */
+static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field y from vision_speed_estimate message
+ *
+ * @return Global Y speed
+ */
+static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field z from vision_speed_estimate message
+ *
+ * @return Global Z speed
+ */
+static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Decode a vision_speed_estimate message into a struct
+ *
+ * @param msg The message to decode
+ * @param vision_speed_estimate C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_message_t* msg, mavlink_vision_speed_estimate_t* vision_speed_estimate)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg);
+	vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg);
+	vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg);
+	vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN;
+        memset(vision_speed_estimate, 0, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
+	memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_wind_cov.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_wind_cov.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/mavlink_msg_wind_cov.h	(revision 209)
@@ -0,0 +1,412 @@
+// MESSAGE WIND_COV PACKING
+
+#define MAVLINK_MSG_ID_WIND_COV 231
+
+typedef struct MAVLINK_PACKED __mavlink_wind_cov_t
+{
+ uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
+ float wind_x; /*< Wind in X (NED) direction in m/s*/
+ float wind_y; /*< Wind in Y (NED) direction in m/s*/
+ float wind_z; /*< Wind in Z (NED) direction in m/s*/
+ float var_horiz; /*< Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.*/
+ float var_vert; /*< Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.*/
+ float wind_alt; /*< AMSL altitude (m) this measurement was taken at*/
+ float horiz_accuracy; /*< Horizontal speed 1-STD accuracy*/
+ float vert_accuracy; /*< Vertical speed 1-STD accuracy*/
+} mavlink_wind_cov_t;
+
+#define MAVLINK_MSG_ID_WIND_COV_LEN 40
+#define MAVLINK_MSG_ID_WIND_COV_MIN_LEN 40
+#define MAVLINK_MSG_ID_231_LEN 40
+#define MAVLINK_MSG_ID_231_MIN_LEN 40
+
+#define MAVLINK_MSG_ID_WIND_COV_CRC 105
+#define MAVLINK_MSG_ID_231_CRC 105
+
+
+
+#if MAVLINK_COMMAND_24BIT
+#define MAVLINK_MESSAGE_INFO_WIND_COV { \
+	231, \
+	"WIND_COV", \
+	9, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
+         { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
+         { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
+         { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
+         { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
+         { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
+         { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
+         { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
+         { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
+         } \
+}
+#else
+#define MAVLINK_MESSAGE_INFO_WIND_COV { \
+	"WIND_COV", \
+	9, \
+	{  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \
+         { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \
+         { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \
+         { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \
+         { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \
+         { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \
+         { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \
+         { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \
+         { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \
+         } \
+}
+#endif
+
+/**
+ * @brief Pack a wind_cov message
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param wind_x Wind in X (NED) direction in m/s
+ * @param wind_y Wind in Y (NED) direction in m/s
+ * @param wind_z Wind in Z (NED) direction in m/s
+ * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
+ * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
+ * @param wind_alt AMSL altitude (m) this measurement was taken at
+ * @param horiz_accuracy Horizontal speed 1-STD accuracy
+ * @param vert_accuracy Vertical speed 1-STD accuracy
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
+						       uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, wind_x);
+	_mav_put_float(buf, 12, wind_y);
+	_mav_put_float(buf, 16, wind_z);
+	_mav_put_float(buf, 20, var_horiz);
+	_mav_put_float(buf, 24, var_vert);
+	_mav_put_float(buf, 28, wind_alt);
+	_mav_put_float(buf, 32, horiz_accuracy);
+	_mav_put_float(buf, 36, vert_accuracy);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
+#else
+	mavlink_wind_cov_t packet;
+	packet.time_usec = time_usec;
+	packet.wind_x = wind_x;
+	packet.wind_y = wind_y;
+	packet.wind_z = wind_z;
+	packet.var_horiz = var_horiz;
+	packet.var_vert = var_vert;
+	packet.wind_alt = wind_alt;
+	packet.horiz_accuracy = horiz_accuracy;
+	packet.vert_accuracy = vert_accuracy;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_WIND_COV;
+    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+}
+
+/**
+ * @brief Pack a wind_cov message on a channel
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param wind_x Wind in X (NED) direction in m/s
+ * @param wind_y Wind in Y (NED) direction in m/s
+ * @param wind_z Wind in Z (NED) direction in m/s
+ * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
+ * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
+ * @param wind_alt AMSL altitude (m) this measurement was taken at
+ * @param horiz_accuracy Horizontal speed 1-STD accuracy
+ * @param vert_accuracy Vertical speed 1-STD accuracy
+ * @return length of the message in bytes (excluding serial stream start sign)
+ */
+static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
+							   mavlink_message_t* msg,
+						           uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, wind_x);
+	_mav_put_float(buf, 12, wind_y);
+	_mav_put_float(buf, 16, wind_z);
+	_mav_put_float(buf, 20, var_horiz);
+	_mav_put_float(buf, 24, var_vert);
+	_mav_put_float(buf, 28, wind_alt);
+	_mav_put_float(buf, 32, horiz_accuracy);
+	_mav_put_float(buf, 36, vert_accuracy);
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
+#else
+	mavlink_wind_cov_t packet;
+	packet.time_usec = time_usec;
+	packet.wind_x = wind_x;
+	packet.wind_y = wind_y;
+	packet.wind_z = wind_z;
+	packet.var_horiz = var_horiz;
+	packet.var_vert = var_vert;
+	packet.wind_alt = wind_alt;
+	packet.horiz_accuracy = horiz_accuracy;
+	packet.vert_accuracy = vert_accuracy;
+
+        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
+#endif
+
+	msg->msgid = MAVLINK_MSG_ID_WIND_COV;
+    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+}
+
+/**
+ * @brief Encode a wind_cov struct
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param msg The MAVLink message to compress the data into
+ * @param wind_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
+{
+	return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
+}
+
+/**
+ * @brief Encode a wind_cov struct on a channel
+ *
+ * @param system_id ID of this system
+ * @param component_id ID of this component (e.g. 200 for IMU)
+ * @param chan The MAVLink channel this message will be sent over
+ * @param msg The MAVLink message to compress the data into
+ * @param wind_cov C-struct to read the message contents from
+ */
+static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
+{
+	return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
+}
+
+/**
+ * @brief Send a wind_cov message
+ * @param chan MAVLink channel to send the message
+ *
+ * @param time_usec Timestamp (micros since boot or Unix epoch)
+ * @param wind_x Wind in X (NED) direction in m/s
+ * @param wind_y Wind in Y (NED) direction in m/s
+ * @param wind_z Wind in Z (NED) direction in m/s
+ * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
+ * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
+ * @param wind_alt AMSL altitude (m) this measurement was taken at
+ * @param horiz_accuracy Horizontal speed 1-STD accuracy
+ * @param vert_accuracy Vertical speed 1-STD accuracy
+ */
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, wind_x);
+	_mav_put_float(buf, 12, wind_y);
+	_mav_put_float(buf, 16, wind_z);
+	_mav_put_float(buf, 20, var_horiz);
+	_mav_put_float(buf, 24, var_vert);
+	_mav_put_float(buf, 28, wind_alt);
+	_mav_put_float(buf, 32, horiz_accuracy);
+	_mav_put_float(buf, 36, vert_accuracy);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+#else
+	mavlink_wind_cov_t packet;
+	packet.time_usec = time_usec;
+	packet.wind_x = wind_x;
+	packet.wind_y = wind_y;
+	packet.wind_z = wind_z;
+	packet.var_horiz = var_horiz;
+	packet.var_vert = var_vert;
+	packet.wind_alt = wind_alt;
+	packet.horiz_accuracy = horiz_accuracy;
+	packet.vert_accuracy = vert_accuracy;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+#endif
+}
+
+/**
+ * @brief Send a wind_cov message
+ * @param chan MAVLink channel to send the message
+ * @param struct The MAVLink struct to serialize
+ */
+static inline void mavlink_msg_wind_cov_send_struct(mavlink_channel_t chan, const mavlink_wind_cov_t* wind_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+    mavlink_msg_wind_cov_send(chan, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
+#else
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)wind_cov, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+#endif
+}
+
+#if MAVLINK_MSG_ID_WIND_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+  This varient of _send() can be used to save stack space by re-using
+  memory from the receive buffer.  The caller provides a
+  mavlink_message_t which is the size of a full mavlink message. This
+  is usually the receive buffer for the channel, and allows a reply to an
+  incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	char *buf = (char *)msgbuf;
+	_mav_put_uint64_t(buf, 0, time_usec);
+	_mav_put_float(buf, 8, wind_x);
+	_mav_put_float(buf, 12, wind_y);
+	_mav_put_float(buf, 16, wind_z);
+	_mav_put_float(buf, 20, var_horiz);
+	_mav_put_float(buf, 24, var_vert);
+	_mav_put_float(buf, 28, wind_alt);
+	_mav_put_float(buf, 32, horiz_accuracy);
+	_mav_put_float(buf, 36, vert_accuracy);
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+#else
+	mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf;
+	packet->time_usec = time_usec;
+	packet->wind_x = wind_x;
+	packet->wind_y = wind_y;
+	packet->wind_z = wind_z;
+	packet->var_horiz = var_horiz;
+	packet->var_vert = var_vert;
+	packet->wind_alt = wind_alt;
+	packet->horiz_accuracy = horiz_accuracy;
+	packet->vert_accuracy = vert_accuracy;
+
+    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
+#endif
+}
+#endif
+
+#endif
+
+// MESSAGE WIND_COV UNPACKING
+
+
+/**
+ * @brief Get field time_usec from wind_cov message
+ *
+ * @return Timestamp (micros since boot or Unix epoch)
+ */
+static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_uint64_t(msg,  0);
+}
+
+/**
+ * @brief Get field wind_x from wind_cov message
+ *
+ * @return Wind in X (NED) direction in m/s
+ */
+static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  8);
+}
+
+/**
+ * @brief Get field wind_y from wind_cov message
+ *
+ * @return Wind in Y (NED) direction in m/s
+ */
+static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  12);
+}
+
+/**
+ * @brief Get field wind_z from wind_cov message
+ *
+ * @return Wind in Z (NED) direction in m/s
+ */
+static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  16);
+}
+
+/**
+ * @brief Get field var_horiz from wind_cov message
+ *
+ * @return Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.
+ */
+static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  20);
+}
+
+/**
+ * @brief Get field var_vert from wind_cov message
+ *
+ * @return Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.
+ */
+static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  24);
+}
+
+/**
+ * @brief Get field wind_alt from wind_cov message
+ *
+ * @return AMSL altitude (m) this measurement was taken at
+ */
+static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  28);
+}
+
+/**
+ * @brief Get field horiz_accuracy from wind_cov message
+ *
+ * @return Horizontal speed 1-STD accuracy
+ */
+static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  32);
+}
+
+/**
+ * @brief Get field vert_accuracy from wind_cov message
+ *
+ * @return Vertical speed 1-STD accuracy
+ */
+static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg)
+{
+	return _MAV_RETURN_float(msg,  36);
+}
+
+/**
+ * @brief Decode a wind_cov message into a struct
+ *
+ * @param msg The message to decode
+ * @param wind_cov C-struct to decode the message contents into
+ */
+static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+	wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg);
+	wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg);
+	wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg);
+	wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg);
+	wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg);
+	wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg);
+	wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg);
+	wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg);
+	wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg);
+#else
+        uint8_t len = msg->len < MAVLINK_MSG_ID_WIND_COV_LEN? msg->len : MAVLINK_MSG_ID_WIND_COV_LEN;
+        memset(wind_cov, 0, MAVLINK_MSG_ID_WIND_COV_LEN);
+	memcpy(wind_cov, _MAV_PAYLOAD(msg), len);
+#endif
+}
Index: tags/latest/tools/Controller/Mavlink/src/include/common/testsuite.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/testsuite.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/testsuite.h	(revision 209)
@@ -0,0 +1,8118 @@
+/** @file
+ *	@brief MAVLink comm protocol testsuite generated from common.xml
+ *	@see http://qgroundcontrol.org/mavlink/
+ */
+#ifndef COMMON_TESTSUITE_H
+#define COMMON_TESTSUITE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MAVLINK_TEST_ALL
+#define MAVLINK_TEST_ALL
+
+static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
+
+static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+
+	mavlink_test_common(system_id, component_id, last_msg);
+}
+#endif
+
+
+
+
+static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HEARTBEAT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_heartbeat_t packet_in = {
+		963497464,17,84,151,218,3
+    };
+	mavlink_heartbeat_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.custom_mode = packet_in.custom_mode;
+        packet1.type = packet_in.type;
+        packet1.autopilot = packet_in.autopilot;
+        packet1.base_mode = packet_in.base_mode;
+        packet1.system_status = packet_in.system_status;
+        packet1.mavlink_version = packet_in.mavlink_version;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_heartbeat_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
+	mavlink_msg_heartbeat_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
+	mavlink_msg_heartbeat_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_heartbeat_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_heartbeat_send(MAVLINK_COMM_1 , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
+	mavlink_msg_heartbeat_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYS_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_sys_status_t packet_in = {
+		963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223
+    };
+	mavlink_sys_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present;
+        packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled;
+        packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health;
+        packet1.load = packet_in.load;
+        packet1.voltage_battery = packet_in.voltage_battery;
+        packet1.current_battery = packet_in.current_battery;
+        packet1.drop_rate_comm = packet_in.drop_rate_comm;
+        packet1.errors_comm = packet_in.errors_comm;
+        packet1.errors_count1 = packet_in.errors_count1;
+        packet1.errors_count2 = packet_in.errors_count2;
+        packet1.errors_count3 = packet_in.errors_count3;
+        packet1.errors_count4 = packet_in.errors_count4;
+        packet1.battery_remaining = packet_in.battery_remaining;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_sys_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sys_status_pack(system_id, component_id, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 );
+	mavlink_msg_sys_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 );
+	mavlink_msg_sys_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_sys_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sys_status_send(MAVLINK_COMM_1 , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 );
+	mavlink_msg_sys_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYSTEM_TIME >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_system_time_t packet_in = {
+		93372036854775807ULL,963497880
+    };
+	mavlink_system_time_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_unix_usec = packet_in.time_unix_usec;
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_system_time_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
+	mavlink_msg_system_time_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
+	mavlink_msg_system_time_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_system_time_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_system_time_send(MAVLINK_COMM_1 , packet1.time_unix_usec , packet1.time_boot_ms );
+	mavlink_msg_system_time_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PING >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_ping_t packet_in = {
+		93372036854775807ULL,963497880,41,108
+    };
+	mavlink_ping_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.seq = packet_in.seq;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PING_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_ping_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
+	mavlink_msg_ping_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
+	mavlink_msg_ping_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_ping_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_ping_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
+	mavlink_msg_ping_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_change_operator_control_t packet_in = {
+		5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA"
+    };
+	mavlink_change_operator_control_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.control_request = packet_in.control_request;
+        packet1.version = packet_in.version;
+        
+        mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_change_operator_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
+	mavlink_msg_change_operator_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
+	mavlink_msg_change_operator_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_change_operator_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
+	mavlink_msg_change_operator_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_change_operator_control_ack_t packet_in = {
+		5,72,139
+    };
+	mavlink_change_operator_control_ack_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.gcs_system_id = packet_in.gcs_system_id;
+        packet1.control_request = packet_in.control_request;
+        packet1.ack = packet_in.ack;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
+	mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
+	mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1 , packet1.gcs_system_id , packet1.control_request , packet1.ack );
+	mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTH_KEY >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_auth_key_t packet_in = {
+		"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
+    };
+	mavlink_auth_key_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        
+        mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_auth_key_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key );
+	mavlink_msg_auth_key_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key );
+	mavlink_msg_auth_key_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_auth_key_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_auth_key_send(MAVLINK_COMM_1 , packet1.key );
+	mavlink_msg_auth_key_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MODE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_mode_t packet_in = {
+		963497464,17,84
+    };
+	mavlink_set_mode_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.custom_mode = packet_in.custom_mode;
+        packet1.target_system = packet_in.target_system;
+        packet1.base_mode = packet_in.base_mode;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_MODE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MODE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_mode_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
+	mavlink_msg_set_mode_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
+	mavlink_msg_set_mode_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_mode_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_mode_send(MAVLINK_COMM_1 , packet1.target_system , packet1.base_mode , packet1.custom_mode );
+	mavlink_msg_set_mode_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_READ >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_param_request_read_t packet_in = {
+		17235,139,206,"EFGHIJKLMNOPQRS"
+    };
+	mavlink_param_request_read_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param_index = packet_in.param_index;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_param_request_read_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
+	mavlink_msg_param_request_read_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
+	mavlink_msg_param_request_read_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_param_request_read_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
+	mavlink_msg_param_request_read_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_LIST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_param_request_list_t packet_in = {
+		5,72
+    };
+	mavlink_param_request_list_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_param_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_param_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_param_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_param_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
+	mavlink_msg_param_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_VALUE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_param_value_t packet_in = {
+		17.0,17443,17547,"IJKLMNOPQRSTUVW",77
+    };
+	mavlink_param_value_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param_value = packet_in.param_value;
+        packet1.param_count = packet_in.param_count;
+        packet1.param_index = packet_in.param_index;
+        packet1.param_type = packet_in.param_type;
+        
+        mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_param_value_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
+	mavlink_msg_param_value_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
+	mavlink_msg_param_value_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_param_value_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
+	mavlink_msg_param_value_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_SET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_param_set_t packet_in = {
+		17.0,17,84,"GHIJKLMNOPQRSTU",199
+    };
+	mavlink_param_set_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param_value = packet_in.param_value;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.param_type = packet_in.param_type;
+        
+        mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PARAM_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_SET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_param_set_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
+	mavlink_msg_param_set_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
+	mavlink_msg_param_set_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_param_set_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
+	mavlink_msg_param_set_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RAW_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_raw_int_t packet_in = {
+		93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156
+    };
+	mavlink_gps_raw_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.eph = packet_in.eph;
+        packet1.epv = packet_in.epv;
+        packet1.vel = packet_in.vel;
+        packet1.cog = packet_in.cog;
+        packet1.fix_type = packet_in.fix_type;
+        packet1.satellites_visible = packet_in.satellites_visible;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_raw_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_gps_raw_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_gps_raw_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_raw_int_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_status_t packet_in = {
+		5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 }
+    };
+	mavlink_gps_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.satellites_visible = packet_in.satellites_visible;
+        
+        mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20);
+        mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20);
+        mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20);
+        mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20);
+        mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_status_pack(system_id, component_id, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
+	mavlink_msg_gps_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
+	mavlink_msg_gps_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_status_send(MAVLINK_COMM_1 , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
+	mavlink_msg_gps_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_imu_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
+    };
+	mavlink_scaled_imu_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_IMU >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_raw_imu_t packet_in = {
+		93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483
+    };
+	mavlink_raw_imu_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RAW_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_IMU_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_raw_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_raw_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_raw_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_raw_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_raw_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_PRESSURE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_raw_pressure_t packet_in = {
+		93372036854775807ULL,17651,17755,17859,17963
+    };
+	mavlink_raw_pressure_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.press_abs = packet_in.press_abs;
+        packet1.press_diff1 = packet_in.press_diff1;
+        packet1.press_diff2 = packet_in.press_diff2;
+        packet1.temperature = packet_in.temperature;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_raw_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
+	mavlink_msg_raw_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
+	mavlink_msg_raw_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_raw_pressure_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_raw_pressure_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
+	mavlink_msg_raw_pressure_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_pressure_t packet_in = {
+		963497464,45.0,73.0,17859
+    };
+	mavlink_scaled_pressure_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.press_abs = packet_in.press_abs;
+        packet1.press_diff = packet_in.press_diff;
+        packet1.temperature = packet_in.temperature;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_attitude_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0
+    };
+	mavlink_attitude_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        packet1.rollspeed = packet_in.rollspeed;
+        packet1.pitchspeed = packet_in.pitchspeed;
+        packet1.yawspeed = packet_in.yawspeed;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_attitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_attitude_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_attitude_quaternion_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0
+    };
+	mavlink_attitude_quaternion_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.q1 = packet_in.q1;
+        packet1.q2 = packet_in.q2;
+        packet1.q3 = packet_in.q3;
+        packet1.q4 = packet_in.q4;
+        packet1.rollspeed = packet_in.rollspeed;
+        packet1.pitchspeed = packet_in.pitchspeed;
+        packet1.yawspeed = packet_in.yawspeed;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
+	mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_local_position_ned_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0
+    };
+	mavlink_local_position_ned_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_local_position_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
+	mavlink_msg_local_position_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
+	mavlink_msg_local_position_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_local_position_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
+	mavlink_msg_local_position_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_global_position_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_global_position_int_t packet_in = {
+		963497464,963497672,963497880,963498088,963498296,18275,18379,18483,18587
+    };
+	mavlink_global_position_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.relative_alt = packet_in.relative_alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.hdg = packet_in.hdg;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_global_position_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
+	mavlink_msg_global_position_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
+	mavlink_msg_global_position_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_global_position_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
+	mavlink_msg_global_position_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_SCALED >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_rc_channels_scaled_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
+    };
+	mavlink_rc_channels_scaled_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.chan1_scaled = packet_in.chan1_scaled;
+        packet1.chan2_scaled = packet_in.chan2_scaled;
+        packet1.chan3_scaled = packet_in.chan3_scaled;
+        packet1.chan4_scaled = packet_in.chan4_scaled;
+        packet1.chan5_scaled = packet_in.chan5_scaled;
+        packet1.chan6_scaled = packet_in.chan6_scaled;
+        packet1.chan7_scaled = packet_in.chan7_scaled;
+        packet1.chan8_scaled = packet_in.chan8_scaled;
+        packet1.port = packet_in.port;
+        packet1.rssi = packet_in.rssi;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
+	mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
+	mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_scaled_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
+	mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_RAW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_rc_channels_raw_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
+    };
+	mavlink_rc_channels_raw_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.chan1_raw = packet_in.chan1_raw;
+        packet1.chan2_raw = packet_in.chan2_raw;
+        packet1.chan3_raw = packet_in.chan3_raw;
+        packet1.chan4_raw = packet_in.chan4_raw;
+        packet1.chan5_raw = packet_in.chan5_raw;
+        packet1.chan6_raw = packet_in.chan6_raw;
+        packet1.chan7_raw = packet_in.chan7_raw;
+        packet1.chan8_raw = packet_in.chan8_raw;
+        packet1.port = packet_in.port;
+        packet1.rssi = packet_in.rssi;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
+	mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
+	mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
+	mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERVO_OUTPUT_RAW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_servo_output_raw_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,65
+    };
+	mavlink_servo_output_raw_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.servo1_raw = packet_in.servo1_raw;
+        packet1.servo2_raw = packet_in.servo2_raw;
+        packet1.servo3_raw = packet_in.servo3_raw;
+        packet1.servo4_raw = packet_in.servo4_raw;
+        packet1.servo5_raw = packet_in.servo5_raw;
+        packet1.servo6_raw = packet_in.servo6_raw;
+        packet1.servo7_raw = packet_in.servo7_raw;
+        packet1.servo8_raw = packet_in.servo8_raw;
+        packet1.port = packet_in.port;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_servo_output_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
+	mavlink_msg_servo_output_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
+	mavlink_msg_servo_output_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
+	mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_request_partial_list_t packet_in = {
+		17235,17339,17,84
+    };
+	mavlink_mission_request_partial_list_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.start_index = packet_in.start_index;
+        packet1.end_index = packet_in.end_index;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_write_partial_list_t packet_in = {
+		17235,17339,17,84
+    };
+	mavlink_mission_write_partial_list_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.start_index = packet_in.start_index;
+        packet1.end_index = packet_in.end_index;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_write_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
+	mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_item_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113
+    };
+	mavlink_mission_item_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param1 = packet_in.param1;
+        packet1.param2 = packet_in.param2;
+        packet1.param3 = packet_in.param3;
+        packet1.param4 = packet_in.param4;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.seq = packet_in.seq;
+        packet1.command = packet_in.command;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.frame = packet_in.frame;
+        packet1.current = packet_in.current;
+        packet1.autocontinue = packet_in.autocontinue;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_item_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_item_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_request_t packet_in = {
+		17235,139,206
+    };
+	mavlink_mission_request_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seq = packet_in.seq;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_SET_CURRENT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_set_current_t packet_in = {
+		17235,139,206
+    };
+	mavlink_mission_set_current_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seq = packet_in.seq;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_set_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_set_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_set_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_set_current_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_set_current_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_set_current_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CURRENT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_current_t packet_in = {
+		17235
+    };
+	mavlink_mission_current_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seq = packet_in.seq;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq );
+	mavlink_msg_mission_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
+	mavlink_msg_mission_current_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_current_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_current_send(MAVLINK_COMM_1 , packet1.seq );
+	mavlink_msg_mission_current_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_LIST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_request_list_t packet_in = {
+		5,72
+    };
+	mavlink_mission_request_list_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_COUNT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_count_t packet_in = {
+		17235,139,206
+    };
+	mavlink_mission_count_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.count = packet_in.count;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_count_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count );
+	mavlink_msg_mission_count_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count );
+	mavlink_msg_mission_count_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_count_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_count_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.count );
+	mavlink_msg_mission_count_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CLEAR_ALL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_clear_all_t packet_in = {
+		5,72
+    };
+	mavlink_mission_clear_all_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_clear_all_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_clear_all_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_clear_all_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
+	mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_REACHED >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_item_reached_t packet_in = {
+		17235
+    };
+	mavlink_mission_item_reached_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seq = packet_in.seq;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_item_reached_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
+	mavlink_msg_mission_item_reached_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
+	mavlink_msg_mission_item_reached_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1 , packet1.seq );
+	mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ACK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_ack_t packet_in = {
+		5,72,139
+    };
+	mavlink_mission_ack_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.type = packet_in.type;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type );
+	mavlink_msg_mission_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type );
+	mavlink_msg_mission_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.type );
+	mavlink_msg_mission_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_gps_global_origin_t packet_in = {
+		963497464,963497672,963497880,41
+    };
+	mavlink_set_gps_global_origin_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.latitude = packet_in.latitude;
+        packet1.longitude = packet_in.longitude;
+        packet1.altitude = packet_in.altitude;
+        packet1.target_system = packet_in.target_system;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_global_origin_t packet_in = {
+		963497464,963497672,963497880
+    };
+	mavlink_gps_global_origin_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.latitude = packet_in.latitude;
+        packet1.longitude = packet_in.longitude;
+        packet1.altitude = packet_in.altitude;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_gps_global_origin_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude );
+	mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_MAP_RC >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_param_map_rc_t packet_in = {
+		17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113
+    };
+	mavlink_param_map_rc_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param_value0 = packet_in.param_value0;
+        packet1.scale = packet_in.scale;
+        packet1.param_value_min = packet_in.param_value_min;
+        packet1.param_value_max = packet_in.param_value_max;
+        packet1.param_index = packet_in.param_index;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
+        
+        mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_param_map_rc_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
+	mavlink_msg_param_map_rc_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
+	mavlink_msg_param_map_rc_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_param_map_rc_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_param_map_rc_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
+	mavlink_msg_param_map_rc_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_request_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_request_int_t packet_in = {
+		17235,139,206
+    };
+	mavlink_mission_request_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seq = packet_in.seq;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_request_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_request_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_request_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
+	mavlink_msg_mission_request_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_safety_set_allowed_area_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
+    };
+	mavlink_safety_set_allowed_area_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.p1x = packet_in.p1x;
+        packet1.p1y = packet_in.p1y;
+        packet1.p1z = packet_in.p1z;
+        packet1.p2x = packet_in.p2x;
+        packet1.p2y = packet_in.p2y;
+        packet1.p2z = packet_in.p2z;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.frame = packet_in.frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_set_allowed_area_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_safety_allowed_area_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,157.0,77
+    };
+	mavlink_safety_allowed_area_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.p1x = packet_in.p1x;
+        packet1.p1y = packet_in.p1y;
+        packet1.p1z = packet_in.p1z;
+        packet1.p2x = packet_in.p2x;
+        packet1.p2y = packet_in.p2y;
+        packet1.p2z = packet_in.p2z;
+        packet1.frame = packet_in.frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
+	mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_attitude_quaternion_cov_t packet_in = {
+		963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0 }
+    };
+	mavlink_attitude_quaternion_cov_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.rollspeed = packet_in.rollspeed;
+        packet1.pitchspeed = packet_in.pitchspeed;
+        packet1.yawspeed = packet_in.yawspeed;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
+	mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
+	mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
+	mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_nav_controller_output_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,18275,18379,18483
+    };
+	mavlink_nav_controller_output_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.nav_roll = packet_in.nav_roll;
+        packet1.nav_pitch = packet_in.nav_pitch;
+        packet1.alt_error = packet_in.alt_error;
+        packet1.aspd_error = packet_in.aspd_error;
+        packet1.xtrack_error = packet_in.xtrack_error;
+        packet1.nav_bearing = packet_in.nav_bearing;
+        packet1.target_bearing = packet_in.target_bearing;
+        packet1.wp_dist = packet_in.wp_dist;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_nav_controller_output_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
+	mavlink_msg_nav_controller_output_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
+	mavlink_msg_nav_controller_output_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_nav_controller_output_send(MAVLINK_COMM_1 , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
+	mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_global_position_int_cov_t packet_in = {
+		93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,213.0,241.0,269.0,{ 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0, 305.0, 306.0, 307.0, 308.0, 309.0, 310.0, 311.0, 312.0, 313.0, 314.0, 315.0, 316.0, 317.0, 318.0, 319.0, 320.0, 321.0, 322.0, 323.0, 324.0, 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0 },45
+    };
+	mavlink_global_position_int_cov_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_utc = packet_in.time_utc;
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.relative_alt = packet_in.relative_alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.estimator_type = packet_in.estimator_type;
+        
+        mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
+	mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
+	mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_position_int_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
+	mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_local_position_ned_cov_t packet_in = {
+		93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0, 370.0, 371.0, 372.0, 373.0, 374.0, 375.0, 376.0, 377.0, 378.0, 379.0, 380.0, 381.0, 382.0, 383.0, 384.0, 385.0, 386.0, 387.0, 388.0, 389.0, 390.0, 391.0, 392.0, 393.0, 394.0, 395.0, 396.0, 397.0 },177
+    };
+	mavlink_local_position_ned_cov_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_utc = packet_in.time_utc;
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.ax = packet_in.ax;
+        packet1.ay = packet_in.ay;
+        packet1.az = packet_in.az;
+        packet1.estimator_type = packet_in.estimator_type;
+        
+        mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
+	mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
+	mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
+	mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_rc_channels_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
+    };
+	mavlink_rc_channels_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.chan1_raw = packet_in.chan1_raw;
+        packet1.chan2_raw = packet_in.chan2_raw;
+        packet1.chan3_raw = packet_in.chan3_raw;
+        packet1.chan4_raw = packet_in.chan4_raw;
+        packet1.chan5_raw = packet_in.chan5_raw;
+        packet1.chan6_raw = packet_in.chan6_raw;
+        packet1.chan7_raw = packet_in.chan7_raw;
+        packet1.chan8_raw = packet_in.chan8_raw;
+        packet1.chan9_raw = packet_in.chan9_raw;
+        packet1.chan10_raw = packet_in.chan10_raw;
+        packet1.chan11_raw = packet_in.chan11_raw;
+        packet1.chan12_raw = packet_in.chan12_raw;
+        packet1.chan13_raw = packet_in.chan13_raw;
+        packet1.chan14_raw = packet_in.chan14_raw;
+        packet1.chan15_raw = packet_in.chan15_raw;
+        packet1.chan16_raw = packet_in.chan16_raw;
+        packet1.chan17_raw = packet_in.chan17_raw;
+        packet1.chan18_raw = packet_in.chan18_raw;
+        packet1.chancount = packet_in.chancount;
+        packet1.rssi = packet_in.rssi;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_rc_channels_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
+	mavlink_msg_rc_channels_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
+	mavlink_msg_rc_channels_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_rc_channels_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
+	mavlink_msg_rc_channels_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_DATA_STREAM >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_request_data_stream_t packet_in = {
+		17235,139,206,17,84
+    };
+	mavlink_request_data_stream_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.req_message_rate = packet_in.req_message_rate;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.req_stream_id = packet_in.req_stream_id;
+        packet1.start_stop = packet_in.start_stop;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_request_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_request_data_stream_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
+	mavlink_msg_request_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
+	mavlink_msg_request_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_request_data_stream_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_request_data_stream_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
+	mavlink_msg_request_data_stream_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_STREAM >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_data_stream_t packet_in = {
+		17235,139,206
+    };
+	mavlink_data_stream_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.message_rate = packet_in.message_rate;
+        packet1.stream_id = packet_in.stream_id;
+        packet1.on_off = packet_in.on_off;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
+	mavlink_msg_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
+	mavlink_msg_data_stream_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_data_stream_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
+	mavlink_msg_data_stream_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_CONTROL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_manual_control_t packet_in = {
+		17235,17339,17443,17547,17651,163
+    };
+	mavlink_manual_control_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.r = packet_in.r;
+        packet1.buttons = packet_in.buttons;
+        packet1.target = packet_in.target;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_manual_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
+	mavlink_msg_manual_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
+	mavlink_msg_manual_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_manual_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
+	mavlink_msg_manual_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_rc_channels_override_t packet_in = {
+		17235,17339,17443,17547,17651,17755,17859,17963,53,120
+    };
+	mavlink_rc_channels_override_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.chan1_raw = packet_in.chan1_raw;
+        packet1.chan2_raw = packet_in.chan2_raw;
+        packet1.chan3_raw = packet_in.chan3_raw;
+        packet1.chan4_raw = packet_in.chan4_raw;
+        packet1.chan5_raw = packet_in.chan5_raw;
+        packet1.chan6_raw = packet_in.chan6_raw;
+        packet1.chan7_raw = packet_in.chan7_raw;
+        packet1.chan8_raw = packet_in.chan8_raw;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_rc_channels_override_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw );
+	mavlink_msg_rc_channels_override_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw );
+	mavlink_msg_rc_channels_override_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_rc_channels_override_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw );
+	mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_mission_item_int_t packet_in = {
+		17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113
+    };
+	mavlink_mission_item_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param1 = packet_in.param1;
+        packet1.param2 = packet_in.param2;
+        packet1.param3 = packet_in.param3;
+        packet1.param4 = packet_in.param4;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.seq = packet_in.seq;
+        packet1.command = packet_in.command;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.frame = packet_in.frame;
+        packet1.current = packet_in.current;
+        packet1.autocontinue = packet_in.autocontinue;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_mission_item_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_mission_item_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_mission_item_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_mission_item_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VFR_HUD >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_vfr_hud_t packet_in = {
+		17.0,45.0,73.0,101.0,18067,18171
+    };
+	mavlink_vfr_hud_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.airspeed = packet_in.airspeed;
+        packet1.groundspeed = packet_in.groundspeed;
+        packet1.alt = packet_in.alt;
+        packet1.climb = packet_in.climb;
+        packet1.heading = packet_in.heading;
+        packet1.throttle = packet_in.throttle;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_VFR_HUD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VFR_HUD_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_vfr_hud_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
+	mavlink_msg_vfr_hud_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
+	mavlink_msg_vfr_hud_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_vfr_hud_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
+	mavlink_msg_vfr_hud_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_command_int_t packet_in = {
+		17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
+    };
+	mavlink_command_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param1 = packet_in.param1;
+        packet1.param2 = packet_in.param2;
+        packet1.param3 = packet_in.param3;
+        packet1.param4 = packet_in.param4;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.command = packet_in.command;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.frame = packet_in.frame;
+        packet1.current = packet_in.current;
+        packet1.autocontinue = packet_in.autocontinue;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_command_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_command_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_command_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_command_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_command_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_LONG >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_command_long_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
+    };
+	mavlink_command_long_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.param1 = packet_in.param1;
+        packet1.param2 = packet_in.param2;
+        packet1.param3 = packet_in.param3;
+        packet1.param4 = packet_in.param4;
+        packet1.param5 = packet_in.param5;
+        packet1.param6 = packet_in.param6;
+        packet1.param7 = packet_in.param7;
+        packet1.command = packet_in.command;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.confirmation = packet_in.confirmation;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_command_long_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_long_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
+	mavlink_msg_command_long_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
+	mavlink_msg_command_long_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_command_long_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_long_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
+	mavlink_msg_command_long_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_ACK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_command_ack_t packet_in = {
+		17235,139
+    };
+	mavlink_command_ack_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.command = packet_in.command;
+        packet1.result = packet_in.result;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_command_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result );
+	mavlink_msg_command_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result );
+	mavlink_msg_command_ack_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_command_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result );
+	mavlink_msg_command_ack_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_SETPOINT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_manual_setpoint_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,65,132
+    };
+	mavlink_manual_setpoint_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        packet1.thrust = packet_in.thrust;
+        packet1.mode_switch = packet_in.mode_switch;
+        packet1.manual_override_switch = packet_in.manual_override_switch;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_manual_setpoint_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
+	mavlink_msg_manual_setpoint_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
+	mavlink_msg_manual_setpoint_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_manual_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
+	mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ATTITUDE_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_attitude_target_t packet_in = {
+		963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247
+    };
+	mavlink_set_attitude_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.body_roll_rate = packet_in.body_roll_rate;
+        packet1.body_pitch_rate = packet_in.body_pitch_rate;
+        packet1.body_yaw_rate = packet_in.body_yaw_rate;
+        packet1.thrust = packet_in.thrust;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.type_mask = packet_in.type_mask;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_set_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_set_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_attitude_target_t packet_in = {
+		963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
+    };
+	mavlink_attitude_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.body_roll_rate = packet_in.body_roll_rate;
+        packet1.body_pitch_rate = packet_in.body_pitch_rate;
+        packet1.body_yaw_rate = packet_in.body_yaw_rate;
+        packet1.thrust = packet_in.thrust;
+        packet1.type_mask = packet_in.type_mask;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_attitude_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_attitude_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
+	mavlink_msg_attitude_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_position_target_local_ned_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
+    };
+	mavlink_set_position_target_local_ned_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.afx = packet_in.afx;
+        packet1.afy = packet_in.afy;
+        packet1.afz = packet_in.afz;
+        packet1.yaw = packet_in.yaw;
+        packet1.yaw_rate = packet_in.yaw_rate;
+        packet1.type_mask = packet_in.type_mask;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.coordinate_frame = packet_in.coordinate_frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_position_target_local_ned_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
+    };
+	mavlink_position_target_local_ned_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.afx = packet_in.afx;
+        packet1.afy = packet_in.afy;
+        packet1.afz = packet_in.afz;
+        packet1.yaw = packet_in.yaw;
+        packet1.yaw_rate = packet_in.yaw_rate;
+        packet1.type_mask = packet_in.type_mask;
+        packet1.coordinate_frame = packet_in.coordinate_frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_position_target_global_int_t packet_in = {
+		963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
+    };
+	mavlink_set_position_target_global_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.lat_int = packet_in.lat_int;
+        packet1.lon_int = packet_in.lon_int;
+        packet1.alt = packet_in.alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.afx = packet_in.afx;
+        packet1.afy = packet_in.afy;
+        packet1.afz = packet_in.afz;
+        packet1.yaw = packet_in.yaw;
+        packet1.yaw_rate = packet_in.yaw_rate;
+        packet1.type_mask = packet_in.type_mask;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.coordinate_frame = packet_in.coordinate_frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_position_target_global_int_t packet_in = {
+		963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
+    };
+	mavlink_position_target_global_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.lat_int = packet_in.lat_int;
+        packet1.lon_int = packet_in.lon_int;
+        packet1.alt = packet_in.alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.afx = packet_in.afx;
+        packet1.afy = packet_in.afy;
+        packet1.afz = packet_in.afz;
+        packet1.yaw = packet_in.yaw;
+        packet1.yaw_rate = packet_in.yaw_rate;
+        packet1.type_mask = packet_in.type_mask;
+        packet1.coordinate_frame = packet_in.coordinate_frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_global_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
+	mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_local_position_ned_system_global_offset_t packet_in = {
+		963497464,45.0,73.0,101.0,129.0,157.0,185.0
+    };
+	mavlink_local_position_ned_system_global_offset_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_local_position_ned_system_global_offset_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_state_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
+    };
+	mavlink_hil_state_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        packet1.rollspeed = packet_in.rollspeed;
+        packet1.pitchspeed = packet_in.pitchspeed;
+        packet1.yawspeed = packet_in.yawspeed;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_CONTROLS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_controls_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
+    };
+	mavlink_hil_controls_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.roll_ailerons = packet_in.roll_ailerons;
+        packet1.pitch_elevator = packet_in.pitch_elevator;
+        packet1.yaw_rudder = packet_in.yaw_rudder;
+        packet1.throttle = packet_in.throttle;
+        packet1.aux1 = packet_in.aux1;
+        packet1.aux2 = packet_in.aux2;
+        packet1.aux3 = packet_in.aux3;
+        packet1.aux4 = packet_in.aux4;
+        packet1.mode = packet_in.mode;
+        packet1.nav_mode = packet_in.nav_mode;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_controls_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
+	mavlink_msg_hil_controls_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
+	mavlink_msg_hil_controls_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_controls_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
+	mavlink_msg_hil_controls_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_rc_inputs_raw_t packet_in = {
+		93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
+    };
+	mavlink_hil_rc_inputs_raw_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.chan1_raw = packet_in.chan1_raw;
+        packet1.chan2_raw = packet_in.chan2_raw;
+        packet1.chan3_raw = packet_in.chan3_raw;
+        packet1.chan4_raw = packet_in.chan4_raw;
+        packet1.chan5_raw = packet_in.chan5_raw;
+        packet1.chan6_raw = packet_in.chan6_raw;
+        packet1.chan7_raw = packet_in.chan7_raw;
+        packet1.chan8_raw = packet_in.chan8_raw;
+        packet1.chan9_raw = packet_in.chan9_raw;
+        packet1.chan10_raw = packet_in.chan10_raw;
+        packet1.chan11_raw = packet_in.chan11_raw;
+        packet1.chan12_raw = packet_in.chan12_raw;
+        packet1.rssi = packet_in.rssi;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
+	mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
+	mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_rc_inputs_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
+	mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_optical_flow_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144
+    };
+	mavlink_optical_flow_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
+        packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
+        packet1.ground_distance = packet_in.ground_distance;
+        packet1.flow_x = packet_in.flow_x;
+        packet1.flow_y = packet_in.flow_y;
+        packet1.sensor_id = packet_in.sensor_id;
+        packet1.quality = packet_in.quality;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
+	mavlink_msg_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
+	mavlink_msg_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_optical_flow_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
+	mavlink_msg_optical_flow_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_global_vision_position_estimate_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
+    };
+	mavlink_global_vision_position_estimate_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.usec = packet_in.usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_vision_position_estimate_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
+    };
+	mavlink_vision_position_estimate_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.usec = packet_in.usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_vision_speed_estimate_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0
+    };
+	mavlink_vision_speed_estimate_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.usec = packet_in.usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_vicon_position_estimate_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
+    };
+	mavlink_vicon_position_estimate_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.usec = packet_in.usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
+	mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGHRES_IMU >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_highres_imu_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355
+    };
+	mavlink_highres_imu_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        packet1.abs_pressure = packet_in.abs_pressure;
+        packet1.diff_pressure = packet_in.diff_pressure;
+        packet1.pressure_alt = packet_in.pressure_alt;
+        packet1.temperature = packet_in.temperature;
+        packet1.fields_updated = packet_in.fields_updated;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_highres_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_highres_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_highres_imu_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_highres_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_highres_imu_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW_RAD >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_optical_flow_rad_t packet_in = {
+		93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
+    };
+	mavlink_optical_flow_rad_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.integration_time_us = packet_in.integration_time_us;
+        packet1.integrated_x = packet_in.integrated_x;
+        packet1.integrated_y = packet_in.integrated_y;
+        packet1.integrated_xgyro = packet_in.integrated_xgyro;
+        packet1.integrated_ygyro = packet_in.integrated_ygyro;
+        packet1.integrated_zgyro = packet_in.integrated_zgyro;
+        packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
+        packet1.distance = packet_in.distance;
+        packet1.temperature = packet_in.temperature;
+        packet1.sensor_id = packet_in.sensor_id;
+        packet1.quality = packet_in.quality;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_optical_flow_rad_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_SENSOR >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_sensor_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584
+    };
+	mavlink_hil_sensor_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        packet1.abs_pressure = packet_in.abs_pressure;
+        packet1.diff_pressure = packet_in.diff_pressure;
+        packet1.pressure_alt = packet_in.pressure_alt;
+        packet1.temperature = packet_in.temperature;
+        packet1.fields_updated = packet_in.fields_updated;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_sensor_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_hil_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_hil_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_sensor_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_sensor_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
+	mavlink_msg_hil_sensor_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIM_STATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_sim_state_t packet_in = {
+		17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0
+    };
+	mavlink_sim_state_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.q1 = packet_in.q1;
+        packet1.q2 = packet_in.q2;
+        packet1.q3 = packet_in.q3;
+        packet1.q4 = packet_in.q4;
+        packet1.roll = packet_in.roll;
+        packet1.pitch = packet_in.pitch;
+        packet1.yaw = packet_in.yaw;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.std_dev_horz = packet_in.std_dev_horz;
+        packet1.std_dev_vert = packet_in.std_dev_vert;
+        packet1.vn = packet_in.vn;
+        packet1.ve = packet_in.ve;
+        packet1.vd = packet_in.vd;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SIM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIM_STATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_sim_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
+	mavlink_msg_sim_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
+	mavlink_msg_sim_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_sim_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_sim_state_send(MAVLINK_COMM_1 , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
+	mavlink_msg_sim_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_radio_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_radio_status_t packet_in = {
+		17235,17339,17,84,151,218,29
+    };
+	mavlink_radio_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.rxerrors = packet_in.rxerrors;
+        packet1.fixed = packet_in.fixed;
+        packet1.rssi = packet_in.rssi;
+        packet1.remrssi = packet_in.remrssi;
+        packet1.txbuf = packet_in.txbuf;
+        packet1.noise = packet_in.noise;
+        packet1.remnoise = packet_in.remnoise;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_radio_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
+	mavlink_msg_radio_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
+	mavlink_msg_radio_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_radio_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_radio_status_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
+	mavlink_msg_radio_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_file_transfer_protocol(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_file_transfer_protocol_t packet_in = {
+		5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 }
+    };
+	mavlink_file_transfer_protocol_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_network = packet_in.target_network;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
+	mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
+	mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_file_transfer_protocol_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
+	mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_timesync(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIMESYNC >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_timesync_t packet_in = {
+		93372036854775807LL,93372036854776311LL
+    };
+	mavlink_timesync_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.tc1 = packet_in.tc1;
+        packet1.ts1 = packet_in.ts1;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_TIMESYNC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIMESYNC_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_timesync_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 );
+	mavlink_msg_timesync_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 );
+	mavlink_msg_timesync_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_timesync_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_timesync_send(MAVLINK_COMM_1 , packet1.tc1 , packet1.ts1 );
+	mavlink_msg_timesync_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_camera_trigger(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRIGGER >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_camera_trigger_t packet_in = {
+		93372036854775807ULL,963497880
+    };
+	mavlink_camera_trigger_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.seq = packet_in.seq;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_camera_trigger_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq );
+	mavlink_msg_camera_trigger_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq );
+	mavlink_msg_camera_trigger_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_camera_trigger_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_camera_trigger_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq );
+	mavlink_msg_camera_trigger_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_GPS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_gps_t packet_in = {
+		93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46
+    };
+	mavlink_hil_gps_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.eph = packet_in.eph;
+        packet1.epv = packet_in.epv;
+        packet1.vel = packet_in.vel;
+        packet1.vn = packet_in.vn;
+        packet1.ve = packet_in.ve;
+        packet1.vd = packet_in.vd;
+        packet1.cog = packet_in.cog;
+        packet1.fix_type = packet_in.fix_type;
+        packet1.satellites_visible = packet_in.satellites_visible;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_GPS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_GPS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_gps_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_gps_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_hil_gps_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_hil_gps_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_gps_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_gps_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
+	mavlink_msg_hil_gps_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_OPTICAL_FLOW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_optical_flow_t packet_in = {
+		93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
+    };
+	mavlink_hil_optical_flow_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.integration_time_us = packet_in.integration_time_us;
+        packet1.integrated_x = packet_in.integrated_x;
+        packet1.integrated_y = packet_in.integrated_y;
+        packet1.integrated_xgyro = packet_in.integrated_xgyro;
+        packet1.integrated_ygyro = packet_in.integrated_ygyro;
+        packet1.integrated_zgyro = packet_in.integrated_zgyro;
+        packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
+        packet1.distance = packet_in.distance;
+        packet1.temperature = packet_in.temperature;
+        packet1.sensor_id = packet_in.sensor_id;
+        packet1.quality = packet_in.quality;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
+	mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_hil_state_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE_QUATERNION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_hil_state_quaternion_t packet_in = {
+		93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459
+    };
+	mavlink_hil_state_quaternion_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.rollspeed = packet_in.rollspeed;
+        packet1.pitchspeed = packet_in.pitchspeed;
+        packet1.yawspeed = packet_in.yawspeed;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.vx = packet_in.vx;
+        packet1.vy = packet_in.vy;
+        packet1.vz = packet_in.vz;
+        packet1.ind_airspeed = packet_in.ind_airspeed;
+        packet1.true_airspeed = packet_in.true_airspeed;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        
+        mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_hil_state_quaternion_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
+	mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_imu2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU2 >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_imu2_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
+    };
+	mavlink_scaled_imu2_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_imu2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_LIST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_request_list_t packet_in = {
+		17235,17339,17,84
+    };
+	mavlink_log_request_list_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.start = packet_in.start;
+        packet1.end = packet_in.end;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
+	mavlink_msg_log_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
+	mavlink_msg_log_request_list_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
+	mavlink_msg_log_request_list_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_entry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ENTRY >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_entry_t packet_in = {
+		963497464,963497672,17651,17755,17859
+    };
+	mavlink_log_entry_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_utc = packet_in.time_utc;
+        packet1.size = packet_in.size;
+        packet1.id = packet_in.id;
+        packet1.num_logs = packet_in.num_logs;
+        packet1.last_log_num = packet_in.last_log_num;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_entry_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
+	mavlink_msg_log_entry_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
+	mavlink_msg_log_entry_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_entry_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_entry_send(MAVLINK_COMM_1 , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
+	mavlink_msg_log_entry_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_request_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_request_data_t packet_in = {
+		963497464,963497672,17651,163,230
+    };
+	mavlink_log_request_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.ofs = packet_in.ofs;
+        packet1.count = packet_in.count;
+        packet1.id = packet_in.id;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_request_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
+	mavlink_msg_log_request_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
+	mavlink_msg_log_request_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_request_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
+	mavlink_msg_log_request_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_data_t packet_in = {
+		963497464,17443,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }
+    };
+	mavlink_log_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.ofs = packet_in.ofs;
+        packet1.id = packet_in.id;
+        packet1.count = packet_in.count;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
+	mavlink_msg_log_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
+	mavlink_msg_log_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_data_send(MAVLINK_COMM_1 , packet1.id , packet1.ofs , packet1.count , packet1.data );
+	mavlink_msg_log_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_erase(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ERASE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_erase_t packet_in = {
+		5,72
+    };
+	mavlink_log_erase_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_erase_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_erase_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_erase_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_erase_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_erase_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_erase_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_log_request_end(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_END >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_log_request_end_t packet_in = {
+		5,72
+    };
+	mavlink_log_request_end_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_log_request_end_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_request_end_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_request_end_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_log_request_end_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_log_request_end_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
+	mavlink_msg_log_request_end_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_inject_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INJECT_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_inject_data_t packet_in = {
+		5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 }
+    };
+	mavlink_gps_inject_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        packet1.len = packet_in.len;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_inject_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
+	mavlink_msg_gps_inject_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
+	mavlink_msg_gps_inject_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_inject_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
+	mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps2_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RAW >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps2_raw_t packet_in = {
+		93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235
+    };
+	mavlink_gps2_raw_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.dgps_age = packet_in.dgps_age;
+        packet1.eph = packet_in.eph;
+        packet1.epv = packet_in.epv;
+        packet1.vel = packet_in.vel;
+        packet1.cog = packet_in.cog;
+        packet1.fix_type = packet_in.fix_type;
+        packet1.satellites_visible = packet_in.satellites_visible;
+        packet1.dgps_numch = packet_in.dgps_numch;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps2_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age );
+	mavlink_msg_gps2_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age );
+	mavlink_msg_gps2_raw_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps2_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age );
+	mavlink_msg_gps2_raw_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_power_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POWER_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_power_status_t packet_in = {
+		17235,17339,17443
+    };
+	mavlink_power_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.Vcc = packet_in.Vcc;
+        packet1.Vservo = packet_in.Vservo;
+        packet1.flags = packet_in.flags;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_power_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
+	mavlink_msg_power_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
+	mavlink_msg_power_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_power_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_power_status_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.Vservo , packet1.flags );
+	mavlink_msg_power_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_serial_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_CONTROL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_serial_control_t packet_in = {
+		963497464,17443,151,218,29,{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165 }
+    };
+	mavlink_serial_control_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.baudrate = packet_in.baudrate;
+        packet1.timeout = packet_in.timeout;
+        packet1.device = packet_in.device;
+        packet1.flags = packet_in.flags;
+        packet1.count = packet_in.count;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_serial_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
+	mavlink_msg_serial_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
+	mavlink_msg_serial_control_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_serial_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_serial_control_send(MAVLINK_COMM_1 , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
+	mavlink_msg_serial_control_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_rtk_t packet_in = {
+		963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
+    };
+	mavlink_gps_rtk_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
+        packet1.tow = packet_in.tow;
+        packet1.baseline_a_mm = packet_in.baseline_a_mm;
+        packet1.baseline_b_mm = packet_in.baseline_b_mm;
+        packet1.baseline_c_mm = packet_in.baseline_c_mm;
+        packet1.accuracy = packet_in.accuracy;
+        packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
+        packet1.wn = packet_in.wn;
+        packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
+        packet1.rtk_health = packet_in.rtk_health;
+        packet1.rtk_rate = packet_in.rtk_rate;
+        packet1.nsats = packet_in.nsats;
+        packet1.baseline_coords_type = packet_in.baseline_coords_type;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_rtk_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps_rtk_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps2_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RTK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps2_rtk_t packet_in = {
+		963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
+    };
+	mavlink_gps2_rtk_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
+        packet1.tow = packet_in.tow;
+        packet1.baseline_a_mm = packet_in.baseline_a_mm;
+        packet1.baseline_b_mm = packet_in.baseline_b_mm;
+        packet1.baseline_c_mm = packet_in.baseline_c_mm;
+        packet1.accuracy = packet_in.accuracy;
+        packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
+        packet1.wn = packet_in.wn;
+        packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
+        packet1.rtk_health = packet_in.rtk_health;
+        packet1.rtk_rate = packet_in.rtk_rate;
+        packet1.nsats = packet_in.nsats;
+        packet1.baseline_coords_type = packet_in.baseline_coords_type;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps2_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps2_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps2_rtk_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps2_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
+	mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_imu3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU3 >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_imu3_t packet_in = {
+		963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
+    };
+	mavlink_scaled_imu3_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.xacc = packet_in.xacc;
+        packet1.yacc = packet_in.yacc;
+        packet1.zacc = packet_in.zacc;
+        packet1.xgyro = packet_in.xgyro;
+        packet1.ygyro = packet_in.ygyro;
+        packet1.zgyro = packet_in.zgyro;
+        packet1.xmag = packet_in.xmag;
+        packet1.ymag = packet_in.ymag;
+        packet1.zmag = packet_in.zmag;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_imu3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_imu3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag );
+	mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_data_transmission_handshake_t packet_in = {
+		963497464,17443,17547,17651,163,230,41
+    };
+	mavlink_data_transmission_handshake_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.size = packet_in.size;
+        packet1.width = packet_in.width;
+        packet1.height = packet_in.height;
+        packet1.packets = packet_in.packets;
+        packet1.type = packet_in.type;
+        packet1.payload = packet_in.payload;
+        packet1.jpg_quality = packet_in.jpg_quality;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
+	mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
+	mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_data_transmission_handshake_send(MAVLINK_COMM_1 , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
+	mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ENCAPSULATED_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_encapsulated_data_t packet_in = {
+		17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 }
+    };
+	mavlink_encapsulated_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.seqnr = packet_in.seqnr;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_encapsulated_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data );
+	mavlink_msg_encapsulated_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data );
+	mavlink_msg_encapsulated_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_encapsulated_data_send(MAVLINK_COMM_1 , packet1.seqnr , packet1.data );
+	mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DISTANCE_SENSOR >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_distance_sensor_t packet_in = {
+		963497464,17443,17547,17651,163,230,41,108
+    };
+	mavlink_distance_sensor_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.min_distance = packet_in.min_distance;
+        packet1.max_distance = packet_in.max_distance;
+        packet1.current_distance = packet_in.current_distance;
+        packet1.type = packet_in.type;
+        packet1.id = packet_in.id;
+        packet1.orientation = packet_in.orientation;
+        packet1.covariance = packet_in.covariance;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_distance_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
+	mavlink_msg_distance_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
+	mavlink_msg_distance_sensor_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_distance_sensor_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
+	mavlink_msg_distance_sensor_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REQUEST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_terrain_request_t packet_in = {
+		93372036854775807ULL,963497880,963498088,18067
+    };
+	mavlink_terrain_request_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.mask = packet_in.mask;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.grid_spacing = packet_in.grid_spacing;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_terrain_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
+	mavlink_msg_terrain_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
+	mavlink_msg_terrain_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_terrain_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
+	mavlink_msg_terrain_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_terrain_data_t packet_in = {
+		963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3
+    };
+	mavlink_terrain_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.grid_spacing = packet_in.grid_spacing;
+        packet1.gridbit = packet_in.gridbit;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_terrain_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
+	mavlink_msg_terrain_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
+	mavlink_msg_terrain_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_terrain_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
+	mavlink_msg_terrain_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_CHECK >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_terrain_check_t packet_in = {
+		963497464,963497672
+    };
+	mavlink_terrain_check_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_terrain_check_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
+	mavlink_msg_terrain_check_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
+	mavlink_msg_terrain_check_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_terrain_check_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
+	mavlink_msg_terrain_check_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REPORT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_terrain_report_t packet_in = {
+		963497464,963497672,73.0,101.0,18067,18171,18275
+    };
+	mavlink_terrain_report_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.terrain_height = packet_in.terrain_height;
+        packet1.current_height = packet_in.current_height;
+        packet1.spacing = packet_in.spacing;
+        packet1.pending = packet_in.pending;
+        packet1.loaded = packet_in.loaded;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_terrain_report_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
+	mavlink_msg_terrain_report_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
+	mavlink_msg_terrain_report_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_terrain_report_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
+	mavlink_msg_terrain_report_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE2 >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_pressure2_t packet_in = {
+		963497464,45.0,73.0,17859
+    };
+	mavlink_scaled_pressure2_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.press_abs = packet_in.press_abs;
+        packet1.press_diff = packet_in.press_diff;
+        packet1.temperature = packet_in.temperature;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_att_pos_mocap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATT_POS_MOCAP >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_att_pos_mocap_t packet_in = {
+		93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0
+    };
+	mavlink_att_pos_mocap_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_actuator_control_target_t packet_in = {
+		93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
+    };
+	mavlink_set_actuator_control_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.group_mlx = packet_in.group_mlx;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
+	mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
+	mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
+	mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_actuator_control_target_t packet_in = {
+		93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
+    };
+	mavlink_actuator_control_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.group_mlx = packet_in.group_mlx;
+        
+        mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
+	mavlink_msg_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
+	mavlink_msg_actuator_control_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
+	mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_altitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_altitude_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
+    };
+	mavlink_altitude_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.altitude_monotonic = packet_in.altitude_monotonic;
+        packet1.altitude_amsl = packet_in.altitude_amsl;
+        packet1.altitude_local = packet_in.altitude_local;
+        packet1.altitude_relative = packet_in.altitude_relative;
+        packet1.altitude_terrain = packet_in.altitude_terrain;
+        packet1.bottom_clearance = packet_in.bottom_clearance;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ALTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_altitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_altitude_pack(system_id, component_id, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
+	mavlink_msg_altitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_altitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
+	mavlink_msg_altitude_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_altitude_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_altitude_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
+	mavlink_msg_altitude_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_resource_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESOURCE_REQUEST >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_resource_request_t packet_in = {
+		5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2 },243,{ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173 }
+    };
+	mavlink_resource_request_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.request_id = packet_in.request_id;
+        packet1.uri_type = packet_in.uri_type;
+        packet1.transfer_type = packet_in.transfer_type;
+        
+        mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(uint8_t)*120);
+        mav_array_memcpy(packet1.storage, packet_in.storage, sizeof(uint8_t)*120);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_resource_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
+	mavlink_msg_resource_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_resource_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
+	mavlink_msg_resource_request_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_resource_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_resource_request_send(MAVLINK_COMM_1 , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
+	mavlink_msg_resource_request_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_scaled_pressure3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE3 >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_scaled_pressure3_t packet_in = {
+		963497464,45.0,73.0,17859
+    };
+	mavlink_scaled_pressure3_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.press_abs = packet_in.press_abs;
+        packet1.press_diff = packet_in.press_diff;
+        packet1.temperature = packet_in.temperature;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_scaled_pressure3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
+	mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_follow_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FOLLOW_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_follow_target_t packet_in = {
+		93372036854775807ULL,93372036854776311ULL,963498296,963498504,185.0,{ 213.0, 214.0, 215.0 },{ 297.0, 298.0, 299.0 },{ 381.0, 382.0, 383.0, 384.0 },{ 493.0, 494.0, 495.0 },{ 577.0, 578.0, 579.0 },25
+    };
+	mavlink_follow_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.timestamp = packet_in.timestamp;
+        packet1.custom_state = packet_in.custom_state;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.alt = packet_in.alt;
+        packet1.est_capabilities = packet_in.est_capabilities;
+        
+        mav_array_memcpy(packet1.vel, packet_in.vel, sizeof(float)*3);
+        mav_array_memcpy(packet1.acc, packet_in.acc, sizeof(float)*3);
+        mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q, sizeof(float)*4);
+        mav_array_memcpy(packet1.rates, packet_in.rates, sizeof(float)*3);
+        mav_array_memcpy(packet1.position_cov, packet_in.position_cov, sizeof(float)*3);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_follow_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_follow_target_pack(system_id, component_id, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
+	mavlink_msg_follow_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_follow_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
+	mavlink_msg_follow_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_follow_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_follow_target_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
+	mavlink_msg_follow_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_control_system_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_control_system_state_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0 },{ 437.0, 438.0, 439.0 },{ 521.0, 522.0, 523.0, 524.0 },633.0,661.0,689.0
+    };
+	mavlink_control_system_state_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.x_acc = packet_in.x_acc;
+        packet1.y_acc = packet_in.y_acc;
+        packet1.z_acc = packet_in.z_acc;
+        packet1.x_vel = packet_in.x_vel;
+        packet1.y_vel = packet_in.y_vel;
+        packet1.z_vel = packet_in.z_vel;
+        packet1.x_pos = packet_in.x_pos;
+        packet1.y_pos = packet_in.y_pos;
+        packet1.z_pos = packet_in.z_pos;
+        packet1.airspeed = packet_in.airspeed;
+        packet1.roll_rate = packet_in.roll_rate;
+        packet1.pitch_rate = packet_in.pitch_rate;
+        packet1.yaw_rate = packet_in.yaw_rate;
+        
+        mav_array_memcpy(packet1.vel_variance, packet_in.vel_variance, sizeof(float)*3);
+        mav_array_memcpy(packet1.pos_variance, packet_in.pos_variance, sizeof(float)*3);
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_control_system_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_control_system_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
+	mavlink_msg_control_system_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_control_system_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
+	mavlink_msg_control_system_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_control_system_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_control_system_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
+	mavlink_msg_control_system_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_battery_status_t packet_in = {
+		963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46
+    };
+	mavlink_battery_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.current_consumed = packet_in.current_consumed;
+        packet1.energy_consumed = packet_in.energy_consumed;
+        packet1.temperature = packet_in.temperature;
+        packet1.current_battery = packet_in.current_battery;
+        packet1.id = packet_in.id;
+        packet1.battery_function = packet_in.battery_function;
+        packet1.type = packet_in.type;
+        packet1.battery_remaining = packet_in.battery_remaining;
+        
+        mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_battery_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
+	mavlink_msg_battery_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
+	mavlink_msg_battery_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_battery_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
+	mavlink_msg_battery_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_VERSION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_autopilot_version_t packet_in = {
+		93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 }
+    };
+	mavlink_autopilot_version_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.capabilities = packet_in.capabilities;
+        packet1.uid = packet_in.uid;
+        packet1.flight_sw_version = packet_in.flight_sw_version;
+        packet1.middleware_sw_version = packet_in.middleware_sw_version;
+        packet1.os_sw_version = packet_in.os_sw_version;
+        packet1.board_version = packet_in.board_version;
+        packet1.vendor_id = packet_in.vendor_id;
+        packet1.product_id = packet_in.product_id;
+        
+        mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8);
+        mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8);
+        mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_autopilot_version_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_autopilot_version_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
+	mavlink_msg_autopilot_version_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
+	mavlink_msg_autopilot_version_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_autopilot_version_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_autopilot_version_send(MAVLINK_COMM_1 , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
+	mavlink_msg_autopilot_version_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LANDING_TARGET >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_landing_target_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156
+    };
+	mavlink_landing_target_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.angle_x = packet_in.angle_x;
+        packet1.angle_y = packet_in.angle_y;
+        packet1.distance = packet_in.distance;
+        packet1.size_x = packet_in.size_x;
+        packet1.size_y = packet_in.size_y;
+        packet1.target_num = packet_in.target_num;
+        packet1.frame = packet_in.frame;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_landing_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
+	mavlink_msg_landing_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
+	mavlink_msg_landing_target_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_landing_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_landing_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y );
+	mavlink_msg_landing_target_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_estimator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESTIMATOR_STATUS >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_estimator_status_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315
+    };
+	mavlink_estimator_status_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.vel_ratio = packet_in.vel_ratio;
+        packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio;
+        packet1.pos_vert_ratio = packet_in.pos_vert_ratio;
+        packet1.mag_ratio = packet_in.mag_ratio;
+        packet1.hagl_ratio = packet_in.hagl_ratio;
+        packet1.tas_ratio = packet_in.tas_ratio;
+        packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy;
+        packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy;
+        packet1.flags = packet_in.flags;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_estimator_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_estimator_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
+	mavlink_msg_estimator_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_estimator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
+	mavlink_msg_estimator_status_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_estimator_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_estimator_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
+	mavlink_msg_estimator_status_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_wind_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND_COV >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_wind_cov_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
+    };
+	mavlink_wind_cov_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.wind_x = packet_in.wind_x;
+        packet1.wind_y = packet_in.wind_y;
+        packet1.wind_z = packet_in.wind_z;
+        packet1.var_horiz = packet_in.var_horiz;
+        packet1.var_vert = packet_in.var_vert;
+        packet1.wind_alt = packet_in.wind_alt;
+        packet1.horiz_accuracy = packet_in.horiz_accuracy;
+        packet1.vert_accuracy = packet_in.vert_accuracy;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_WIND_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_COV_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_wind_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
+	mavlink_msg_wind_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
+	mavlink_msg_wind_cov_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_wind_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_wind_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
+	mavlink_msg_wind_cov_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_gps_rtcm_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTCM_DATA >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_gps_rtcm_data_t packet_in = {
+		5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62 }
+    };
+	mavlink_gps_rtcm_data_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.flags = packet_in.flags;
+        packet1.len = packet_in.len;
+        
+        mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*180);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtcm_data_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtcm_data_pack(system_id, component_id, &msg , packet1.flags , packet1.len , packet1.data );
+	mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.len , packet1.data );
+	mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_gps_rtcm_data_send(MAVLINK_COMM_1 , packet1.flags , packet1.len , packet1.data );
+	mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_vibration(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIBRATION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_vibration_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920
+    };
+	mavlink_vibration_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.vibration_x = packet_in.vibration_x;
+        packet1.vibration_y = packet_in.vibration_y;
+        packet1.vibration_z = packet_in.vibration_z;
+        packet1.clipping_0 = packet_in.clipping_0;
+        packet1.clipping_1 = packet_in.clipping_1;
+        packet1.clipping_2 = packet_in.clipping_2;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_VIBRATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIBRATION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_vibration_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vibration_pack(system_id, component_id, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
+	mavlink_msg_vibration_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
+	mavlink_msg_vibration_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_vibration_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_vibration_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
+	mavlink_msg_vibration_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HOME_POSITION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_home_position_t packet_in = {
+		963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0
+    };
+	mavlink_home_position_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.latitude = packet_in.latitude;
+        packet1.longitude = packet_in.longitude;
+        packet1.altitude = packet_in.altitude;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.approach_x = packet_in.approach_x;
+        packet1.approach_y = packet_in.approach_y;
+        packet1.approach_z = packet_in.approach_z;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_home_position_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_home_position_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_home_position_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_home_position_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_set_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_HOME_POSITION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_set_home_position_t packet_in = {
+		963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,161
+    };
+	mavlink_set_home_position_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.latitude = packet_in.latitude;
+        packet1.longitude = packet_in.longitude;
+        packet1.altitude = packet_in.altitude;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        packet1.approach_x = packet_in.approach_x;
+        packet1.approach_y = packet_in.approach_y;
+        packet1.approach_z = packet_in.approach_z;
+        packet1.target_system = packet_in.target_system;
+        
+        mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_set_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_home_position_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_set_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_set_home_position_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_set_home_position_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_set_home_position_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z );
+	mavlink_msg_set_home_position_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_message_interval(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MESSAGE_INTERVAL >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_message_interval_t packet_in = {
+		963497464,17443
+    };
+	mavlink_message_interval_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.interval_us = packet_in.interval_us;
+        packet1.message_id = packet_in.message_id;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_message_interval_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us );
+	mavlink_msg_message_interval_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us );
+	mavlink_msg_message_interval_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_message_interval_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_message_interval_send(MAVLINK_COMM_1 , packet1.message_id , packet1.interval_us );
+	mavlink_msg_message_interval_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_extended_sys_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EXTENDED_SYS_STATE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_extended_sys_state_t packet_in = {
+		5,72
+    };
+	mavlink_extended_sys_state_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.vtol_state = packet_in.vtol_state;
+        packet1.landed_state = packet_in.landed_state;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_extended_sys_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state );
+	mavlink_msg_extended_sys_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state );
+	mavlink_msg_extended_sys_state_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_extended_sys_state_send(MAVLINK_COMM_1 , packet1.vtol_state , packet1.landed_state );
+	mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADSB_VEHICLE >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_adsb_vehicle_t packet_in = {
+		963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,"BCDEFGHI",113,180
+    };
+	mavlink_adsb_vehicle_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.ICAO_address = packet_in.ICAO_address;
+        packet1.lat = packet_in.lat;
+        packet1.lon = packet_in.lon;
+        packet1.altitude = packet_in.altitude;
+        packet1.heading = packet_in.heading;
+        packet1.hor_velocity = packet_in.hor_velocity;
+        packet1.ver_velocity = packet_in.ver_velocity;
+        packet1.flags = packet_in.flags;
+        packet1.squawk = packet_in.squawk;
+        packet1.altitude_type = packet_in.altitude_type;
+        packet1.emitter_type = packet_in.emitter_type;
+        packet1.tslc = packet_in.tslc;
+        
+        mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
+	mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
+	mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_adsb_vehicle_send(MAVLINK_COMM_1 , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
+	mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_v2_extension(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_V2_EXTENSION >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_v2_extension_t packet_in = {
+		17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 }
+    };
+	mavlink_v2_extension_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.message_type = packet_in.message_type;
+        packet1.target_network = packet_in.target_network;
+        packet1.target_system = packet_in.target_system;
+        packet1.target_component = packet_in.target_component;
+        
+        mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_v2_extension_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
+	mavlink_msg_v2_extension_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
+	mavlink_msg_v2_extension_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_v2_extension_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_v2_extension_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
+	mavlink_msg_v2_extension_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMORY_VECT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_memory_vect_t packet_in = {
+		17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }
+    };
+	mavlink_memory_vect_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.address = packet_in.address;
+        packet1.ver = packet_in.ver;
+        packet1.type = packet_in.type;
+        
+        mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_memory_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
+	mavlink_msg_memory_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
+	mavlink_msg_memory_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_memory_vect_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_memory_vect_send(MAVLINK_COMM_1 , packet1.address , packet1.ver , packet1.type , packet1.value );
+	mavlink_msg_memory_vect_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_VECT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_debug_vect_t packet_in = {
+		93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC"
+    };
+	mavlink_debug_vect_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_usec = packet_in.time_usec;
+        packet1.x = packet_in.x;
+        packet1.y = packet_in.y;
+        packet1.z = packet_in.z;
+        
+        mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_debug_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_debug_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_debug_vect_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_debug_vect_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_vect_send(MAVLINK_COMM_1 , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
+	mavlink_msg_debug_vect_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_FLOAT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_named_value_float_t packet_in = {
+		963497464,45.0,"IJKLMNOPQ"
+    };
+	mavlink_named_value_float_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.value = packet_in.value;
+        
+        mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_named_value_float_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_float_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_float_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_named_value_float_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_float_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_float_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_INT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_named_value_int_t packet_in = {
+		963497464,963497672,"IJKLMNOPQ"
+    };
+	mavlink_named_value_int_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.value = packet_in.value;
+        
+        mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_named_value_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_int_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_named_value_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_named_value_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
+	mavlink_msg_named_value_int_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STATUSTEXT >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_statustext_t packet_in = {
+		5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"
+    };
+	mavlink_statustext_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.severity = packet_in.severity;
+        
+        mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50);
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_statustext_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text );
+	mavlink_msg_statustext_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text );
+	mavlink_msg_statustext_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_statustext_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_statustext_send(MAVLINK_COMM_1 , packet1.severity , packet1.text );
+	mavlink_msg_statustext_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+	mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
+        if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG >= 256) {
+        	return;
+        }
+#endif
+	mavlink_message_t msg;
+        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
+        uint16_t i;
+	mavlink_debug_t packet_in = {
+		963497464,45.0,29
+    };
+	mavlink_debug_t packet1, packet2;
+        memset(&packet1, 0, sizeof(packet1));
+        packet1.time_boot_ms = packet_in.time_boot_ms;
+        packet1.value = packet_in.value;
+        packet1.ind = packet_in.ind;
+        
+        
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
+        if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
+           // cope with extensions
+           memset(MAVLINK_MSG_ID_DEBUG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_MIN_LEN);
+        }
+#endif
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
+	mavlink_msg_debug_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
+	mavlink_msg_debug_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
+	mavlink_msg_debug_decode(&msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+
+        memset(&packet2, 0, sizeof(packet2));
+        mavlink_msg_to_send_buffer(buffer, &msg);
+        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
+        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
+        }
+	mavlink_msg_debug_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+        
+        memset(&packet2, 0, sizeof(packet2));
+	mavlink_msg_debug_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.ind , packet1.value );
+	mavlink_msg_debug_decode(last_msg, &packet2);
+        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
+}
+
+static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
+{
+	mavlink_test_heartbeat(system_id, component_id, last_msg);
+	mavlink_test_sys_status(system_id, component_id, last_msg);
+	mavlink_test_system_time(system_id, component_id, last_msg);
+	mavlink_test_ping(system_id, component_id, last_msg);
+	mavlink_test_change_operator_control(system_id, component_id, last_msg);
+	mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
+	mavlink_test_auth_key(system_id, component_id, last_msg);
+	mavlink_test_set_mode(system_id, component_id, last_msg);
+	mavlink_test_param_request_read(system_id, component_id, last_msg);
+	mavlink_test_param_request_list(system_id, component_id, last_msg);
+	mavlink_test_param_value(system_id, component_id, last_msg);
+	mavlink_test_param_set(system_id, component_id, last_msg);
+	mavlink_test_gps_raw_int(system_id, component_id, last_msg);
+	mavlink_test_gps_status(system_id, component_id, last_msg);
+	mavlink_test_scaled_imu(system_id, component_id, last_msg);
+	mavlink_test_raw_imu(system_id, component_id, last_msg);
+	mavlink_test_raw_pressure(system_id, component_id, last_msg);
+	mavlink_test_scaled_pressure(system_id, component_id, last_msg);
+	mavlink_test_attitude(system_id, component_id, last_msg);
+	mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
+	mavlink_test_local_position_ned(system_id, component_id, last_msg);
+	mavlink_test_global_position_int(system_id, component_id, last_msg);
+	mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
+	mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
+	mavlink_test_servo_output_raw(system_id, component_id, last_msg);
+	mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
+	mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
+	mavlink_test_mission_item(system_id, component_id, last_msg);
+	mavlink_test_mission_request(system_id, component_id, last_msg);
+	mavlink_test_mission_set_current(system_id, component_id, last_msg);
+	mavlink_test_mission_current(system_id, component_id, last_msg);
+	mavlink_test_mission_request_list(system_id, component_id, last_msg);
+	mavlink_test_mission_count(system_id, component_id, last_msg);
+	mavlink_test_mission_clear_all(system_id, component_id, last_msg);
+	mavlink_test_mission_item_reached(system_id, component_id, last_msg);
+	mavlink_test_mission_ack(system_id, component_id, last_msg);
+	mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
+	mavlink_test_gps_global_origin(system_id, component_id, last_msg);
+	mavlink_test_param_map_rc(system_id, component_id, last_msg);
+	mavlink_test_mission_request_int(system_id, component_id, last_msg);
+	mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
+	mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
+	mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
+	mavlink_test_nav_controller_output(system_id, component_id, last_msg);
+	mavlink_test_global_position_int_cov(system_id, component_id, last_msg);
+	mavlink_test_local_position_ned_cov(system_id, component_id, last_msg);
+	mavlink_test_rc_channels(system_id, component_id, last_msg);
+	mavlink_test_request_data_stream(system_id, component_id, last_msg);
+	mavlink_test_data_stream(system_id, component_id, last_msg);
+	mavlink_test_manual_control(system_id, component_id, last_msg);
+	mavlink_test_rc_channels_override(system_id, component_id, last_msg);
+	mavlink_test_mission_item_int(system_id, component_id, last_msg);
+	mavlink_test_vfr_hud(system_id, component_id, last_msg);
+	mavlink_test_command_int(system_id, component_id, last_msg);
+	mavlink_test_command_long(system_id, component_id, last_msg);
+	mavlink_test_command_ack(system_id, component_id, last_msg);
+	mavlink_test_manual_setpoint(system_id, component_id, last_msg);
+	mavlink_test_set_attitude_target(system_id, component_id, last_msg);
+	mavlink_test_attitude_target(system_id, component_id, last_msg);
+	mavlink_test_set_position_target_local_ned(system_id, component_id, last_msg);
+	mavlink_test_position_target_local_ned(system_id, component_id, last_msg);
+	mavlink_test_set_position_target_global_int(system_id, component_id, last_msg);
+	mavlink_test_position_target_global_int(system_id, component_id, last_msg);
+	mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
+	mavlink_test_hil_state(system_id, component_id, last_msg);
+	mavlink_test_hil_controls(system_id, component_id, last_msg);
+	mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
+	mavlink_test_optical_flow(system_id, component_id, last_msg);
+	mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
+	mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
+	mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
+	mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
+	mavlink_test_highres_imu(system_id, component_id, last_msg);
+	mavlink_test_optical_flow_rad(system_id, component_id, last_msg);
+	mavlink_test_hil_sensor(system_id, component_id, last_msg);
+	mavlink_test_sim_state(system_id, component_id, last_msg);
+	mavlink_test_radio_status(system_id, component_id, last_msg);
+	mavlink_test_file_transfer_protocol(system_id, component_id, last_msg);
+	mavlink_test_timesync(system_id, component_id, last_msg);
+	mavlink_test_camera_trigger(system_id, component_id, last_msg);
+	mavlink_test_hil_gps(system_id, component_id, last_msg);
+	mavlink_test_hil_optical_flow(system_id, component_id, last_msg);
+	mavlink_test_hil_state_quaternion(system_id, component_id, last_msg);
+	mavlink_test_scaled_imu2(system_id, component_id, last_msg);
+	mavlink_test_log_request_list(system_id, component_id, last_msg);
+	mavlink_test_log_entry(system_id, component_id, last_msg);
+	mavlink_test_log_request_data(system_id, component_id, last_msg);
+	mavlink_test_log_data(system_id, component_id, last_msg);
+	mavlink_test_log_erase(system_id, component_id, last_msg);
+	mavlink_test_log_request_end(system_id, component_id, last_msg);
+	mavlink_test_gps_inject_data(system_id, component_id, last_msg);
+	mavlink_test_gps2_raw(system_id, component_id, last_msg);
+	mavlink_test_power_status(system_id, component_id, last_msg);
+	mavlink_test_serial_control(system_id, component_id, last_msg);
+	mavlink_test_gps_rtk(system_id, component_id, last_msg);
+	mavlink_test_gps2_rtk(system_id, component_id, last_msg);
+	mavlink_test_scaled_imu3(system_id, component_id, last_msg);
+	mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
+	mavlink_test_encapsulated_data(system_id, component_id, last_msg);
+	mavlink_test_distance_sensor(system_id, component_id, last_msg);
+	mavlink_test_terrain_request(system_id, component_id, last_msg);
+	mavlink_test_terrain_data(system_id, component_id, last_msg);
+	mavlink_test_terrain_check(system_id, component_id, last_msg);
+	mavlink_test_terrain_report(system_id, component_id, last_msg);
+	mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
+	mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
+	mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
+	mavlink_test_actuator_control_target(system_id, component_id, last_msg);
+	mavlink_test_altitude(system_id, component_id, last_msg);
+	mavlink_test_resource_request(system_id, component_id, last_msg);
+	mavlink_test_scaled_pressure3(system_id, component_id, last_msg);
+	mavlink_test_follow_target(system_id, component_id, last_msg);
+	mavlink_test_control_system_state(system_id, component_id, last_msg);
+	mavlink_test_battery_status(system_id, component_id, last_msg);
+	mavlink_test_autopilot_version(system_id, component_id, last_msg);
+	mavlink_test_landing_target(system_id, component_id, last_msg);
+	mavlink_test_estimator_status(system_id, component_id, last_msg);
+	mavlink_test_wind_cov(system_id, component_id, last_msg);
+	mavlink_test_gps_rtcm_data(system_id, component_id, last_msg);
+	mavlink_test_vibration(system_id, component_id, last_msg);
+	mavlink_test_home_position(system_id, component_id, last_msg);
+	mavlink_test_set_home_position(system_id, component_id, last_msg);
+	mavlink_test_message_interval(system_id, component_id, last_msg);
+	mavlink_test_extended_sys_state(system_id, component_id, last_msg);
+	mavlink_test_adsb_vehicle(system_id, component_id, last_msg);
+	mavlink_test_v2_extension(system_id, component_id, last_msg);
+	mavlink_test_memory_vect(system_id, component_id, last_msg);
+	mavlink_test_debug_vect(system_id, component_id, last_msg);
+	mavlink_test_named_value_float(system_id, component_id, last_msg);
+	mavlink_test_named_value_int(system_id, component_id, last_msg);
+	mavlink_test_statustext(system_id, component_id, last_msg);
+	mavlink_test_debug(system_id, component_id, last_msg);
+}
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+#endif // COMMON_TESTSUITE_H
Index: tags/latest/tools/Controller/Mavlink/src/include/common/version.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/common/version.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/common/version.h	(revision 209)
@@ -0,0 +1,12 @@
+/** @file
+ *	@brief MAVLink comm protocol built from common.xml
+ *	@see http://mavlink.org
+ */
+#ifndef MAVLINK_VERSION_H
+#define MAVLINK_VERSION_H
+
+#define MAVLINK_BUILD_DATE "Tue May 31 2016"
+#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
+#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+ 
+#endif // MAVLINK_VERSION_H
Index: tags/latest/tools/Controller/Mavlink/src/include/mavlink_conversions.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/mavlink_conversions.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/mavlink_conversions.h	(revision 209)
@@ -0,0 +1,211 @@
+#ifndef  _MAVLINK_CONVERSIONS_H_
+#define  _MAVLINK_CONVERSIONS_H_
+
+/* enable math defines on Windows */
+#ifdef _MSC_VER
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES
+#endif
+#endif
+#include <math.h>
+
+#ifndef M_PI_2
+    #define M_PI_2 ((float)asin(1))
+#endif
+
+/**
+ * @file mavlink_conversions.h
+ *
+ * These conversion functions follow the NASA rotation standards definition file
+ * available online.
+ *
+ * Their intent is to lower the barrier for MAVLink adopters to use gimbal-lock free
+ * (both rotation matrices, sometimes called DCM, and quaternions are gimbal-lock free)
+ * rotation representations. Euler angles (roll, pitch, yaw) will be phased out of the
+ * protocol as widely as possible.
+ *
+ * @author James Goppert
+ * @author Thomas Gubler <thomasgubler@gmail.com>
+ */
+
+
+/**
+ * Converts a quaternion to a rotation matrix
+ *
+ * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
+ * @param dcm a 3x3 rotation matrix
+ */
+MAVLINK_HELPER void mavlink_quaternion_to_dcm(const float quaternion[4], float dcm[3][3])
+{
+    double a = quaternion[0];
+    double b = quaternion[1];
+    double c = quaternion[2];
+    double d = quaternion[3];
+    double aSq = a * a;
+    double bSq = b * b;
+    double cSq = c * c;
+    double dSq = d * d;
+    dcm[0][0] = aSq + bSq - cSq - dSq;
+    dcm[0][1] = 2 * (b * c - a * d);
+    dcm[0][2] = 2 * (a * c + b * d);
+    dcm[1][0] = 2 * (b * c + a * d);
+    dcm[1][1] = aSq - bSq + cSq - dSq;
+    dcm[1][2] = 2 * (c * d - a * b);
+    dcm[2][0] = 2 * (b * d - a * c);
+    dcm[2][1] = 2 * (a * b + c * d);
+    dcm[2][2] = aSq - bSq - cSq + dSq;
+}
+
+
+/**
+ * Converts a rotation matrix to euler angles
+ *
+ * @param dcm a 3x3 rotation matrix
+ * @param roll the roll angle in radians
+ * @param pitch the pitch angle in radians
+ * @param yaw the yaw angle in radians
+ */
+MAVLINK_HELPER void mavlink_dcm_to_euler(const float dcm[3][3], float* roll, float* pitch, float* yaw)
+{
+    float phi, theta, psi;
+    theta = asin(-dcm[2][0]);
+
+    if (fabsf(theta - (float)M_PI_2) < 1.0e-3f) {
+        phi = 0.0f;
+        psi = (atan2f(dcm[1][2] - dcm[0][1],
+                dcm[0][2] + dcm[1][1]) + phi);
+
+    } else if (fabsf(theta + (float)M_PI_2) < 1.0e-3f) {
+        phi = 0.0f;
+        psi = atan2f(dcm[1][2] - dcm[0][1],
+                  dcm[0][2] + dcm[1][1] - phi);
+
+    } else {
+        phi = atan2f(dcm[2][1], dcm[2][2]);
+        psi = atan2f(dcm[1][0], dcm[0][0]);
+    }
+
+    *roll = phi;
+    *pitch = theta;
+    *yaw = psi;
+}
+
+
+/**
+ * Converts a quaternion to euler angles
+ *
+ * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
+ * @param roll the roll angle in radians
+ * @param pitch the pitch angle in radians
+ * @param yaw the yaw angle in radians
+ */
+MAVLINK_HELPER void mavlink_quaternion_to_euler(const float quaternion[4], float* roll, float* pitch, float* yaw)
+{
+    float dcm[3][3];
+    mavlink_quaternion_to_dcm(quaternion, dcm);
+    mavlink_dcm_to_euler((const float(*)[3])dcm, roll, pitch, yaw);
+}
+
+
+/**
+ * Converts euler angles to a quaternion
+ *
+ * @param roll the roll angle in radians
+ * @param pitch the pitch angle in radians
+ * @param yaw the yaw angle in radians
+ * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
+ */
+MAVLINK_HELPER void mavlink_euler_to_quaternion(float roll, float pitch, float yaw, float quaternion[4])
+{
+    float cosPhi_2 = cosf(roll / 2);
+    float sinPhi_2 = sinf(roll / 2);
+    float cosTheta_2 = cosf(pitch / 2);
+    float sinTheta_2 = sinf(pitch / 2);
+    float cosPsi_2 = cosf(yaw / 2);
+    float sinPsi_2 = sinf(yaw / 2);
+    quaternion[0] = (cosPhi_2 * cosTheta_2 * cosPsi_2 +
+            sinPhi_2 * sinTheta_2 * sinPsi_2);
+    quaternion[1] = (sinPhi_2 * cosTheta_2 * cosPsi_2 -
+            cosPhi_2 * sinTheta_2 * sinPsi_2);
+    quaternion[2] = (cosPhi_2 * sinTheta_2 * cosPsi_2 +
+            sinPhi_2 * cosTheta_2 * sinPsi_2);
+    quaternion[3] = (cosPhi_2 * cosTheta_2 * sinPsi_2 -
+            sinPhi_2 * sinTheta_2 * cosPsi_2);
+}
+
+
+/**
+ * Converts a rotation matrix to a quaternion
+ * Reference:
+ *  - Shoemake, Quaternions,
+ *  http://www.cs.ucr.edu/~vbz/resources/quatut.pdf
+ *
+ * @param dcm a 3x3 rotation matrix
+ * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
+ */
+MAVLINK_HELPER void mavlink_dcm_to_quaternion(const float dcm[3][3], float quaternion[4])
+{
+    float tr = dcm[0][0] + dcm[1][1] + dcm[2][2];
+    if (tr > 0.0f) {
+        float s = sqrtf(tr + 1.0f);
+        quaternion[0] = s * 0.5f;
+        s = 0.5f / s;
+        quaternion[1] = (dcm[2][1] - dcm[1][2]) * s;
+        quaternion[2] = (dcm[0][2] - dcm[2][0]) * s;
+        quaternion[3] = (dcm[1][0] - dcm[0][1]) * s;
+    } else {
+        /* Find maximum diagonal element in dcm
+         * store index in dcm_i */
+        int dcm_i = 0;
+        int i;
+        for (i = 1; i < 3; i++) {
+            if (dcm[i][i] > dcm[dcm_i][dcm_i]) {
+                dcm_i = i;
+            }
+        }
+
+        int dcm_j = (dcm_i + 1) % 3;
+        int dcm_k = (dcm_i + 2) % 3;
+
+        float s = sqrtf((dcm[dcm_i][dcm_i] - dcm[dcm_j][dcm_j] -
+                    dcm[dcm_k][dcm_k]) + 1.0f);
+        quaternion[dcm_i + 1] = s * 0.5f;
+        s = 0.5f / s;
+        quaternion[dcm_j + 1] = (dcm[dcm_i][dcm_j] + dcm[dcm_j][dcm_i]) * s;
+        quaternion[dcm_k + 1] = (dcm[dcm_k][dcm_i] + dcm[dcm_i][dcm_k]) * s;
+        quaternion[0] = (dcm[dcm_k][dcm_j] - dcm[dcm_j][dcm_k]) * s;
+    }
+}
+
+
+/**
+ * Converts euler angles to a rotation matrix
+ *
+ * @param roll the roll angle in radians
+ * @param pitch the pitch angle in radians
+ * @param yaw the yaw angle in radians
+ * @param dcm a 3x3 rotation matrix
+ */
+MAVLINK_HELPER void mavlink_euler_to_dcm(float roll, float pitch, float yaw, float dcm[3][3])
+{
+    float cosPhi = cosf(roll);
+    float sinPhi = sinf(roll);
+    float cosThe = cosf(pitch);
+    float sinThe = sinf(pitch);
+    float cosPsi = cosf(yaw);
+    float sinPsi = sinf(yaw);
+
+    dcm[0][0] = cosThe * cosPsi;
+    dcm[0][1] = -cosPhi * sinPsi + sinPhi * sinThe * cosPsi;
+    dcm[0][2] = sinPhi * sinPsi + cosPhi * sinThe * cosPsi;
+
+    dcm[1][0] = cosThe * sinPsi;
+    dcm[1][1] = cosPhi * cosPsi + sinPhi * sinThe * sinPsi;
+    dcm[1][2] = -sinPhi * cosPsi + cosPhi * sinThe * sinPsi;
+
+    dcm[2][0] = -sinThe;
+    dcm[2][1] = sinPhi * cosThe;
+    dcm[2][2] = cosPhi * cosThe;
+}
+
+#endif
Index: tags/latest/tools/Controller/Mavlink/src/include/mavlink_helpers.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/mavlink_helpers.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/mavlink_helpers.h	(revision 209)
@@ -0,0 +1,676 @@
+#ifndef  _MAVLINK_HELPERS_H_
+#define  _MAVLINK_HELPERS_H_
+
+#include "string.h"
+#include "checksum.h"
+#include "mavlink_types.h"
+#include "mavlink_conversions.h"
+
+#ifndef MAVLINK_HELPER
+#define MAVLINK_HELPER
+#endif
+
+/*
+ * Internal function to give access to the channel status for each channel
+ */
+#ifndef MAVLINK_GET_CHANNEL_STATUS
+MAVLINK_HELPER mavlink_status_t* mavlink_get_channel_status(uint8_t chan)
+{
+#ifdef MAVLINK_EXTERNAL_RX_STATUS
+	// No m_mavlink_status array defined in function,
+	// has to be defined externally
+#else
+	static mavlink_status_t m_mavlink_status[MAVLINK_COMM_NUM_BUFFERS];
+#endif
+	return &m_mavlink_status[chan];
+}
+#endif
+
+/*
+ * Internal function to give access to the channel buffer for each channel
+ */
+#ifndef MAVLINK_GET_CHANNEL_BUFFER
+MAVLINK_HELPER mavlink_message_t* mavlink_get_channel_buffer(uint8_t chan)
+{
+	
+#ifdef MAVLINK_EXTERNAL_RX_BUFFER
+	// No m_mavlink_buffer array defined in function,
+	// has to be defined externally
+#else
+	static mavlink_message_t m_mavlink_buffer[MAVLINK_COMM_NUM_BUFFERS];
+#endif
+	return &m_mavlink_buffer[chan];
+}
+#endif
+
+/**
+ * @brief Reset the status of a channel.
+ */
+MAVLINK_HELPER void mavlink_reset_channel_status(uint8_t chan)
+{
+	mavlink_status_t *status = mavlink_get_channel_status(chan);
+	status->parse_state = MAVLINK_PARSE_STATE_IDLE;
+}
+
+/**
+ * @brief Finalize a MAVLink message with channel assignment
+ *
+ * This function calculates the checksum and sets length and aircraft id correctly.
+ * It assumes that the message id and the payload are already correctly set. This function
+ * can also be used if the message header has already been written before (as in mavlink_msg_xxx_pack
+ * instead of mavlink_msg_xxx_pack_headerless), it just introduces little extra overhead.
+ *
+ * @param msg Message to finalize
+ * @param system_id Id of the sending (this) system, 1-127
+ * @param length Message length
+ */
+#if MAVLINK_CRC_EXTRA
+MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, 
+						      uint8_t chan, uint8_t min_length, uint8_t length, uint8_t crc_extra)
+#else
+MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, 
+						      uint8_t chan, uint8_t length)
+#endif
+{
+	// This code part is the same for all messages;
+	msg->magic = MAVLINK_STX;
+	msg->len = length;
+	msg->sysid = system_id;
+	msg->compid = component_id;
+	// One sequence number per channel
+	msg->seq = mavlink_get_channel_status(chan)->current_tx_seq;
+	mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1;
+	msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN);
+	crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len);
+#if MAVLINK_CRC_EXTRA
+	crc_accumulate(crc_extra, &msg->checksum);
+#endif
+	mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF);
+	mavlink_ck_b(msg) = (uint8_t)(msg->checksum >> 8);
+
+	return length + MAVLINK_NUM_NON_PAYLOAD_BYTES;
+}
+
+
+/**
+ * @brief Finalize a MAVLink message with MAVLINK_COMM_0 as default channel
+ */
+#if MAVLINK_CRC_EXTRA
+MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, 
+						 uint8_t min_length, uint8_t length, uint8_t crc_extra)
+{
+    return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, min_length, length, crc_extra);
+}
+#else
+MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, 
+						 uint8_t length)
+{
+	return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, length);
+}
+#endif
+
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len);
+
+/**
+ * @brief Finalize a MAVLink message with channel assignment and send
+ */
+#if MAVLINK_CRC_EXTRA
+MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, 
+						    uint8_t min_length, uint8_t length, uint8_t crc_extra)
+#else
+MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length)
+#endif
+{
+	uint16_t checksum;
+	uint8_t buf[MAVLINK_NUM_HEADER_BYTES];
+	uint8_t ck[2];
+	mavlink_status_t *status = mavlink_get_channel_status(chan);
+	buf[0] = MAVLINK_STX;
+	buf[1] = length;
+	buf[2] = status->current_tx_seq;
+	buf[3] = mavlink_system.sysid;
+	buf[4] = mavlink_system.compid;
+	buf[5] = msgid;
+	status->current_tx_seq++;
+	checksum = crc_calculate((const uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN);
+	crc_accumulate_buffer(&checksum, packet, length);
+#if MAVLINK_CRC_EXTRA
+	crc_accumulate(crc_extra, &checksum);
+#endif
+	ck[0] = (uint8_t)(checksum & 0xFF);
+	ck[1] = (uint8_t)(checksum >> 8);
+
+	MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length);
+	_mavlink_send_uart(chan, (const char *)buf, MAVLINK_NUM_HEADER_BYTES);
+	_mavlink_send_uart(chan, packet, length);
+	_mavlink_send_uart(chan, (const char *)ck, 2);
+	MAVLINK_END_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length);
+}
+
+/**
+ * @brief re-send a message over a uart channel
+ * this is more stack efficient than re-marshalling the message
+ */
+MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_message_t *msg)
+{
+	uint8_t ck[2];
+
+	ck[0] = (uint8_t)(msg->checksum & 0xFF);
+	ck[1] = (uint8_t)(msg->checksum >> 8);
+	// XXX use the right sequence here
+
+	MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len);
+	_mavlink_send_uart(chan, (const char *)&msg->magic, MAVLINK_NUM_HEADER_BYTES);
+	_mavlink_send_uart(chan, _MAV_PAYLOAD(msg), msg->len);
+	_mavlink_send_uart(chan, (const char *)ck, 2);
+	MAVLINK_END_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len);
+}
+#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+/**
+ * @brief Pack a message to send it over a serial byte stream
+ */
+MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
+{
+	memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
+
+	uint8_t *ck = buffer + (MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
+
+	ck[0] = (uint8_t)(msg->checksum & 0xFF);
+	ck[1] = (uint8_t)(msg->checksum >> 8);
+
+	return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len;
+}
+
+union __mavlink_bitfield {
+	uint8_t uint8;
+	int8_t int8;
+	uint16_t uint16;
+	int16_t int16;
+	uint32_t uint32;
+	int32_t int32;
+};
+
+
+MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg)
+{
+	crc_init(&msg->checksum);
+}
+
+MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c)
+{
+	crc_accumulate(c, &msg->checksum);
+}
+
+/**
+ * This is a varient of mavlink_frame_char() but with caller supplied
+ * parsing buffers. It is useful when you want to create a MAVLink
+ * parser in a library that doesn't use any global variables
+ *
+ * @param rxmsg    parsing message buffer
+ * @param status   parsing starus buffer 
+ * @param c        The char to parse
+ *
+ * @param returnMsg NULL if no message could be decoded, the message data else
+ * @param returnStats if a message was decoded, this is filled with the channel's stats
+ * @return 0 if no message could be decoded, 1 on good message and CRC, 2 on bad CRC
+ *
+ * A typical use scenario of this function call is:
+ *
+ * @code
+ * #include <mavlink.h>
+ *
+ * mavlink_message_t msg;
+ * int chan = 0;
+ *
+ *
+ * while(serial.bytesAvailable > 0)
+ * {
+ *   uint8_t byte = serial.getNextByte();
+ *   if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE)
+ *     {
+ *     printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid);
+ *     }
+ * }
+ *
+ *
+ * @endcode
+ */
+MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, 
+                                                 mavlink_status_t* status,
+                                                 uint8_t c, 
+                                                 mavlink_message_t* r_message, 
+                                                 mavlink_status_t* r_mavlink_status)
+{
+        /*
+	  default message crc function. You can override this per-system to
+	  put this data in a different memory segment
+	*/
+#if MAVLINK_CRC_EXTRA
+#ifndef MAVLINK_MESSAGE_CRC
+	static const uint8_t mavlink_message_crcs[256] = MAVLINK_MESSAGE_CRCS;
+#define MAVLINK_MESSAGE_CRC(msgid) mavlink_message_crcs[msgid]
+#endif
+#endif
+
+	/* Enable this option to check the length of each message.
+	   This allows invalid messages to be caught much sooner. Use if the transmission
+	   medium is prone to missing (or extra) characters (e.g. a radio that fades in
+	   and out). Only use if the channel will only contain messages types listed in
+	   the headers.
+	*/
+#ifdef MAVLINK_CHECK_MESSAGE_LENGTH
+#ifndef MAVLINK_MESSAGE_LENGTH
+	static const uint8_t mavlink_message_lengths[256] = MAVLINK_MESSAGE_LENGTHS;
+#define MAVLINK_MESSAGE_LENGTH(msgid) mavlink_message_lengths[msgid]
+#endif
+#endif
+
+	int bufferIndex = 0;
+
+	status->msg_received = MAVLINK_FRAMING_INCOMPLETE;
+
+	switch (status->parse_state)
+	{
+	case MAVLINK_PARSE_STATE_UNINIT:
+	case MAVLINK_PARSE_STATE_IDLE:
+		if (c == MAVLINK_STX)
+		{
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_STX;
+			rxmsg->len = 0;
+			rxmsg->magic = c;
+			mavlink_start_checksum(rxmsg);
+		}
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_STX:
+			if (status->msg_received 
+/* Support shorter buffers than the
+   default maximum packet size */
+#if (MAVLINK_MAX_PAYLOAD_LEN < 255)
+				|| c > MAVLINK_MAX_PAYLOAD_LEN
+#endif
+				)
+		{
+			status->buffer_overrun++;
+			status->parse_error++;
+			status->msg_received = 0;
+			status->parse_state = MAVLINK_PARSE_STATE_IDLE;
+		}
+		else
+		{
+			// NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2
+			rxmsg->len = c;
+			status->packet_idx = 0;
+			mavlink_update_checksum(rxmsg, c);
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH;
+		}
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_LENGTH:
+		rxmsg->seq = c;
+		mavlink_update_checksum(rxmsg, c);
+		status->parse_state = MAVLINK_PARSE_STATE_GOT_SEQ;
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_SEQ:
+		rxmsg->sysid = c;
+		mavlink_update_checksum(rxmsg, c);
+		status->parse_state = MAVLINK_PARSE_STATE_GOT_SYSID;
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_SYSID:
+		rxmsg->compid = c;
+		mavlink_update_checksum(rxmsg, c);
+		status->parse_state = MAVLINK_PARSE_STATE_GOT_COMPID;
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_COMPID:
+#ifdef MAVLINK_CHECK_MESSAGE_LENGTH
+	        if (rxmsg->len != MAVLINK_MESSAGE_LENGTH(c))
+		{
+			status->parse_error++;
+			status->parse_state = MAVLINK_PARSE_STATE_IDLE;
+			break;
+	    }
+#endif
+		rxmsg->msgid = c;
+		mavlink_update_checksum(rxmsg, c);
+		if (rxmsg->len == 0)
+		{
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD;
+		}
+		else
+		{
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID;
+		}
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_MSGID:
+		_MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c;
+		mavlink_update_checksum(rxmsg, c);
+		if (status->packet_idx == rxmsg->len)
+		{
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD;
+		}
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_PAYLOAD:
+#if MAVLINK_CRC_EXTRA
+		mavlink_update_checksum(rxmsg, MAVLINK_MESSAGE_CRC(rxmsg->msgid));
+#endif
+		if (c != (rxmsg->checksum & 0xFF)) {
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_BAD_CRC1;
+		} else {
+			status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1;
+		}
+                _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx] = (char)c;
+		break;
+
+	case MAVLINK_PARSE_STATE_GOT_CRC1:
+	case MAVLINK_PARSE_STATE_GOT_BAD_CRC1:
+		if (status->parse_state == MAVLINK_PARSE_STATE_GOT_BAD_CRC1 || c != (rxmsg->checksum >> 8)) {
+			// got a bad CRC message
+			status->msg_received = MAVLINK_FRAMING_BAD_CRC;
+		} else {
+			// Successfully got message
+			status->msg_received = MAVLINK_FRAMING_OK;
+                }
+                status->parse_state = MAVLINK_PARSE_STATE_IDLE;
+                _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c;
+                memcpy(r_message, rxmsg, sizeof(mavlink_message_t));
+		break;
+	}
+
+	bufferIndex++;
+	// If a message has been sucessfully decoded, check index
+	if (status->msg_received == MAVLINK_FRAMING_OK)
+	{
+		//while(status->current_seq != rxmsg->seq)
+		//{
+		//	status->packet_rx_drop_count++;
+		//               status->current_seq++;
+		//}
+		status->current_rx_seq = rxmsg->seq;
+		// Initial condition: If no packet has been received so far, drop count is undefined
+		if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0;
+		// Count this packet as received
+		status->packet_rx_success_count++;
+	}
+
+	r_message->len = rxmsg->len; // Provide visibility on how far we are into current msg
+	r_mavlink_status->parse_state = status->parse_state;
+	r_mavlink_status->packet_idx = status->packet_idx;
+	r_mavlink_status->current_rx_seq = status->current_rx_seq+1;
+	r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count;
+	r_mavlink_status->packet_rx_drop_count = status->parse_error;
+	status->parse_error = 0;
+
+	if (status->msg_received == MAVLINK_FRAMING_BAD_CRC) {
+		/*
+		  the CRC came out wrong. We now need to overwrite the
+		  msg CRC with the one on the wire so that if the
+		  caller decides to forward the message anyway that
+		  mavlink_msg_to_send_buffer() won't overwrite the
+		  checksum
+		 */
+		r_message->checksum = _MAV_PAYLOAD(rxmsg)[status->packet_idx] | (_MAV_PAYLOAD(rxmsg)[status->packet_idx+1]<<8);
+	}
+
+	return status->msg_received;
+}
+
+/**
+ * This is a convenience function which handles the complete MAVLink parsing.
+ * the function will parse one byte at a time and return the complete packet once
+ * it could be successfully decoded. This function will return 0, 1 or
+ * 2 (MAVLINK_FRAMING_INCOMPLETE, MAVLINK_FRAMING_OK or MAVLINK_FRAMING_BAD_CRC)
+ *
+ * Messages are parsed into an internal buffer (one for each channel). When a complete
+ * message is received it is copies into *returnMsg and the channel's status is
+ * copied into *returnStats.
+ *
+ * @param chan     ID of the current channel. This allows to parse different channels with this function.
+ *                 a channel is not a physical message channel like a serial port, but a logic partition of
+ *                 the communication streams in this case. COMM_NB is the limit for the number of channels
+ *                 on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows
+ * @param c        The char to parse
+ *
+ * @param returnMsg NULL if no message could be decoded, the message data else
+ * @param returnStats if a message was decoded, this is filled with the channel's stats
+ * @return 0 if no message could be decoded, 1 on good message and CRC, 2 on bad CRC
+ *
+ * A typical use scenario of this function call is:
+ *
+ * @code
+ * #include <mavlink.h>
+ *
+ * mavlink_message_t msg;
+ * int chan = 0;
+ *
+ *
+ * while(serial.bytesAvailable > 0)
+ * {
+ *   uint8_t byte = serial.getNextByte();
+ *   if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE)
+ *     {
+ *     printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid);
+ *     }
+ * }
+ *
+ *
+ * @endcode
+ */
+MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status)
+{
+	return mavlink_frame_char_buffer(mavlink_get_channel_buffer(chan),
+					 mavlink_get_channel_status(chan),
+					 c,
+					 r_message,
+					 r_mavlink_status);
+}
+
+
+/**
+ * This is a convenience function which handles the complete MAVLink parsing.
+ * the function will parse one byte at a time and return the complete packet once
+ * it could be successfully decoded. This function will return 0 or 1.
+ *
+ * Messages are parsed into an internal buffer (one for each channel). When a complete
+ * message is received it is copies into *returnMsg and the channel's status is
+ * copied into *returnStats.
+ *
+ * @param chan     ID of the current channel. This allows to parse different channels with this function.
+ *                 a channel is not a physical message channel like a serial port, but a logic partition of
+ *                 the communication streams in this case. COMM_NB is the limit for the number of channels
+ *                 on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows
+ * @param c        The char to parse
+ *
+ * @param returnMsg NULL if no message could be decoded, the message data else
+ * @param returnStats if a message was decoded, this is filled with the channel's stats
+ * @return 0 if no message could be decoded or bad CRC, 1 on good message and CRC
+ *
+ * A typical use scenario of this function call is:
+ *
+ * @code
+ * #include <mavlink.h>
+ *
+ * mavlink_message_t msg;
+ * int chan = 0;
+ *
+ *
+ * while(serial.bytesAvailable > 0)
+ * {
+ *   uint8_t byte = serial.getNextByte();
+ *   if (mavlink_parse_char(chan, byte, &msg))
+ *     {
+ *     printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid);
+ *     }
+ * }
+ *
+ *
+ * @endcode
+ */
+MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status)
+{
+    uint8_t msg_received = mavlink_frame_char(chan, c, r_message, r_mavlink_status);
+    if (msg_received == MAVLINK_FRAMING_BAD_CRC) {
+	    // we got a bad CRC. Treat as a parse failure
+	    mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan);
+	    mavlink_status_t* status = mavlink_get_channel_status(chan);
+	    status->parse_error++;
+	    status->msg_received = MAVLINK_FRAMING_INCOMPLETE;
+	    status->parse_state = MAVLINK_PARSE_STATE_IDLE;
+	    if (c == MAVLINK_STX)
+	    {
+		    status->parse_state = MAVLINK_PARSE_STATE_GOT_STX;
+		    rxmsg->len = 0;
+		    mavlink_start_checksum(rxmsg);
+	    }
+	    return 0;
+    }
+    return msg_received;
+}
+
+/**
+ * @brief Put a bitfield of length 1-32 bit into the buffer
+ *
+ * @param b the value to add, will be encoded in the bitfield
+ * @param bits number of bits to use to encode b, e.g. 1 for boolean, 2, 3, etc.
+ * @param packet_index the position in the packet (the index of the first byte to use)
+ * @param bit_index the position in the byte (the index of the first bit to use)
+ * @param buffer packet buffer to write into
+ * @return new position of the last used byte in the buffer
+ */
+MAVLINK_HELPER uint8_t put_bitfield_n_by_index(int32_t b, uint8_t bits, uint8_t packet_index, uint8_t bit_index, uint8_t* r_bit_index, uint8_t* buffer)
+{
+	uint16_t bits_remain = bits;
+	// Transform number into network order
+	int32_t v;
+	uint8_t i_bit_index, i_byte_index, curr_bits_n;
+#if MAVLINK_NEED_BYTE_SWAP
+	union {
+		int32_t i;
+		uint8_t b[4];
+	} bin, bout;
+	bin.i = b;
+	bout.b[0] = bin.b[3];
+	bout.b[1] = bin.b[2];
+	bout.b[2] = bin.b[1];
+	bout.b[3] = bin.b[0];
+	v = bout.i;
+#else
+	v = b;
+#endif
+
+	// buffer in
+	// 01100000 01000000 00000000 11110001
+	// buffer out
+	// 11110001 00000000 01000000 01100000
+
+	// Existing partly filled byte (four free slots)
+	// 0111xxxx
+
+	// Mask n free bits
+	// 00001111 = 2^0 + 2^1 + 2^2 + 2^3 = 2^n - 1
+	// = ((uint32_t)(1 << n)) - 1; // = 2^n - 1
+
+	// Shift n bits into the right position
+	// out = in >> n;
+
+	// Mask and shift bytes
+	i_bit_index = bit_index;
+	i_byte_index = packet_index;
+	if (bit_index > 0)
+	{
+		// If bits were available at start, they were available
+		// in the byte before the current index
+		i_byte_index--;
+	}
+
+	// While bits have not been packed yet
+	while (bits_remain > 0)
+	{
+		// Bits still have to be packed
+		// there can be more than 8 bits, so
+		// we might have to pack them into more than one byte
+
+		// First pack everything we can into the current 'open' byte
+		//curr_bits_n = bits_remain << 3; // Equals  bits_remain mod 8
+		//FIXME
+		if (bits_remain <= (uint8_t)(8 - i_bit_index))
+		{
+			// Enough space
+			curr_bits_n = (uint8_t)bits_remain;
+		}
+		else
+		{
+			curr_bits_n = (8 - i_bit_index);
+		}
+		
+		// Pack these n bits into the current byte
+		// Mask out whatever was at that position with ones (xxx11111)
+		buffer[i_byte_index] &= (0xFF >> (8 - curr_bits_n));
+		// Put content to this position, by masking out the non-used part
+		buffer[i_byte_index] |= ((0x00 << curr_bits_n) & v);
+		
+		// Increment the bit index
+		i_bit_index += curr_bits_n;
+
+		// Now proceed to the next byte, if necessary
+		bits_remain -= curr_bits_n;
+		if (bits_remain > 0)
+		{
+			// Offer another 8 bits / one byte
+			i_byte_index++;
+			i_bit_index = 0;
+		}
+	}
+	
+	*r_bit_index = i_bit_index;
+	// If a partly filled byte is present, mark this as consumed
+	if (i_bit_index != 7) i_byte_index++;
+	return i_byte_index - packet_index;
+}
+
+#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+// To make MAVLink work on your MCU, define comm_send_ch() if you wish
+// to send 1 byte at a time, or MAVLINK_SEND_UART_BYTES() to send a
+// whole packet at a time
+
+/*
+
+#include "mavlink_types.h"
+
+void comm_send_ch(mavlink_channel_t chan, uint8_t ch)
+{
+    if (chan == MAVLINK_COMM_0)
+    {
+        uart0_transmit(ch);
+    }
+    if (chan == MAVLINK_COMM_1)
+    {
+    	uart1_transmit(ch);
+    }
+}
+ */
+
+MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len)
+{
+#ifdef MAVLINK_SEND_UART_BYTES
+	/* this is the more efficient approach, if the platform
+	   defines it */
+	MAVLINK_SEND_UART_BYTES(chan, (const uint8_t *)buf, len);
+#else
+	/* fallback to one byte at a time */
+	uint16_t i;
+	for (i = 0; i < len; i++) {
+		comm_send_ch(chan, (uint8_t)buf[i]);
+	}
+#endif
+}
+#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS
+
+#endif /* _MAVLINK_HELPERS_H_ */
Index: tags/latest/tools/Controller/Mavlink/src/include/mavlink_types.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/mavlink_types.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/mavlink_types.h	(revision 209)
@@ -0,0 +1,228 @@
+#ifndef MAVLINK_TYPES_H_
+#define MAVLINK_TYPES_H_
+
+// Visual Studio versions before 2010 don't have stdint.h, so we just error out.
+#if (defined _MSC_VER) && (_MSC_VER < 1600)
+#error "The C-MAVLink implementation requires Visual Studio 2010 or greater"
+#endif
+
+#include <stdint.h>
+
+// Macro to define packed structures
+#ifdef __GNUC__
+  #define MAVPACKED( __Declaration__ ) __Declaration__ __attribute__((packed))
+#else
+  #define MAVPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
+#endif
+
+#ifndef MAVLINK_MAX_PAYLOAD_LEN
+// it is possible to override this, but be careful!
+#define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length
+#endif
+
+#define MAVLINK_CORE_HEADER_LEN 5 ///< Length of core header (of the comm. layer): message length (1 byte) + message sequence (1 byte) + message system id (1 byte) + message component id (1 byte) + message type id (1 byte)
+#define MAVLINK_NUM_HEADER_BYTES (MAVLINK_CORE_HEADER_LEN + 1) ///< Length of all header bytes, including core and checksum
+#define MAVLINK_NUM_CHECKSUM_BYTES 2
+#define MAVLINK_NUM_NON_PAYLOAD_BYTES (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES)
+
+#define MAVLINK_MAX_PACKET_LEN (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) ///< Maximum packet length
+
+#define MAVLINK_MSG_ID_EXTENDED_MESSAGE 255
+#define MAVLINK_EXTENDED_HEADER_LEN 14
+
+#if (defined _MSC_VER) || ((defined __APPLE__) && (defined __MACH__)) || (defined __linux__)
+  /* full fledged 32bit++ OS */
+  #define MAVLINK_MAX_EXTENDED_PACKET_LEN 65507
+#else
+  /* small microcontrollers */
+  #define MAVLINK_MAX_EXTENDED_PACKET_LEN 2048
+#endif
+
+#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES)
+
+
+/**
+ * Old-style 4 byte param union
+ *
+ * This struct is the data format to be used when sending
+ * parameters. The parameter should be copied to the native
+ * type (without type conversion)
+ * and re-instanted on the receiving side using the
+ * native type as well.
+ */
+MAVPACKED(
+typedef struct param_union {
+	union {
+		float param_float;
+		int32_t param_int32;
+		uint32_t param_uint32;
+		int16_t param_int16;
+		uint16_t param_uint16;
+		int8_t param_int8;
+		uint8_t param_uint8;
+		uint8_t bytes[4];
+	};
+	uint8_t type;
+}) mavlink_param_union_t;
+
+
+/**
+ * New-style 8 byte param union
+ * mavlink_param_union_double_t will be 8 bytes long, and treated as needing 8 byte alignment for the purposes of MAVLink 1.0 field ordering.
+ * The mavlink_param_union_double_t will be treated as a little-endian structure.
+ *
+ * If is_double is 1 then the type is a double, and the remaining 63 bits are the double, with the lowest bit of the mantissa zero.
+ * The intention is that by replacing the is_double bit with 0 the type can be directly used as a double (as the is_double bit corresponds to the
+ * lowest mantissa bit of a double). If is_double is 0 then mavlink_type gives the type in the union.
+ * The mavlink_types.h header will also need to have shifts/masks to define the bit boundaries in the above,
+ * as bitfield ordering isn’t consistent between platforms. The above is intended to be for gcc on x86,
+ * which should be the same as gcc on little-endian arm. When using shifts/masks the value will be treated as a 64 bit unsigned number,
+ * and the bits pulled out using the shifts/masks.
+*/
+MAVPACKED(
+typedef struct param_union_extended {
+    union {
+    struct {
+        uint8_t is_double:1;
+        uint8_t mavlink_type:7;
+        union {
+            char c;
+            uint8_t uint8;
+            int8_t int8;
+            uint16_t uint16;
+            int16_t int16;
+            uint32_t uint32;
+            int32_t int32;
+            float f;
+            uint8_t align[7];
+        };
+    };
+    uint8_t data[8];
+    };
+}) mavlink_param_union_double_t;
+
+/**
+ * This structure is required to make the mavlink_send_xxx convenience functions
+ * work, as it tells the library what the current system and component ID are.
+ */
+MAVPACKED(
+typedef struct __mavlink_system {
+    uint8_t sysid;   ///< Used by the MAVLink message_xx_send() convenience function
+    uint8_t compid;  ///< Used by the MAVLink message_xx_send() convenience function
+}) mavlink_system_t;
+
+MAVPACKED(
+typedef struct __mavlink_message {
+	uint16_t checksum; ///< sent at end of packet
+	uint8_t magic;   ///< protocol magic marker
+	uint8_t len;     ///< Length of payload
+	uint8_t seq;     ///< Sequence of packet
+	uint8_t sysid;   ///< ID of message sender system/aircraft
+	uint8_t compid;  ///< ID of the message sender component
+	uint8_t msgid;   ///< ID of message in payload
+	uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
+}) mavlink_message_t;
+
+MAVPACKED(
+typedef struct __mavlink_extended_message {
+       mavlink_message_t base_msg;
+       int32_t extended_payload_len;   ///< Length of extended payload if any
+       uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN];
+}) mavlink_extended_message_t;
+
+typedef enum {
+	MAVLINK_TYPE_CHAR     = 0,
+	MAVLINK_TYPE_UINT8_T  = 1,
+	MAVLINK_TYPE_INT8_T   = 2,
+	MAVLINK_TYPE_UINT16_T = 3,
+	MAVLINK_TYPE_INT16_T  = 4,
+	MAVLINK_TYPE_UINT32_T = 5,
+	MAVLINK_TYPE_INT32_T  = 6,
+	MAVLINK_TYPE_UINT64_T = 7,
+	MAVLINK_TYPE_INT64_T  = 8,
+	MAVLINK_TYPE_FLOAT    = 9,
+	MAVLINK_TYPE_DOUBLE   = 10
+} mavlink_message_type_t;
+
+#define MAVLINK_MAX_FIELDS 64
+
+typedef struct __mavlink_field_info {
+        const char *name;                 // name of this field
+        const char *print_format;         // printing format hint, or NULL
+        mavlink_message_type_t type;      // type of this field
+        unsigned int array_length;        // if non-zero, field is an array
+        unsigned int wire_offset;         // offset of each field in the payload
+        unsigned int structure_offset;    // offset in a C structure
+} mavlink_field_info_t;
+
+// note that in this structure the order of fields is the order
+// in the XML file, not necessary the wire order
+typedef struct __mavlink_message_info {
+	const char *name;                                      // name of the message
+	unsigned num_fields;                                   // how many fields in this message
+	mavlink_field_info_t fields[MAVLINK_MAX_FIELDS];       // field information
+} mavlink_message_info_t;
+
+#define _MAV_PAYLOAD(msg) ((const char *)(&((msg)->payload64[0])))
+#define _MAV_PAYLOAD_NON_CONST(msg) ((char *)(&((msg)->payload64[0])))
+
+// checksum is immediately after the payload bytes
+#define mavlink_ck_a(msg) *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
+#define mavlink_ck_b(msg) *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
+
+typedef enum {
+    MAVLINK_COMM_0,
+    MAVLINK_COMM_1,
+    MAVLINK_COMM_2,
+    MAVLINK_COMM_3
+} mavlink_channel_t;
+
+/*
+ * applications can set MAVLINK_COMM_NUM_BUFFERS to the maximum number
+ * of buffers they will use. If more are used, then the result will be
+ * a stack overrun
+ */
+#ifndef MAVLINK_COMM_NUM_BUFFERS
+#if (defined linux) | (defined __linux) | (defined  __MACH__) | (defined _WIN32)
+# define MAVLINK_COMM_NUM_BUFFERS 16
+#else
+# define MAVLINK_COMM_NUM_BUFFERS 4
+#endif
+#endif
+
+typedef enum {
+    MAVLINK_PARSE_STATE_UNINIT=0,
+    MAVLINK_PARSE_STATE_IDLE,
+    MAVLINK_PARSE_STATE_GOT_STX,
+    MAVLINK_PARSE_STATE_GOT_SEQ,
+    MAVLINK_PARSE_STATE_GOT_LENGTH,
+    MAVLINK_PARSE_STATE_GOT_SYSID,
+    MAVLINK_PARSE_STATE_GOT_COMPID,
+    MAVLINK_PARSE_STATE_GOT_MSGID,
+    MAVLINK_PARSE_STATE_GOT_PAYLOAD,
+    MAVLINK_PARSE_STATE_GOT_CRC1,
+    MAVLINK_PARSE_STATE_GOT_BAD_CRC1
+} mavlink_parse_state_t; ///< The state machine for the comm parser
+
+typedef enum {
+    MAVLINK_FRAMING_INCOMPLETE=0,
+    MAVLINK_FRAMING_OK=1,
+    MAVLINK_FRAMING_BAD_CRC=2
+} mavlink_framing_t;
+
+typedef struct __mavlink_status {
+    uint8_t msg_received;               ///< Number of received messages
+    uint8_t buffer_overrun;             ///< Number of buffer overruns
+    uint8_t parse_error;                ///< Number of parse errors
+    mavlink_parse_state_t parse_state;  ///< Parsing state machine
+    uint8_t packet_idx;                 ///< Index in current packet
+    uint8_t current_rx_seq;             ///< Sequence number of last packet received
+    uint8_t current_tx_seq;             ///< Sequence number of last packet sent
+    uint16_t packet_rx_success_count;   ///< Received packets
+    uint16_t packet_rx_drop_count;      ///< Number of packet drops
+} mavlink_status_t;
+
+#define MAVLINK_BIG_ENDIAN 0
+#define MAVLINK_LITTLE_ENDIAN 1
+
+#endif /* MAVLINK_TYPES_H_ */
Index: tags/latest/tools/Controller/Mavlink/src/include/protocol.h
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/include/protocol.h	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/include/protocol.h	(revision 209)
@@ -0,0 +1,339 @@
+#ifndef  _MAVLINK_PROTOCOL_H_
+#define  _MAVLINK_PROTOCOL_H_
+
+#include "string.h"
+#include "mavlink_types.h"
+
+/* 
+   If you want MAVLink on a system that is native big-endian,
+   you need to define NATIVE_BIG_ENDIAN
+*/
+#ifdef NATIVE_BIG_ENDIAN
+# define MAVLINK_NEED_BYTE_SWAP (MAVLINK_ENDIAN == MAVLINK_LITTLE_ENDIAN)
+#else
+# define MAVLINK_NEED_BYTE_SWAP (MAVLINK_ENDIAN != MAVLINK_LITTLE_ENDIAN)
+#endif
+
+#ifndef MAVLINK_STACK_BUFFER
+#define MAVLINK_STACK_BUFFER 0
+#endif
+
+#ifndef MAVLINK_AVOID_GCC_STACK_BUG
+# define MAVLINK_AVOID_GCC_STACK_BUG defined(__GNUC__)
+#endif
+
+#ifndef MAVLINK_ASSERT
+#define MAVLINK_ASSERT(x)
+#endif
+
+#ifndef MAVLINK_START_UART_SEND
+#define MAVLINK_START_UART_SEND(chan, length)
+#endif
+
+#ifndef MAVLINK_END_UART_SEND
+#define MAVLINK_END_UART_SEND(chan, length)
+#endif
+
+/* option to provide alternative implementation of mavlink_helpers.h */
+#ifdef MAVLINK_SEPARATE_HELPERS
+
+    #define MAVLINK_HELPER
+
+    /* decls in sync with those in mavlink_helpers.h */
+    #ifndef MAVLINK_GET_CHANNEL_STATUS
+    MAVLINK_HELPER mavlink_status_t* mavlink_get_channel_status(uint8_t chan);
+    #endif
+    MAVLINK_HELPER void mavlink_reset_channel_status(uint8_t chan);
+    #if MAVLINK_CRC_EXTRA
+    MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id,
+                                                          uint8_t chan, uint8_t min_length, uint8_t length, uint8_t crc_extra);
+    MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id,
+                                                     uint8_t min_length, uint8_t length, uint8_t crc_extra);
+    #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+    MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet,
+                                                        uint8_t min_length, uint8_t length, uint8_t crc_extra);
+    #endif
+    #else
+    MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id,
+                                                          uint8_t chan, uint8_t length);
+    MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id,
+                                                     uint8_t length);
+    #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+    MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length);
+    #endif
+    #endif // MAVLINK_CRC_EXTRA
+    MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg);
+    MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg);
+    MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c);
+    MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, 
+						     mavlink_status_t* status,
+						     uint8_t c, 
+						     mavlink_message_t* r_message, 
+						     mavlink_status_t* r_mavlink_status);
+    MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status);
+    MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status);
+    MAVLINK_HELPER uint8_t put_bitfield_n_by_index(int32_t b, uint8_t bits, uint8_t packet_index, uint8_t bit_index,
+                               uint8_t* r_bit_index, uint8_t* buffer);
+    #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
+    MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len);
+    MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_message_t *msg);
+    #endif
+
+#else
+
+    #define MAVLINK_HELPER static inline
+    #include "mavlink_helpers.h"
+
+#endif // MAVLINK_SEPARATE_HELPERS
+
+/**
+ * @brief Get the required buffer size for this message
+ */
+static inline uint16_t mavlink_msg_get_send_buffer_length(const mavlink_message_t* msg)
+{
+	return msg->len + MAVLINK_NUM_NON_PAYLOAD_BYTES;
+}
+
+#if MAVLINK_NEED_BYTE_SWAP
+static inline void byte_swap_2(char *dst, const char *src)
+{
+	dst[0] = src[1];
+	dst[1] = src[0];
+}
+static inline void byte_swap_4(char *dst, const char *src)
+{
+	dst[0] = src[3];
+	dst[1] = src[2];
+	dst[2] = src[1];
+	dst[3] = src[0];
+}
+static inline void byte_swap_8(char *dst, const char *src)
+{
+	dst[0] = src[7];
+	dst[1] = src[6];
+	dst[2] = src[5];
+	dst[3] = src[4];
+	dst[4] = src[3];
+	dst[5] = src[2];
+	dst[6] = src[1];
+	dst[7] = src[0];
+}
+#elif !MAVLINK_ALIGNED_FIELDS
+static inline void byte_copy_2(char *dst, const char *src)
+{
+	dst[0] = src[0];
+	dst[1] = src[1];
+}
+static inline void byte_copy_4(char *dst, const char *src)
+{
+	dst[0] = src[0];
+	dst[1] = src[1];
+	dst[2] = src[2];
+	dst[3] = src[3];
+}
+static inline void byte_copy_8(char *dst, const char *src)
+{
+	memcpy(dst, src, 8);
+}
+#endif
+
+#define _mav_put_uint8_t(buf, wire_offset, b) buf[wire_offset] = (uint8_t)b
+#define _mav_put_int8_t(buf, wire_offset, b)  buf[wire_offset] = (int8_t)b
+#define _mav_put_char(buf, wire_offset, b)    buf[wire_offset] = b
+
+#if MAVLINK_NEED_BYTE_SWAP
+#define _mav_put_uint16_t(buf, wire_offset, b) byte_swap_2(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int16_t(buf, wire_offset, b)  byte_swap_2(&buf[wire_offset], (const char *)&b)
+#define _mav_put_uint32_t(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int32_t(buf, wire_offset, b)  byte_swap_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_uint64_t(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int64_t(buf, wire_offset, b)  byte_swap_8(&buf[wire_offset], (const char *)&b)
+#define _mav_put_float(buf, wire_offset, b)    byte_swap_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_double(buf, wire_offset, b)   byte_swap_8(&buf[wire_offset], (const char *)&b)
+#elif !MAVLINK_ALIGNED_FIELDS
+#define _mav_put_uint16_t(buf, wire_offset, b) byte_copy_2(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int16_t(buf, wire_offset, b)  byte_copy_2(&buf[wire_offset], (const char *)&b)
+#define _mav_put_uint32_t(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int32_t(buf, wire_offset, b)  byte_copy_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_uint64_t(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b)
+#define _mav_put_int64_t(buf, wire_offset, b)  byte_copy_8(&buf[wire_offset], (const char *)&b)
+#define _mav_put_float(buf, wire_offset, b)    byte_copy_4(&buf[wire_offset], (const char *)&b)
+#define _mav_put_double(buf, wire_offset, b)   byte_copy_8(&buf[wire_offset], (const char *)&b)
+#else
+#define _mav_put_uint16_t(buf, wire_offset, b) *(uint16_t *)&buf[wire_offset] = b
+#define _mav_put_int16_t(buf, wire_offset, b)  *(int16_t *)&buf[wire_offset] = b
+#define _mav_put_uint32_t(buf, wire_offset, b) *(uint32_t *)&buf[wire_offset] = b
+#define _mav_put_int32_t(buf, wire_offset, b)  *(int32_t *)&buf[wire_offset] = b
+#define _mav_put_uint64_t(buf, wire_offset, b) *(uint64_t *)&buf[wire_offset] = b
+#define _mav_put_int64_t(buf, wire_offset, b)  *(int64_t *)&buf[wire_offset] = b
+#define _mav_put_float(buf, wire_offset, b)    *(float *)&buf[wire_offset] = b
+#define _mav_put_double(buf, wire_offset, b)   *(double *)&buf[wire_offset] = b
+#endif
+
+/*
+  like memcpy(), but if src is NULL, do a memset to zero
+*/
+static inline void mav_array_memcpy(void *dest, const void *src, size_t n)
+{
+	if (src == NULL) {
+		memset(dest, 0, n);
+	} else {
+		memcpy(dest, src, n);
+	}
+}
+
+/*
+ * Place a char array into a buffer
+ */
+static inline void _mav_put_char_array(char *buf, uint8_t wire_offset, const char *b, uint8_t array_length)
+{
+	mav_array_memcpy(&buf[wire_offset], b, array_length);
+
+}
+
+/*
+ * Place a uint8_t array into a buffer
+ */
+static inline void _mav_put_uint8_t_array(char *buf, uint8_t wire_offset, const uint8_t *b, uint8_t array_length)
+{
+	mav_array_memcpy(&buf[wire_offset], b, array_length);
+
+}
+
+/*
+ * Place a int8_t array into a buffer
+ */
+static inline void _mav_put_int8_t_array(char *buf, uint8_t wire_offset, const int8_t *b, uint8_t array_length)
+{
+	mav_array_memcpy(&buf[wire_offset], b, array_length);
+
+}
+
+#if MAVLINK_NEED_BYTE_SWAP
+#define _MAV_PUT_ARRAY(TYPE, V) \
+static inline void _mav_put_ ## TYPE ##_array(char *buf, uint8_t wire_offset, const TYPE *b, uint8_t array_length) \
+{ \
+	if (b == NULL) { \
+		memset(&buf[wire_offset], 0, array_length*sizeof(TYPE)); \
+	} else { \
+		uint16_t i; \
+		for (i=0; i<array_length; i++) { \
+			_mav_put_## TYPE (buf, wire_offset+(i*sizeof(TYPE)), b[i]); \
+		} \
+	} \
+}
+#else
+#define _MAV_PUT_ARRAY(TYPE, V)					\
+static inline void _mav_put_ ## TYPE ##_array(char *buf, uint8_t wire_offset, const TYPE *b, uint8_t array_length) \
+{ \
+	mav_array_memcpy(&buf[wire_offset], b, array_length*sizeof(TYPE)); \
+}
+#endif
+
+_MAV_PUT_ARRAY(uint16_t, u16)
+_MAV_PUT_ARRAY(uint32_t, u32)
+_MAV_PUT_ARRAY(uint64_t, u64)
+_MAV_PUT_ARRAY(int16_t,  i16)
+_MAV_PUT_ARRAY(int32_t,  i32)
+_MAV_PUT_ARRAY(int64_t,  i64)
+_MAV_PUT_ARRAY(float,    f)
+_MAV_PUT_ARRAY(double,   d)
+
+#define _MAV_RETURN_char(msg, wire_offset)             (const char)_MAV_PAYLOAD(msg)[wire_offset]
+#define _MAV_RETURN_int8_t(msg, wire_offset)   (const int8_t)_MAV_PAYLOAD(msg)[wire_offset]
+#define _MAV_RETURN_uint8_t(msg, wire_offset) (const uint8_t)_MAV_PAYLOAD(msg)[wire_offset]
+
+#if MAVLINK_NEED_BYTE_SWAP
+#define _MAV_MSG_RETURN_TYPE(TYPE, SIZE) \
+static inline TYPE _MAV_RETURN_## TYPE(const mavlink_message_t *msg, uint8_t ofs) \
+{ TYPE r; byte_swap_## SIZE((char*)&r, &_MAV_PAYLOAD(msg)[ofs]); return r; }
+
+_MAV_MSG_RETURN_TYPE(uint16_t, 2)
+_MAV_MSG_RETURN_TYPE(int16_t,  2)
+_MAV_MSG_RETURN_TYPE(uint32_t, 4)
+_MAV_MSG_RETURN_TYPE(int32_t,  4)
+_MAV_MSG_RETURN_TYPE(uint64_t, 8)
+_MAV_MSG_RETURN_TYPE(int64_t,  8)
+_MAV_MSG_RETURN_TYPE(float,    4)
+_MAV_MSG_RETURN_TYPE(double,   8)
+
+#elif !MAVLINK_ALIGNED_FIELDS
+#define _MAV_MSG_RETURN_TYPE(TYPE, SIZE) \
+static inline TYPE _MAV_RETURN_## TYPE(const mavlink_message_t *msg, uint8_t ofs) \
+{ TYPE r; byte_copy_## SIZE((char*)&r, &_MAV_PAYLOAD(msg)[ofs]); return r; }
+
+_MAV_MSG_RETURN_TYPE(uint16_t, 2)
+_MAV_MSG_RETURN_TYPE(int16_t,  2)
+_MAV_MSG_RETURN_TYPE(uint32_t, 4)
+_MAV_MSG_RETURN_TYPE(int32_t,  4)
+_MAV_MSG_RETURN_TYPE(uint64_t, 8)
+_MAV_MSG_RETURN_TYPE(int64_t,  8)
+_MAV_MSG_RETURN_TYPE(float,    4)
+_MAV_MSG_RETURN_TYPE(double,   8)
+#else // nicely aligned, no swap
+#define _MAV_MSG_RETURN_TYPE(TYPE) \
+static inline TYPE _MAV_RETURN_## TYPE(const mavlink_message_t *msg, uint8_t ofs) \
+{ return *(const TYPE *)(&_MAV_PAYLOAD(msg)[ofs]);}
+
+_MAV_MSG_RETURN_TYPE(uint16_t)
+_MAV_MSG_RETURN_TYPE(int16_t)
+_MAV_MSG_RETURN_TYPE(uint32_t)
+_MAV_MSG_RETURN_TYPE(int32_t)
+_MAV_MSG_RETURN_TYPE(uint64_t)
+_MAV_MSG_RETURN_TYPE(int64_t)
+_MAV_MSG_RETURN_TYPE(float)
+_MAV_MSG_RETURN_TYPE(double)
+#endif // MAVLINK_NEED_BYTE_SWAP
+
+static inline uint16_t _MAV_RETURN_char_array(const mavlink_message_t *msg, char *value, 
+						     uint8_t array_length, uint8_t wire_offset)
+{
+	memcpy(value, &_MAV_PAYLOAD(msg)[wire_offset], array_length);
+	return array_length;
+}
+
+static inline uint16_t _MAV_RETURN_uint8_t_array(const mavlink_message_t *msg, uint8_t *value, 
+							uint8_t array_length, uint8_t wire_offset)
+{
+	memcpy(value, &_MAV_PAYLOAD(msg)[wire_offset], array_length);
+	return array_length;
+}
+
+static inline uint16_t _MAV_RETURN_int8_t_array(const mavlink_message_t *msg, int8_t *value, 
+						       uint8_t array_length, uint8_t wire_offset)
+{
+	memcpy(value, &_MAV_PAYLOAD(msg)[wire_offset], array_length);
+	return array_length;
+}
+
+#if MAVLINK_NEED_BYTE_SWAP
+#define _MAV_RETURN_ARRAY(TYPE, V) \
+static inline uint16_t _MAV_RETURN_## TYPE ##_array(const mavlink_message_t *msg, TYPE *value, \
+							 uint8_t array_length, uint8_t wire_offset) \
+{ \
+	uint16_t i; \
+	for (i=0; i<array_length; i++) { \
+		value[i] = _MAV_RETURN_## TYPE (msg, wire_offset+(i*sizeof(value[0]))); \
+	} \
+	return array_length*sizeof(value[0]); \
+}
+#else
+#define _MAV_RETURN_ARRAY(TYPE, V)					\
+static inline uint16_t _MAV_RETURN_## TYPE ##_array(const mavlink_message_t *msg, TYPE *value, \
+							 uint8_t array_length, uint8_t wire_offset) \
+{ \
+	memcpy(value, &_MAV_PAYLOAD(msg)[wire_offset], array_length*sizeof(TYPE)); \
+	return array_length*sizeof(TYPE); \
+}
+#endif
+
+_MAV_RETURN_ARRAY(uint16_t, u16)
+_MAV_RETURN_ARRAY(uint32_t, u32)
+_MAV_RETURN_ARRAY(uint64_t, u64)
+_MAV_RETURN_ARRAY(int16_t,  i16)
+_MAV_RETURN_ARRAY(int32_t,  i32)
+_MAV_RETURN_ARRAY(int64_t,  i64)
+_MAV_RETURN_ARRAY(float,    f)
+_MAV_RETURN_ARRAY(double,   d)
+
+#endif // _MAVLINK_PROTOCOL_H_
Index: tags/latest/tools/Controller/Mavlink/src/main.cpp
===================================================================
--- tags/latest/tools/Controller/Mavlink/src/main.cpp	(revision 209)
+++ tags/latest/tools/Controller/Mavlink/src/main.cpp	(revision 209)
@@ -0,0 +1,146 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/07/05
+//  filename:   main.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    main for the mavlink controller
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager.h"
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+
+#include "GuiFlair.h"
+#include "GuiGcs.h"
+#include "Forwarder.h"
+
+//todo remove for tests
+#include <iostream>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+
+string xmlFile;
+string mode;
+string inputAddress;
+int inputPort;
+string outputAddress;
+int outputPort;
+string flairAddress;
+int flairPort;
+
+void parseOptions(int argc, char **argv);
+
+int main(int argc, char *argv[]) {
+  std::cout << "avant parseOptions" << std::endl;
+  parseOptions(argc, argv);
+
+  std::cout << "parseOptions ok" << std::endl;
+
+  FrameworkManager *manager;
+  manager = new FrameworkManager("MavPlanner");
+  manager->SetupConnection(flairAddress, flairPort);
+  manager->SetupUserInterface(xmlFile);
+
+  std::cout << "MavPlanner mode : " << mode << std::endl;
+
+  if(mode == "forward") {
+    Forwarder *guiForwarder = new Forwarder("Forwarder",
+                                           inputAddress, inputPort,
+                                           outputAddress, outputPort);
+    if (!manager->ErrorOccured()) {
+      guiForwarder->Start();
+      guiForwarder->Join();
+    }
+  } else {
+    GuiInterface *guiHandler;
+    if(mode == "flair") {
+      guiHandler = new GuiFlair("GuiFlair");
+    } else if (mode == "gcs") {
+      guiHandler = new GuiGcs("GuiGcs", outputAddress, outputPort);
+    } else {
+      //ERROR
+    }
+    if (!manager->ErrorOccured()) {
+      guiHandler->Start();
+      guiHandler->Join();
+    }
+  }
+
+  delete manager;
+}
+
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> inputAddressArg("", "inputAddress",
+                                "input IP address", false,
+                                "127.0.0.1", "string");
+    cmd.add(inputAddressArg);
+
+    ValueArg<int> inputPortArg("", "inputPort",
+                          "input IP port", false,
+                          9000, "int");
+    cmd.add(inputPortArg);
+
+    ValueArg<string> outputAddressArg("", "outputAddress",
+                                      "output IP address", false,
+                                      "127.0.0.1", "string");
+    cmd.add(outputAddressArg);
+
+    ValueArg<int> outputPortArg("", "outputPort",
+                               "output IP port", false,
+                               9000, "int");
+    cmd.add(outputPortArg);
+
+    ValueArg<string> flairAddressArg("a", "flairAddress",
+                                      "flair IP address", true,
+                                      "127.0.0.1", "string");
+    cmd.add(flairAddressArg);
+
+    ValueArg<int> flairPortArg("p", "flairPort",
+                               "flair IP port", true,
+                               9000, "int");
+    cmd.add(flairPortArg);
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml",
+                            "string");
+    cmd.add(xmlArg);
+
+    ValueArg<string> modeArg("m", "mode", "application mode (forward, flair, gcs)",
+                             true, "flair", "string");
+    cmd.add(modeArg);
+
+    cmd.parse(argc, argv);
+
+    // string receiverAddressWithPort = inputAddressArg.getValue();
+    // int semiColonPosition = receiverAddressWithPort.find(":");
+    // receiverAddress = receiverAddressWithPort.substr(0, semiColonPosition);
+    // receiverPort =
+    //     atoi(receiverAddressWithPort.substr(semiColonPosition + 1).c_str());
+    
+    // Get the value parsed by each arg.
+    inputAddress = inputAddressArg.getValue();
+    inputPort = inputPortArg.getValue();
+    outputAddress = outputAddressArg.getValue();
+    outputPort = outputPortArg.getValue();
+    flairAddress = flairAddressArg.getValue();
+    flairPort = flairPortArg.getValue();
+    xmlFile = xmlArg.getValue();
+    mode = modeArg.getValue();
+
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
Index: tags/latest/tools/Dbt2csv/CMakeLists.txt
===================================================================
--- tags/latest/tools/Dbt2csv/CMakeLists.txt	(revision 209)
+++ tags/latest/tools/Dbt2csv/CMakeLists.txt	(revision 209)
@@ -0,0 +1,54 @@
+PROJECT(dbt2csv)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+
+SET(PROJECT_SOURCE_FILES
+	src/main.cpp
+	../FlairGCS/src/file_ui.cpp
+)
+
+SET(FILES_TO_MOC
+	../FlairGCS/src/file_ui.h
+)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+SET(QT_USE_QTGUI TRUE)
+SET(QT_USE_QTMAIN TRUE)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_CPP(MOC_SOURCES ${FILES_TO_MOC})
+
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+
+include_directories(
+	${CMAKE_SOURCE_DIR}/src
+	../FlairGCS/src/
+	${QT_INCLUDE_DIR}
+)
+
+LINK_DIRECTORIES (
+	${QT_LIBRARY_DIR}
+)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} FileLib)
+
+INSTALL(
+	TARGETS ${PROJECT_NAME}
+	RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
+)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+else()
+warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
+endif()
Index: tags/latest/tools/Dbt2csv/src/main.cpp
===================================================================
--- tags/latest/tools/Dbt2csv/src/main.cpp	(revision 209)
+++ tags/latest/tools/Dbt2csv/src/main.cpp	(revision 209)
@@ -0,0 +1,32 @@
+#include <QApplication>
+#include <QCleanlooksStyle>
+#include <QLocale>
+
+#include <stdio.h>
+#include "unexported/compile_info.h"
+#include "file_ui.h"
+#include <QFileDialog>
+
+int main(int argc, char *argv[]) {
+  compile_info("Dbt2Csv");
+
+  QLocale::setDefault(QLocale::C);
+  QApplication app(argc, argv);
+  app.setStyle(new QCleanlooksStyle);
+
+  file_ui *files = new file_ui();
+  files->connect(files, SIGNAL(finished()), &app, SLOT(quit()));
+
+  QString path = QFileDialog::getExistingDirectory(new QWidget(),
+                                                   "Select a directory", 0, 0);
+  QDir directory(path);
+  QStringList list_files = directory.entryList();
+
+  for (int i = 0; i < list_files.size(); i++) {
+    files->addFile(directory.path() + "/" + list_files.at(i));
+  }
+
+  files->endOfFiles();
+
+  app.exec();
+}
Index: tags/latest/tools/FlairGCS/CMakeLists.txt
===================================================================
--- tags/latest/tools/FlairGCS/CMakeLists.txt	(revision 209)
+++ tags/latest/tools/FlairGCS/CMakeLists.txt	(revision 209)
@@ -0,0 +1,92 @@
+PROJECT(flairgcs)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+FILE(GLOB PROJECT_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+SET(FILES_TO_MOC
+	src/UdtSocket.h
+	src/RangeFinderPlot.h
+	src/DataPlot2D.h
+	src/Picture.h
+	src/Manager.h
+	src/file_ui.h
+	src/Vector3DSpinBox.h
+	src/DoubleSpinBox.h
+	src/SpinBox.h
+	src/CheckBox.h
+	src/ComboBox.h
+	src/PushButton.h
+	src/mapwidget.h
+	src/Map.h
+	src/XmlWidget.h
+	src/ConnectionLayout.h
+	src/ListWidget.h
+)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+SET(QT_USE_QTGUI TRUE)
+SET(QT_USE_QTMAIN TRUE)
+SET(QT_USE_QTXML TRUE)
+SET(QT_USE_QTNETWORK TRUE)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_CPP(MOC_SOURCES ${FILES_TO_MOC})
+
+# generate rules for building source files from the resources
+QT4_ADD_RESOURCES(RCC_SOURCES "src/ressources.qrc")
+
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(-DQT_THREAD_SUPPORT -DQT_NO_DEBUG)
+
+include_directories(
+	${CMAKE_SOURCE_DIR}/src
+	${CMAKE_SOURCE_DIR}/../../lib/FlairCore/src/unexported
+	${QT_INCLUDE_DIR}
+	${CMAKE_SYSROOT}/usr/include/udt
+	${CMAKE_SYSROOT}/usr/include/qwt
+	${CMAKE_SYSROOT}/usr/include/QwtDataViewer
+	${CMAKE_SYSROOT}/usr/include/qt4/QtMobility
+	${CMAKE_SYSROOT}/usr/include/qt4/QtLocation
+)
+
+LINK_DIRECTORIES (
+	${QT_LIBRARY_DIR}
+)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} GL qwt QwtDataViewer udt QtLocation FileLib z)
+
+INSTALL(
+	TARGETS ${PROJECT_NAME}
+	RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
+)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
+
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+else()
+warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
+endif()
Index: tags/latest/tools/FlairGCS/src/CheckBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/CheckBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/CheckBox.cpp	(revision 209)
@@ -0,0 +1,64 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "CheckBox.h"
+#include "Layout.h"
+#include <QCheckBox>
+#include <QFormLayout>
+
+CheckBox::CheckBox(Layout *parent, int row, int col, QString name, bool value)
+    : FormLayout(parent, row, col, name, "CheckBox") {
+  checkbox = new QCheckBox();
+  checkbox->setChecked(value);
+
+  checkbox_value = value;
+
+  object_layout->addRow(name, checkbox);
+
+  connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(valuechanged(bool)));
+
+  if (checkbox_value == true) {
+    SetValue("1");
+  } else {
+    SetValue("0");
+  }
+}
+
+CheckBox::~CheckBox() { delete checkbox; }
+
+void CheckBox::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  visible_widget->setPalette(black_pal);
+}
+
+void CheckBox::ui_to_var(void) { checkbox_value = checkbox->isChecked(); }
+
+void CheckBox::ui_to_xml(void) {
+  if (checkbox->isChecked() == true) {
+    SetValue("1");
+  } else {
+    SetValue("0");
+  }
+}
+
+void CheckBox::Reset(void) { checkbox->setChecked(checkbox_value); }
+
+void CheckBox::LoadEvent(QDomElement dom) {
+  if (checkbox->isEnabled() == true) {
+    if (dom.attribute("value") == QString("1")) {
+      checkbox->setChecked(true);
+    } else {
+      checkbox->setChecked(false);
+    }
+  }
+}
+
+void CheckBox::valuechanged(bool value) {
+  if (value != checkbox_value) {
+    visible_widget->setPalette(red_pal);
+  } else {
+    visible_widget->setPalette(black_pal);
+  }
+}
Index: tags/latest/tools/FlairGCS/src/CheckBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/CheckBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/CheckBox.h	(revision 209)
@@ -0,0 +1,34 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef CHECKBOX_H
+#define CHECKBOX_H
+
+#include "FormLayout.h"
+
+class Layout;
+class QCheckBox;
+
+class CheckBox : public FormLayout {
+  Q_OBJECT
+
+public:
+  CheckBox(Layout *parent, int row, int col, QString name, bool value);
+  ~CheckBox();
+
+private:
+  QCheckBox *checkbox;
+  bool checkbox_value;
+  void SetUptodate(void);
+  void Reset(void);
+  void LoadEvent(QDomElement dom);
+
+  void ui_to_var(void);
+  void ui_to_xml(void);
+
+private slots:
+  void valuechanged(bool value);
+};
+
+#endif // CHECKBOX_H
Index: tags/latest/tools/FlairGCS/src/ComboBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/ComboBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ComboBox.cpp	(revision 209)
@@ -0,0 +1,64 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "ComboBox.h"
+#include "Layout.h"
+#include <QComboBox>
+#include <QFormLayout>
+
+ComboBox::ComboBox(Layout *parent, int row, int col, QString name, int value)
+    : FormLayout(parent, row, col, name, "ComboBox") {
+  combobox = new QComboBox();
+  combobox->setCurrentIndex(value);
+
+  combobox_value = value;
+
+  object_layout->addRow(name, combobox);
+
+  connect(combobox, SIGNAL(currentIndexChanged(int)), this,
+          SLOT(valuechanged(int)));
+
+  SetValue(QString::number(combobox_value));
+
+  // pour ne pas faire de doublons qd on ajoute des items
+  SetIsExpandable(true);
+}
+
+ComboBox::~ComboBox() { delete combobox; }
+
+void ComboBox::XmlEvent(QDomElement dom) {
+  if (dom.attribute("item") != "") {
+    QString item = dom.attribute("item");
+    combobox->addItem(item);
+    combobox->setCurrentIndex(combobox_value);
+  }
+}
+
+void ComboBox::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  visible_widget->setPalette(black_pal);
+}
+
+void ComboBox::ui_to_var(void) { combobox_value = combobox->currentIndex(); }
+
+void ComboBox::ui_to_xml(void) {
+  SetValue(QString::number(combobox->currentIndex()));
+}
+
+void ComboBox::Reset(void) { combobox->setCurrentIndex(combobox_value); }
+
+void ComboBox::LoadEvent(QDomElement dom) {
+  if (combobox->isEnabled() == true) {
+    combobox->setCurrentIndex((dom.attribute("value")).toInt());
+  }
+}
+
+void ComboBox::valuechanged(int value) {
+  if (value != combobox_value) {
+    visible_widget->setPalette(red_pal);
+  } else {
+    visible_widget->setPalette(black_pal);
+  }
+}
Index: tags/latest/tools/FlairGCS/src/ComboBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/ComboBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ComboBox.h	(revision 209)
@@ -0,0 +1,35 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef COMBOBOX_H
+#define COMBOBOX_H
+
+#include "FormLayout.h"
+
+class QComboBox;
+class Layout;
+
+class ComboBox : public FormLayout {
+  Q_OBJECT
+
+public:
+  ComboBox(Layout *parent, int row, int col, QString name, int value);
+  ~ComboBox();
+
+private:
+  QComboBox *combobox;
+  int combobox_value;
+  void XmlEvent(QDomElement dom);
+  void SetUptodate(void);
+  void Reset(void);
+  void LoadEvent(QDomElement dom);
+
+  void ui_to_var(void);
+  void ui_to_xml(void);
+
+private slots:
+  void valuechanged(int value);
+};
+
+#endif // COMBOBOX_H
Index: tags/latest/tools/FlairGCS/src/ConnectionLayout.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/ConnectionLayout.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ConnectionLayout.cpp	(revision 209)
@@ -0,0 +1,188 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "ConnectionLayout.h"
+#include "UdtSocket.h"
+#include "DataRemote.h"
+#include <qendian.h>
+#include "communication.h"
+#include <zlib.h>
+#include <assert.h>
+
+#define COMPRESS_CHUNK 1024
+#define RX_TIME 5000
+
+ConnectionLayout::ConnectionLayout(UdtSocket *socket, QString name)
+    : Layout(NULL, name, "root") {
+  isRemoteNameDefined = false;
+  this->socket = socket;
+
+  total_received=0;
+  receive_timer = new QTimer(this);
+  connect(receive_timer, SIGNAL(timeout()), this, SLOT(computeRxRate()));
+  receive_timer->start(RX_TIME);
+}
+
+ConnectionLayout::~ConnectionLayout() {
+  receive_timer->stop();
+}
+
+void ConnectionLayout::computeRxRate(void) {
+  float receive_rate=((float)total_received/(RX_TIME/1000))/1000;//in Ko/s
+  total_received=0;
+  computedRxRate(receive_rate);
+}
+
+void ConnectionLayout::receive(char *buf, int size) {
+  total_received+=size-1;
+  // printf("trame %x\n",buf[0]);
+  // for(int i=0; i<size;i++) printf("%x ",buf[i]);
+  // printf("\n");
+  switch (buf[0]) {
+  case ZLIB_HEADER: {
+    ssize_t out_size;
+    char *uncompressbuf;
+    uncompressBuffer(buf, size, &uncompressbuf, &out_size);
+    handleUncompressedFrame(uncompressbuf, out_size);
+    free(uncompressbuf);
+    break;
+  }
+  default:
+    handleUncompressedFrame(buf, size);
+  }
+  free(buf);
+}
+
+void ConnectionLayout::XmlToSend(QDomDocument doc) {
+  // printf("xml to send\n%s\n",doc.toString().toLocal8Bit().constData());
+  // xml to send a mettre dans le manager
+  QMetaObject::invokeMethod(
+      socket, "write", Qt::BlockingQueuedConnection,
+      Q_ARG(const char *, doc.toString().toLocal8Bit().constData()),
+      Q_ARG(qint64, doc.toString().toLocal8Bit().length()));
+}
+
+void ConnectionLayout::LoadXml(QDomDocument to_parse) {
+  if (!isRemoteNameDefined) {
+    printf("load xml: name not defined!\n");
+    return;
+  }
+
+  QDomElement tmp = to_parse.firstChildElement("root");
+  while (tmp.attribute("name") != remoteName && !tmp.isNull())
+    tmp = to_parse.nextSiblingElement("root");
+
+  if (!tmp.isNull()) {
+    XmlWidget::LoadXml(tmp);
+  } else {
+    printf("%s not found in xml file \n", remoteName.toLocal8Bit().constData());
+  }
+}
+
+void ConnectionLayout::handleUncompressedFrame(char *buf, ssize_t size) {
+  switch ((unsigned char)buf[0]) {
+  case XML_HEADER: {
+    QString xml;
+    QDomDocument doc;
+    xml = QString((char *)buf);
+    xml.resize(size);
+
+    // printf("recu %i\n%s\n",size,xml.toLocal8Bit().constData());
+    if (!doc.setContent(xml)) {
+      printf("prob setContent fichier\n");
+    }
+
+    if (!isRemoteNameDefined) {
+      isRemoteNameDefined = true;
+      remoteName = doc.firstChildElement("root").attribute("name");
+      setRemoteName(remoteName);
+      SetAttribute("name", remoteName);
+    }
+
+    ParseXml(doc.firstChildElement("root").firstChildElement());
+    break;
+  }
+  case DATAS_BIG_ENDIAN: {
+    // for(int i=0;i<size;i++) printf("%x ",buf[i]);
+    // printf("\n");
+    uint16_t period;
+    memcpy(&period, &buf[1], sizeof(uint16_t));
+    period = qFromBigEndian(period);
+    drawDatas(&buf[3], size - 3, period, true);
+    break;
+  }
+  case DATAS_LITTLE_ENDIAN: {
+    // for(int i=0;i<size;i++) printf("%x ",buf[i]);
+    // printf("\n");
+    uint16_t period;
+    memcpy(&period, &buf[1], sizeof(uint16_t));
+    // printf("recu %i period %i\n",size,period);
+    drawDatas(&buf[3], size - 3, period);
+    break;
+  }
+  default:
+    printf("trame non supportée %x\n", buf[0]);
+  }
+}
+
+void ConnectionLayout::removeDataRemote(DataRemote *data) {
+  dataremotes.removeOne(data);
+}
+
+void ConnectionLayout::addDataRemote(DataRemote *data) {
+  dataremotes.append(data);
+}
+
+QString ConnectionLayout::getRemoteName() { return remoteName; }
+void ConnectionLayout::drawDatas(char *buf, int buf_size, uint16_t period,
+                                 bool big_endian) {
+  for (int i = 0; i < dataremotes.count(); i++) {
+    dataremotes.at(i)->BufEvent(&buf, &buf_size, period, big_endian);
+  }
+}
+
+int ConnectionLayout::uncompressBuffer(char *in, ssize_t in_size, char **out,
+                                       ssize_t *out_size) {
+  int ret;
+  unsigned have;
+  z_stream strm;
+
+  // allocate inflate state
+  strm.zalloc = Z_NULL;
+  strm.zfree = Z_NULL;
+  strm.opaque = Z_NULL;
+  strm.avail_in = 0;
+  strm.next_in = Z_NULL;
+  ret = inflateInit(&strm);
+  if (ret != Z_OK)
+    return ret;
+
+  *out = (char *)malloc(COMPRESS_CHUNK);
+  if (!(*out))
+    return Z_BUF_ERROR;
+
+  strm.avail_in = in_size;
+  strm.next_in = (unsigned char *)in;
+  strm.avail_out = COMPRESS_CHUNK;
+  strm.next_out = (unsigned char *)*out;
+
+  ret = inflate(&strm, Z_NO_FLUSH);
+  assert(ret != Z_STREAM_ERROR); // state not clobbered
+  switch (ret) {
+  case Z_NEED_DICT:
+    ret = Z_DATA_ERROR; // and fall through
+  case Z_DATA_ERROR:
+  case Z_MEM_ERROR:
+    (void)inflateEnd(&strm);
+    return ret;
+  }
+  have = COMPRESS_CHUNK - strm.avail_out;
+  *out_size = have;
+
+  // printf("%i -> %i\n",in_size,have);
+  // printf("%s\n",*out);
+  // clean up and return
+  (void)inflateEnd(&strm);
+  return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
+}
Index: tags/latest/tools/FlairGCS/src/ConnectionLayout.h
===================================================================
--- tags/latest/tools/FlairGCS/src/ConnectionLayout.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ConnectionLayout.h	(revision 209)
@@ -0,0 +1,48 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef CONNECTIONLAYOUT_H
+#define CONNECTIONLAYOUT_H
+
+#include <QTimer>
+#include "Layout.h"
+
+class UdtSocket;
+class DataRemote;
+
+class ConnectionLayout : public Layout {
+  Q_OBJECT
+
+public:
+  ConnectionLayout(UdtSocket *socket, QString name);
+  ~ConnectionLayout();
+  void XmlToSend(QDomDocument doc);
+  void addDataRemote(DataRemote *data);
+  void removeDataRemote(DataRemote *data);
+  void LoadXml(QDomDocument to_parse);
+  QString getRemoteName();
+
+private:
+  static int uncompressBuffer(char *in, ssize_t in_size, char **out,
+                              ssize_t *out_size);
+  void handleUncompressedFrame(char *buf, ssize_t size);
+  void drawDatas(char *buf, int buf_size, uint16_t period,
+                 bool big_endian = false);
+  bool isRemoteNameDefined;
+  QString remoteName;
+  UdtSocket *socket;
+  QList<DataRemote *> dataremotes;
+  unsigned int total_received;
+  QTimer *receive_timer;
+
+private slots:
+  void receive(char *buf, int size);
+  void computeRxRate(void);
+
+signals:
+  void setRemoteName(QString name);
+  void computedRxRate(float rxRate);
+};
+
+#endif // CONNECTIONLAYOUT_H
Index: tags/latest/tools/FlairGCS/src/DataPlot1D.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/DataPlot1D.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataPlot1D.cpp	(revision 209)
@@ -0,0 +1,130 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "DataPlot1D.h"
+#include "Layout.h"
+#include <QMouseEvent>
+#include <QMenu>
+#include <QGridLayout>
+#include <qendian.h>
+
+DataPlot1D::DataPlot1D(Layout *parent, int row, int col, QString title,
+                       float ymin, float ymax, bool enabled, int period)
+    : ScopeFixedStep(title, ymin, ymax, period / 1000.),
+      DataRemote(title, "DataPlot1D", parent, enabled, period) {
+
+  setEnabled(enabled);
+  parent->addWidget(this, row, col);
+  visible_widget = this;
+}
+
+DataPlot1D::~DataPlot1D() {
+  visible_widget = NULL; // because otherwise xmlwidget will delete it
+}
+
+void DataPlot1D::XmlEvent(QDomElement dom) {
+  if (dom.attribute("curve") != "") {
+    QString type = dom.attribute("type");
+    int r = dom.attribute("r").toInt();
+    int g = dom.attribute("g").toInt();
+    int b = dom.attribute("b").toInt();
+    QString name = dom.attribute("curve");
+    addCurve(QPen(QColor(r, g, b, 255)), name);
+    datas_type.append(type);
+    if (type == "float") {
+      receivesize += sizeof(float);
+    } else if (type == "int8_t") {
+      receivesize += sizeof(int8_t);
+    } else if (type == "int16_t") {
+      receivesize += sizeof(int16_t);
+    } else {
+      printf("MyDataPlot1D::addCurve unknown type %s\n",
+             type.toLocal8Bit().constData());
+    }
+  } else {
+    XmlSetup(dom);
+  }
+}
+
+bool DataPlot1D::eventFilter(QObject *o, QEvent *e) {
+  if (o == canvas()) {
+    switch (e->type()) {
+    case QEvent::Resize: {
+      // resolution bug taille widgets:
+      setMaximumHeight(parentWidget()->height() /
+                       ((QGridLayout *)(parentWidget()->layout()))->rowCount());
+      break;
+    }
+    case QEvent::MouseButtonPress: {
+      return mouseEvent((QMouseEvent *)e);
+    }
+
+    default:
+      break;
+    }
+  }
+  return Scope::eventFilter(o, e);
+}
+
+void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,
+                          bool big_endian) {
+  setEnabled(IsEnabled());
+  if (IsEnabled() == false || RefreshRate_ms() != period)
+    return;
+  double *datas = (double *)malloc(datas_type.count() * sizeof(double));
+
+  for (int i = 0; i < datas_type.count(); i++) {
+    if (datas_type.at(i) == "float") {
+      uint32_t data_raw;
+      float *data = (float *)&data_raw;
+      memcpy((void *)&data_raw, *buf, sizeof(uint32_t));
+      *buf += sizeof(uint32_t);
+      if (big_endian == true)
+        data_raw = qFromBigEndian(data_raw);
+      datas[i] = *data;
+    } else if (datas_type.at(i) == "int8_t") {
+      int8_t data;
+      memcpy((void *)&data, *buf, sizeof(data));
+      *buf += sizeof(data);
+      datas[i] = data;
+    } else if (datas_type.at(i) == "int16_t") {
+      int16_t data;
+      memcpy((void *)&data, *buf, sizeof(data));
+      *buf += sizeof(data);
+      if (big_endian == true)
+        data = qFromBigEndian(data);
+      datas[i] = data;
+    } else {
+      printf("DataPlot1D::BufEvent unknown type %s\n",
+             datas_type.at(i).toLocal8Bit().constData());
+    }
+  }
+
+  step_s = period / 1000.;
+  plot(datas);
+}
+
+// context menu
+bool DataPlot1D::mouseEvent(QMouseEvent *event) {
+  if (event->button() == Qt::RightButton) {
+    QMenu *menu = new QMenu("nom", (QwtPlot *)this);
+    QAction *a, *b, *z;
+
+    a = menu->addAction("reset time view");
+    b = menu->addAction("reset y view");
+    menu->addSeparator();
+
+    appendmenu(menu);
+    z = execmenu((QwtPlot *)this, menu, event->globalPos());
+    delete menu;
+
+    if (z == a)
+      resetXView();
+    if (z == b)
+      resetYView();
+
+    return true;
+  }
+  return false;
+}
Index: tags/latest/tools/FlairGCS/src/DataPlot1D.h
===================================================================
--- tags/latest/tools/FlairGCS/src/DataPlot1D.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataPlot1D.h	(revision 209)
@@ -0,0 +1,28 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef DATAPLOT1D_H_INCLUDED
+#define DATAPLOT1D_H_INCLUDED
+
+#include <ScopeFixedStep.h>
+#include "DataRemote.h"
+
+class Layout;
+class QMouseEvent;
+
+class DataPlot1D : public ScopeFixedStep, public DataRemote {
+public:
+  DataPlot1D(Layout *parent, int row, int col, QString title, float ymin,
+             float ymax, bool enabled, int period);
+  ~DataPlot1D();
+
+private:
+  void XmlEvent(QDomElement dom);
+  bool eventFilter(QObject *, QEvent *);
+  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
+  bool mouseEvent(QMouseEvent *event);
+  QList<QString> datas_type;
+};
+
+#endif // DATAPLOT1D_H_INCLUDED
Index: tags/latest/tools/FlairGCS/src/DataPlot2D.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/DataPlot2D.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataPlot2D.cpp	(revision 209)
@@ -0,0 +1,380 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "DataPlot2D.h"
+#include "Layout.h"
+#include <qwt_plot.h>
+#include <qwt_plot_curve.h>
+#include <qwt_plot_grid.h>
+#include <qwt_plot_magnifier.h>
+#include <qwt_plot_canvas.h>
+#include <qwt_scale_widget.h>
+#include <qwt_legend_label.h>
+#include <qwt_legend.h>
+#include <qwt_plot_panner.h>
+#include <qwt_plot_rescaler.h>
+#include <QMouseEvent>
+#include <QMenu>
+#include <QInputDialog>
+#include <qendian.h>
+
+DataPlot2D::DataPlot2D(Layout *parent, int row, int col, QString plot_name,
+                       QString x_name, QString y_name, float xmin, float xmax,
+                       float ymin, float ymax, bool enabled, int period)
+    : DataRemote(plot_name, "DataPlot2D", parent, enabled, period) {
+  plot = new QwtPlot(NULL);
+  plot->setEnabled(enabled);
+
+  parent->addWidget(plot, row, col);
+  visible_widget = plot;
+
+  view_size = 20; // default 20s
+                  /*
+                      // Disable polygon clipping
+                      QwtPainter::setDeviceClipping(false);
+                  
+                      // We don't need the cache here
+                      plot->canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
+                      plot->canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+                  */
+#if QT_VERSION >= 0x040000
+#ifdef Q_WS_X11
+  /*
+     Qt::WA_PaintOnScreen is only supported for X11, but leads
+     to substantial bugs with Qt 4.2.x/Windows
+   */
+  plot->canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
+#endif
+#endif
+
+  alignScales();
+
+  // d_x=new QList<double*>;
+  // d_y=new QList<double*>;
+  datas = new QList<QwtPlotCurve *>;
+  datas_type = new QList<QString>;
+
+  // Assign a title
+  plot->setTitle(plot_name);
+
+  // Axis
+  plot->setAxisTitle(QwtPlot::xBottom, x_name);
+  setXAxisScale(xmin, xmax);
+
+  plot->setAxisTitle(QwtPlot::yLeft, y_name);
+  setYAxisScale(ymin, ymax);
+
+  QwtPlotRescaler *rescaler = new QwtPlotRescaler(plot->canvas());
+  rescaler->setRescalePolicy(QwtPlotRescaler::Fixed); /*
+ rescaler->setReferenceAxis(QwtPlot::xBottom);
+ rescaler->setAspectRatio(QwtPlot::yLeft, 1.0);*/
+
+  // grid
+  QwtPlotGrid *grid = new QwtPlotGrid;
+  // grid->enableXMin(false);
+  grid->setPen(QPen(Qt::black, 0, Qt::DotLine));
+  // grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
+  grid->attach(plot);
+
+  // zoomer
+  QwtPlotMagnifier *zoomer = new QwtPlotMagnifier(plot->canvas());
+  zoomer->setMouseButton(Qt::RightButton, Qt::ControlModifier);
+
+  // scroller
+  QwtPlotPanner *scroller = new QwtPlotPanner(plot->canvas());
+
+  // legend
+  QwtLegend *new_legend = new QwtLegend();
+  new_legend->setDefaultItemMode(QwtLegendData::Checkable);
+  plot->insertLegend(new_legend, QwtPlot::BottomLegend);
+
+  connect(new_legend, SIGNAL(checked(const QVariant &, bool, int)),
+          SLOT(legendChecked(const QVariant &, bool)));
+
+  plot->canvas()->installEventFilter(this);
+}
+
+DataPlot2D::~DataPlot2D() {
+  for (int i = 0; i < d_x.count(); i++) {
+    free(d_x.at(i));
+    free(d_y.at(i));
+  }
+
+  delete datas;
+  delete datas_type;
+}
+
+void DataPlot2D::XmlEvent(QDomElement dom) {
+  if (dom.attribute("curve") != "") {
+    QString type = dom.attribute("type");
+    int r = dom.attribute("r").toInt();
+    int g = dom.attribute("g").toInt();
+    int b = dom.attribute("b").toInt();
+    QString name = dom.attribute("curve");
+    addCurve(QPen(QColor(r, g, b, 255)), name, type);
+  } else {
+    XmlSetup(dom);
+  }
+}
+
+bool DataPlot2D::eventFilter(QObject *o, QEvent *e) {
+  if (o == plot->canvas()) {
+    switch (e->type()) {
+    case QEvent::MouseButtonPress: {
+      mousePressEvent((QMouseEvent *)e);
+      break;
+    }
+
+    default:
+      break;
+    }
+  }
+  return plot->eventFilter(o, e);
+}
+
+void DataPlot2D::legendChecked(const QVariant &itemInfo, bool on) {
+  QwtPlotItem *plotItem = plot->infoToItem(itemInfo);
+  if (plotItem)
+    showCurve(plotItem, on);
+}
+
+void DataPlot2D::showCurve(QwtPlotItem *item, bool on) {
+  item->setVisible(on);
+
+  QwtLegend *lgd = qobject_cast<QwtLegend *>(plot->legend());
+
+  QList<QWidget *> legendWidgets = lgd->legendWidgets(plot->itemToInfo(item));
+
+  if (legendWidgets.size() == 1) {
+    QwtLegendLabel *legendLabel =
+        qobject_cast<QwtLegendLabel *>(legendWidgets[0]);
+
+    if (legendLabel)
+      legendLabel->setChecked(on);
+  }
+
+  plot->replot();
+}
+
+void DataPlot2D::addCurve(QPen pen, QString legend, QString type) {
+  double *new_dx;
+  new_dx = (double *)malloc(view_size / refresh_rate * sizeof(double));
+  d_x.append(new_dx);
+  double *new_dy;
+  new_dy = (double *)malloc(view_size / refresh_rate * sizeof(double));
+  d_y.append(new_dy);
+
+  //  Initialize data
+  for (int i = 0; i < view_size / refresh_rate; i++)
+    new_dx[i] = 0;
+  for (int i = 0; i < view_size / refresh_rate; i++)
+    new_dy[i] = 0;
+
+  // Insert new curve
+  QwtPlotCurve *new_data;
+
+  new_data = new QwtPlotCurve(legend);
+  new_data->attach(plot);
+  new_data->setPen(pen);
+  datas->append(new_data);
+
+  showCurve(new_data, true);
+
+  datas_type->append(type);
+  bool tmp = true;
+  datas_first_update.append(tmp);
+
+  // Attach (don't copy) data. Both curves use the same x array.
+  new_data->setRawSamples(new_dx, new_dy, view_size / refresh_rate);
+
+  if (type == "float") {
+    receivesize += sizeof(float);
+  } else if (type == "int8_t") {
+    receivesize += sizeof(int8_t);
+  } else if (type == "int16_t") {
+    receivesize += sizeof(int16_t);
+  } else {
+    printf("DataPlot2D::addCurve unknown type %s\n",
+           type.toLocal8Bit().constData());
+  }
+}
+
+void DataPlot2D::setXAxisScale(float xmin, float xmax) {
+  xmin_orig = xmin;
+  xmax_orig = xmax;
+  plot->setAxisScale(QwtPlot::xBottom, xmin_orig, xmax_orig);
+}
+
+void DataPlot2D::setYAxisScale(float ymin, float ymax) {
+  ymin_orig = ymin;
+  ymax_orig = ymax;
+  plot->setAxisScale(QwtPlot::yLeft, ymin_orig, ymax_orig);
+}
+
+//
+//  Set a plain canvas frame and align the scales to it
+//
+void DataPlot2D::alignScales(void) {
+  // The code below shows how to align the scales to
+  // the canvas frame, but is also a good example demonstrating
+  // why the spreaded API needs polishing.
+  /*
+      plot->canvas()->setFrameStyle(QFrame::Box | QFrame::Plain );
+      plot->canvas()->setLineWidth(1);
+  */
+  for (int i = 0; i < QwtPlot::axisCnt; i++) {
+    QwtScaleWidget *scaleWidget = (QwtScaleWidget *)plot->axisWidget(i);
+    if (scaleWidget)
+      scaleWidget->setMargin(0);
+
+    QwtScaleDraw *scaleDraw = (QwtScaleDraw *)plot->axisScaleDraw(i);
+    if (scaleDraw)
+      scaleDraw->enableComponent(QwtAbstractScaleDraw::Backbone, false);
+  }
+}
+
+void DataPlot2D::BufEvent(char **buf, int *buf_size, uint16_t period,
+                          bool big_endian) {
+  plot->setEnabled(IsEnabled());
+  if (IsEnabled() == false || RefreshRate_ms() != period)
+    return;
+
+  for (int i = 0; i < datas->count(); i++) {
+    if (datas_type->at(i) == "float") {
+      uint32_t data1_raw;
+      float *data1 = (float *)&data1_raw;
+      uint32_t data2_raw;
+      float *data2 = (float *)&data2_raw;
+
+      memcpy((void *)&data1_raw, *buf, sizeof(uint32_t));
+      *buf += sizeof(uint32_t);
+      memcpy((void *)&data2_raw, *buf, sizeof(uint32_t));
+      *buf += sizeof(uint32_t);
+      if (big_endian == true)
+        data1_raw = qFromBigEndian(data1_raw);
+      if (big_endian == true)
+        data2_raw = qFromBigEndian(data2_raw);
+      plot_data(*data1, *data2, i);
+    } else if (datas_type->at(i) == "int8_t") {
+      int8_t data1, data2;
+      memcpy((void *)&data1, *buf, sizeof(data1));
+      *buf += sizeof(data1);
+      memcpy((void *)&data2, *buf, sizeof(data2));
+      *buf += sizeof(data2);
+      plot_data(data1, data2, i);
+    } else if (datas_type->at(i) == "int16_t") {
+      int16_t data1, data2;
+      memcpy((void *)&data1, *buf, sizeof(data1));
+      *buf += sizeof(data1);
+      memcpy((void *)&data2, *buf, sizeof(data2));
+      *buf += sizeof(data2);
+      plot_data(data1, data2, i);
+    } else {
+      printf("DataPlot1D::DrawDatas type non connu\n");
+    }
+  }
+
+  plot->replot();
+}
+
+void DataPlot2D::plot_data(double data_x, double data_y, int index) {
+  if (index < d_y.count()) {
+    if (datas_first_update.at(index) == false) {
+      // Shift y array left and assign new value to y[view_size/refresh_rate -
+      // 1].
+      for (int j = 0; j < view_size / refresh_rate - 1; j++)
+        d_y.at(index)[j] = d_y.at(index)[j + 1];
+      for (int j = 0; j < view_size / refresh_rate - 1; j++)
+        d_x.at(index)[j] = d_x.at(index)[j + 1];
+      d_y.at(index)[(int)(view_size / refresh_rate) - 1] = data_y;
+      d_x.at(index)[(int)(view_size / refresh_rate) - 1] = data_x;
+    } else {
+      for (int j = 0; j <= view_size / refresh_rate - 1; j++)
+        d_y.at(index)[j] = data_y;
+      for (int j = 0; j <= view_size / refresh_rate - 1; j++)
+        d_x.at(index)[j] = data_x;
+      datas_first_update[index] = false;
+    }
+  }
+}
+
+// context menu
+void DataPlot2D::mousePressEvent(QMouseEvent *event) {
+  if (event->button() == Qt::RightButton) {
+
+    QMenu *menu = new QMenu("nom", plot);
+    // ajout des actions
+    QAction *a, *z, *d;
+
+    a = menu->addAction("reset zoom");
+    menu->addSeparator();
+
+    d = menu->addAction(QString("set view size (%1s)").arg(view_size));
+
+    appendmenu(menu);
+    z = execmenu(plot, menu, event->globalPos());
+    delete menu;
+
+    if (z == a) {
+      // zoom to original size
+      plot->setAxisScale(QwtPlot::yLeft, ymin_orig, ymax_orig);
+      plot->setAxisScale(QwtPlot::xBottom, xmin_orig, xmax_orig);
+    }
+
+    if (z == d) {
+      bool ok;
+      float time = QInputDialog::getInt(
+          plot, QString("Set view size (%1)").arg(plot->title().text()),
+          tr("Value (s):"), view_size, 1, 65535, 10, &ok);
+      if (ok == true) {
+        for (int i = 0; i < datas->count(); i++) {
+          if (time > view_size) {
+            double *buf =
+                (double *)malloc(time / refresh_rate * sizeof(double));
+            d_x[i] = (double *)realloc(d_x.at(i),
+                                       time / refresh_rate * sizeof(double));
+            memcpy(buf, d_x[i], (view_size / refresh_rate) * sizeof(double));
+            memcpy(&d_x[i][(int)(time / refresh_rate) -
+                           (int)(view_size / refresh_rate)],
+                   buf, (view_size / refresh_rate) * sizeof(double));
+            d_y[i] = (double *)realloc(d_y.at(i),
+                                       time / refresh_rate * sizeof(double));
+            memcpy(buf, d_y[i], (view_size / refresh_rate) * sizeof(double));
+            memcpy(&d_y[i][(int)(time / refresh_rate) -
+                           (int)(view_size / refresh_rate)],
+                   buf, (view_size / refresh_rate) * sizeof(double));
+            free(buf);
+            for (int j = 0; j < (int)(time / refresh_rate) -
+                                    (int)(view_size / refresh_rate);
+                 j++) {
+              d_x.at(i)[j] = d_x.at(i)[(int)(time / refresh_rate) -
+                                       (int)(view_size / refresh_rate) + 1];
+              d_y.at(i)[j] = d_y.at(i)[(int)(time / refresh_rate) -
+                                       (int)(view_size / refresh_rate) + 1];
+            }
+          } else {
+            double *buf =
+                (double *)malloc(time / refresh_rate * sizeof(double));
+            memcpy(buf, &d_x[i][(int)(view_size / refresh_rate) -
+                                (int)(time / refresh_rate)],
+                   (time / refresh_rate) * sizeof(double));
+            d_x[i] = (double *)realloc(d_x.at(i),
+                                       time / refresh_rate * sizeof(double));
+            memcpy(d_x[i], buf, (time / refresh_rate) * sizeof(double));
+            memcpy(buf, &d_y[i][(int)(view_size / refresh_rate) -
+                                (int)(time / refresh_rate)],
+                   (time / refresh_rate) * sizeof(double));
+            d_y[i] = (double *)realloc(d_y.at(i),
+                                       time / refresh_rate * sizeof(double));
+            memcpy(d_y[i], buf, (time / refresh_rate) * sizeof(double));
+            free(buf);
+          }
+          datas->at(i)
+              ->setRawSamples(d_x.at(i), d_y.at(i), time / refresh_rate);
+        }
+        view_size = time;
+      }
+    }
+  }
+}
Index: tags/latest/tools/FlairGCS/src/DataPlot2D.h
===================================================================
--- tags/latest/tools/FlairGCS/src/DataPlot2D.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataPlot2D.h	(revision 209)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef DATAPLOT2D_H_INCLUDED
+#define DATAPLOT2D_H_INCLUDED
+
+#include "DataRemote.h"
+#include <stdint.h>
+#include <QPen>
+
+class Layout;
+class QwtPlot;
+class QwtPlotCurve;
+class QwtPlotItem;
+class QMouseEvent;
+
+class DataPlot2D : public DataRemote {
+  Q_OBJECT
+
+public:
+  DataPlot2D(Layout *parent, int row, int col, QString plot_name,
+             QString x_name, QString y_name, float xmin, float xmax, float ymin,
+             float ymax, bool enabled, int period);
+  ~DataPlot2D();
+  void addCurve(QPen pen, QString legend, QString type);
+
+protected:
+  void mousePressEvent(QMouseEvent *event);
+
+private:
+  QwtPlot *plot;
+  void XmlEvent(QDomElement dom);
+  void alignScales(void);
+  void plot_data(double data_x, double data_y, int index);
+  float xmin_orig, xmax_orig, ymin_orig, ymax_orig;
+
+  QList<QwtPlotCurve *> *datas;
+  QList<QString> *datas_type;
+  QList<bool> datas_first_update;
+  QList<double *> d_x;
+  QList<double *> d_y;
+  double view_size; // en s
+
+  bool eventFilter(QObject *, QEvent *);
+  void setYAxisScale(float ymin, float ymax);
+  void setXAxisScale(float xmin, float xmax);
+  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
+  void showCurve(QwtPlotItem *item, bool on);
+
+private slots:
+  void legendChecked(const QVariant &itemInfo, bool on);
+};
+
+#endif // DATAPLOT2D_H_INCLUDED
Index: tags/latest/tools/FlairGCS/src/DataRemote.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/DataRemote.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataRemote.cpp	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "DataRemote.h"
+#include <QMenu>
+#include <QInputDialog>
+#include <QtXml>
+#include "Manager.h"
+#include "ConnectionLayout.h"
+
+DataRemote::DataRemote(QString name, QString type, XmlWidget *parent,
+                       bool enabled, int period)
+    : XmlWidget(name, type, parent) {
+  auto_refresh = enabled;
+  is_logging = true;
+  receivesize = 0;
+  refresh_rate = (double)period / 1000.;
+
+  connectionLayout()->addDataRemote(this);
+
+  // pour ne pas faire de doublons qd on change la periode
+  SetIsExpandable(true);
+}
+
+DataRemote::~DataRemote() { connectionLayout()->removeDataRemote(this); }
+
+void DataRemote::appendmenu(QMenu *menu) {
+  menu->addSeparator();
+
+  b = menu->addAction("auto refresh");
+  b->setCheckable(true);
+  b->setChecked(auto_refresh);
+
+  c = menu->addAction(QString("set refresh rate (%1ms)")
+                          .arg((uint16_t)(qRound(refresh_rate * 1000))));
+  c->setEnabled(auto_refresh);
+  menu->addSeparator();
+
+  d = menu->addAction("log");
+  d->setCheckable(true);
+  d->setChecked(is_logging);
+}
+
+QAction *DataRemote::execmenu(QWidget *parent, QMenu *menu, QPoint point) {
+  QAction *z;
+
+  z = menu->exec(point);
+
+  // auto_refresh=b->isChecked();
+
+  if (z == b) {
+    SendPeriod(RefreshRate_ms(), b->isChecked());
+  }
+
+  if (z == c) {
+    bool ok;
+    // uint16_t time = QInputDialog::getInt(this, QString("Set refresh rate
+    // (%1)").arg(title().text()),tr("Value (ms):"),
+    // (uint16_t)(qRound(refresh_rate*1000)), 1, 65535, 10, &ok);
+    uint16_t time = QInputDialog::getInt(
+        parent, "Set refresh rate ", "Value (ms):",
+        (uint16_t)(qRound(refresh_rate * 1000)), 1, 65535, 10, &ok);
+    if (ok == true && time != qRound(refresh_rate * 1000)) {
+      // refresh_rate=time/1000.;
+      SendPeriod(time, b->isChecked());
+    }
+  }
+
+  return z;
+}
+
+uint16_t DataRemote::RefreshRate_ms(void) {
+  return (uint16_t)(qRound(refresh_rate * 1000.));
+}
+
+bool DataRemote::IsEnabled(void) { return auto_refresh; }
+
+void DataRemote::SendPeriod(int period, bool auto_refresh) {
+  RemoveAllAttributes();
+
+  SetAttribute("period", period);
+  SetAttribute("enabled", auto_refresh);
+
+  connectionLayout()->XmlToSend(XmlDoc());
+
+  RemoveAttribute("period");
+  RemoveAttribute("enabled");
+}
+
+int DataRemote::ReceiveSize(void) { return receivesize; }
+
+void DataRemote::XmlSetup(QDomElement dom) {
+  refresh_rate = dom.attribute("period").toInt() / 1000.;
+  if (dom.attribute("enabled") == "1")
+    auto_refresh = true;
+  else
+    auto_refresh = false;
+}
Index: tags/latest/tools/FlairGCS/src/DataRemote.h
===================================================================
--- tags/latest/tools/FlairGCS/src/DataRemote.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DataRemote.h	(revision 209)
@@ -0,0 +1,41 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef DATAREMOTE_H
+#define DATAREMOTE_H
+
+#include <stdint.h>
+#include "XmlWidget.h"
+#include <QPoint>
+
+class QMenu;
+class QAction;
+
+class DataRemote : public XmlWidget {
+public:
+  DataRemote(QString name, QString type, XmlWidget *parent, bool enabled,
+             int period);
+  ~DataRemote();
+  uint16_t RefreshRate_ms(void);
+  bool IsEnabled(void);
+  int ReceiveSize(void);
+  virtual void BufEvent(char **buf, int *buf_size, uint16_t period,
+                        bool big_endian) = 0;
+  void appendmenu(QMenu *menu);
+  QAction *execmenu(QWidget *parent, QMenu *menu, QPoint point);
+
+protected:
+  bool auto_refresh;
+  bool is_logging;
+  double refresh_rate; // en s
+  int receivesize;
+
+  void XmlSetup(QDomElement dom);
+
+private:
+  void SendPeriod(int period, bool auto_refresh);
+  QAction *b, *c, *d;
+};
+
+#endif // DATAREMOTE_H
Index: tags/latest/tools/FlairGCS/src/DoubleSpinBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/DoubleSpinBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DoubleSpinBox.cpp	(revision 209)
@@ -0,0 +1,118 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "DoubleSpinBox.h"
+#include "Layout.h"
+#include <QLineEdit>
+#include <QMenu>
+#include <QContextMenuEvent>
+#include <QDoubleSpinBox>
+#include <QFormLayout>
+
+DoubleSpinBox::DoubleSpinBox(Layout *parent, int row, int col, QString name,
+                             QString suffix, QString value, float min,
+                             float max, float step, int decimals)
+    : FormLayout(parent, row, col, name, "DoubleSpinBox") {
+  doublespinbox = new QDoubleSpinBox();
+
+  doublespinbox->setRange(min, max);
+  doublespinbox->setSingleStep(step);
+  doublespinbox->setDecimals(decimals);
+  if (suffix != "")
+    doublespinbox->setSuffix(suffix);
+  adjust_decimals(value);
+  doublespinbox->setValue(value.toDouble());
+  doublespinbox_value = doublespinbox->cleanText();
+
+  // event filter for qdoublespinbox and its child (qlinedit and incremnt
+  // qbuttons)
+  doublespinbox->installEventFilter(this);
+  QObjectList o_list = doublespinbox->children();
+  for (int i = 0; i < o_list.length(); i++) {
+    QLineEdit *cast = qobject_cast<QLineEdit *>(o_list[i]);
+    if (cast)
+      cast->installEventFilter(this);
+  }
+
+  object_layout->addRow(name, doublespinbox);
+
+  connect(doublespinbox, SIGNAL(valueChanged(const QString &)), this,
+          SLOT(valuechanged(const QString &)));
+
+  SetValue(value);
+}
+
+DoubleSpinBox::~DoubleSpinBox() { delete doublespinbox; }
+
+void DoubleSpinBox::adjust_decimals(QString value) {
+  // auto adjust decimals
+  QLocale locale;
+  value.remove(locale.groupSeparator());
+
+  QStringList parts = value.split(locale.decimalPoint());
+  if (parts.count() == 2) {
+    doublespinbox->setDecimals(parts[1].size());
+  }
+}
+
+bool DoubleSpinBox::eventFilter(QObject *object, QEvent *event) {
+  if (object == doublespinbox && event->type() == QEvent::MouseButtonPress) {
+    if (((QMouseEvent *)event)->button() == Qt::RightButton) {
+      QMenu *menu = new QMenu("menu", doublespinbox);
+      QAction *a, *b, *c, *z;
+
+      a = menu->addAction("add decimal");
+      b = menu->addAction("remove decimal");
+
+      if (doublespinbox->decimals() == 0)
+        b->setEnabled(false);
+      z = menu->exec(((QMouseEvent *)event)->globalPos());
+
+      if (z == a)
+        doublespinbox->setDecimals(doublespinbox->decimals() + 1);
+      if (z == b)
+        doublespinbox->setDecimals(doublespinbox->decimals() - 1);
+      delete menu;
+      return true;
+    }
+  }
+
+  return object->eventFilter(object, event);
+}
+
+void DoubleSpinBox::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  visible_widget->setPalette(black_pal);
+}
+
+void DoubleSpinBox::ui_to_var(void) {
+  doublespinbox_value = doublespinbox->cleanText();
+}
+
+void DoubleSpinBox::ui_to_xml(void) { SetValue(doublespinbox->cleanText()); }
+
+void DoubleSpinBox::Reset(void) {
+  // le setvalue fait un arrondi pour l'affichage, la variable n'est donc plus
+  // egale
+  // on reprend la valeur de la boite et on force la couleur a noir
+  adjust_decimals(doublespinbox_value);
+  doublespinbox->setValue(doublespinbox_value.toDouble());
+  doublespinbox_value = doublespinbox->cleanText();
+  visible_widget->setPalette(black_pal);
+}
+
+void DoubleSpinBox::LoadEvent(QDomElement dom) {
+  if (doublespinbox->isEnabled() == true) {
+    doublespinbox->setValue((dom.attribute("value")).toDouble());
+  }
+}
+
+void DoubleSpinBox::valuechanged(const QString &value) {
+  if (value != doublespinbox_value) {
+    visible_widget->setPalette(red_pal);
+  } else {
+    visible_widget->setPalette(black_pal);
+  }
+}
Index: tags/latest/tools/FlairGCS/src/DoubleSpinBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/DoubleSpinBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/DoubleSpinBox.h	(revision 209)
@@ -0,0 +1,37 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef DOUBLESPINBOX_H
+#define DOUBLESPINBOX_H
+
+#include "FormLayout.h"
+
+class Layout;
+class QDoubleSpinBox;
+
+class DoubleSpinBox : public FormLayout {
+  Q_OBJECT
+
+public:
+  // handle value as string, becouse double value are not exact
+  DoubleSpinBox(Layout *parent, int row, int col, QString name, QString suffix,
+                QString value, float min, float max, float step, int decimals);
+  ~DoubleSpinBox();
+
+private:
+  QDoubleSpinBox *doublespinbox;
+  QString doublespinbox_value;
+  void SetUptodate(void);
+  void Reset(void);
+  void LoadEvent(QDomElement dom);
+  void ui_to_var(void);
+  void ui_to_xml(void);
+  bool eventFilter(QObject *o, QEvent *e);
+  void adjust_decimals(QString value);
+
+private slots:
+  void valuechanged(const QString &value);
+};
+
+#endif // DOUBLESPINBOX_H
Index: tags/latest/tools/FlairGCS/src/FormLayout.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/FormLayout.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/FormLayout.cpp	(revision 209)
@@ -0,0 +1,64 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "FormLayout.h"
+#include "Layout.h"
+#include <QWidget>
+#include <QFormLayout>
+#include <QEvent>
+
+FormLayout::FormLayout(Layout *parent, int row, int col, QString name,
+                       QString type)
+    : XmlWidget(name, type, parent) {
+  visible_widget = new QWidget();
+
+  // create a grid to put label and object
+  visible_widget->setObjectName(name);
+
+  parent->addWidget(visible_widget, row, col);
+  object_layout = new QFormLayout(visible_widget);
+  object_layout->setHorizontalSpacing(2);
+  object_layout->setVerticalSpacing(2);
+  object_layout->setContentsMargins(2, 2, 2, 2);
+
+  visible_widget->installEventFilter(this);
+}
+
+FormLayout::~FormLayout() {}
+
+bool FormLayout::IsUptodate(void) {
+  // si le widget n'est pas enabled, sa palette est differente de rouge (greyed)
+  // donc on renvoit true
+  // permet de ne pas envoyer les modifs d'un widget disabled
+  // if(label->palette()==red_pal) return false;
+  if (visible_widget->palette() == red_pal)
+    return false;
+  return true;
+}
+
+bool FormLayout::eventFilter(QObject *o, QEvent *e) {
+  if (o == visible_widget) {
+    switch (e->type()) {
+    case QEvent::EnabledChange: {
+      QPalette palette = visible_widget->palette();
+      QPalette result;
+
+      if (palette == red_pal)
+        result = red_pal_greyed;
+      if (palette == red_pal_greyed)
+        result = red_pal;
+      if (palette == black_pal)
+        result = black_pal_greyed;
+      if (palette == black_pal_greyed)
+        result = black_pal;
+
+      visible_widget->setPalette(result);
+    }
+
+    default:
+      break;
+    }
+  }
+  return QObject::eventFilter(o, e);
+}
Index: tags/latest/tools/FlairGCS/src/FormLayout.h
===================================================================
--- tags/latest/tools/FlairGCS/src/FormLayout.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/FormLayout.h	(revision 209)
@@ -0,0 +1,28 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef LABELWIDGET_H
+#define LABELWIDGET_H
+
+#include "XmlWidget.h"
+
+class QFormLayout;
+class Layout;
+
+class FormLayout : public XmlWidget {
+
+public:
+  FormLayout(Layout *parent, int row, int col, QString name, QString type);
+  ~FormLayout();
+
+private:
+  bool IsUptodate(void);
+  virtual void SetUptodate(void) = 0;
+  bool eventFilter(QObject *o, QEvent *e);
+
+protected:
+  QFormLayout *object_layout;
+};
+
+#endif // LABELWIDGET_H
Index: tags/latest/tools/FlairGCS/src/GridLayout.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/GridLayout.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/GridLayout.cpp	(revision 209)
@@ -0,0 +1,21 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "GridLayout.h"
+#include <QWidget>
+#include <QGridLayout>
+
+GridLayout::GridLayout(Layout *parent, int row, int col, QString name)
+    : Layout(parent, name, "GridLayout") {
+  widget = new QWidget();
+  widget->setObjectName(name);
+
+  visible_widget = widget;
+
+  parent->addWidget(widget, row, col);
+
+  widget->setLayout(getQGridLayout());
+}
+
+GridLayout::~GridLayout() { widget->setParent(NULL); }
Index: tags/latest/tools/FlairGCS/src/GridLayout.h
===================================================================
--- tags/latest/tools/FlairGCS/src/GridLayout.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/GridLayout.h	(revision 209)
@@ -0,0 +1,20 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef GRIDLAYOUT_H
+#define GRIDLAYOUT_H
+
+#include "Layout.h"
+
+class GridLayout : public Layout {
+
+public:
+  GridLayout(Layout *parent, int row, int col, QString name);
+  ~GridLayout();
+
+private:
+  QWidget *widget;
+};
+
+#endif // GRIDLAYOUT_H
Index: tags/latest/tools/FlairGCS/src/GroupBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/GroupBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/GroupBox.cpp	(revision 209)
@@ -0,0 +1,29 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "GroupBox.h"
+#include <QGroupBox>
+#include <QGridLayout>
+
+GroupBox::GroupBox(Layout *parent, int row, int col, QString name)
+    : Layout(parent, name, "GroupBox") {
+  // creation et ajout QGroupBox
+  box = new QGroupBox(name);
+  box->setObjectName(name);
+
+  visible_widget = box;
+
+  parent->addWidget(box, row, col);
+  // parent->splitter->addWidget(box);
+
+  box->setLayout(getQGridLayout());
+}
+
+GroupBox::~GroupBox() {
+  // layout->removeItem(this);//ne semble pas necessaire
+
+  box->setParent(NULL); // sinon le delete layout detruit aussi this
+  // delete layout;
+  // delete box;
+}
Index: tags/latest/tools/FlairGCS/src/GroupBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/GroupBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/GroupBox.h	(revision 209)
@@ -0,0 +1,22 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef GROUPBOX_H
+#define GROUPBOX_H
+
+#include "Layout.h"
+
+class QGroupBox;
+
+class GroupBox : public Layout {
+
+public:
+  GroupBox(Layout *parent, int row, int col, QString name);
+  ~GroupBox();
+
+private:
+  QGroupBox *box;
+};
+
+#endif // GROUPBOX_H
Index: tags/latest/tools/FlairGCS/src/Label.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Label.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Label.cpp	(revision 209)
@@ -0,0 +1,26 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Label.h"
+#include "Layout.h"
+#include <QLabel>
+
+Label::Label(Layout *parent, int row, int col, QString name)
+    : XmlWidget(name, "Label", parent) {
+
+  label = new QLabel();
+  label->setObjectName(name);
+  visible_widget = label;
+
+  parent->addWidget(label, row, col);
+
+  // pour ne pas faire de doublons qd on change le texte
+  SetIsExpandable(true);
+}
+
+Label::~Label() {}
+
+void Label::XmlEvent(QDomElement dom) {
+  label->setText(dom.attribute("value"));
+}
Index: tags/latest/tools/FlairGCS/src/Label.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Label.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Label.h	(revision 209)
@@ -0,0 +1,23 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef LABEL_H
+#define LABEL_H
+
+#include "XmlWidget.h"
+
+class Layout;
+class QLabel;
+
+class Label : public XmlWidget {
+public:
+  Label(Layout *parent, int row, int col, QString name);
+  ~Label();
+
+private:
+  void XmlEvent(QDomElement dom);
+  QLabel *label;
+};
+
+#endif // LABEL_H
Index: tags/latest/tools/FlairGCS/src/Landmark.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Landmark.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Landmark.cpp	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Landmark.h"
+#include <QPen>
+#include <QGeoMapTextObject>
+#include <QGeoMapPixmapObject>
+#include <QGraphicsGeoMap>
+
+using namespace QtMobility;
+
+Landmark::Landmark(QGraphicsGeoMap *geoMap, const QGeoCoordinate &coordinate,
+                   QString name, QString type) {
+  geoMap->addMapObject(this);
+  this->geoMap = geoMap;
+  pixmap = new QGeoMapPixmapObject();
+  pixmap->setCoordinate(coordinate);
+
+  if (type == "cross") {
+    pixmap->setOffset(QPoint(-16, -16));
+    pixmap->setPixmap(QPixmap(":cross.png"));
+  } else {
+    pixmap->setOffset(QPoint(-2, -30));
+    pixmap->setPixmap(QPixmap(":landmark.png"));
+  }
+  addChildObject(pixmap);
+
+  QFont font;
+  font.setWeight(QFont::Bold);
+  text = new QGeoMapTextObject(coordinate, name, font, QPoint(0, 10));
+  text->setPen(QPen(Qt::NoPen));
+  text->setBrush(QBrush(Qt::red));
+  addChildObject(text);
+}
+
+Landmark::~Landmark() {
+  geoMap->removeMapObject(this);
+  clearChildObjects();
+}
+
+void Landmark::setText(QString string) { text->setText(string); }
+
+void Landmark::setColor(Qt::GlobalColor color) {
+  text->setBrush(QBrush(color));
+}
+
+bool Landmark::IsUptodate(void) {
+  if(text->brush()==QBrush(Qt::white)) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+void Landmark::setCoordinate(const QGeoCoordinate &coordinate) {
+  pixmap->setCoordinate(coordinate);
+  text->setCoordinate(coordinate);
+}
+
+QGeoCoordinate Landmark::coordinate(void) { return pixmap->coordinate(); }
+
+void Landmark::RemoveLandmark(void) { geoMap->removeMapObject(this); }
+
+void Landmark::AddLandmark(QGraphicsGeoMap *geoMap) {
+  geoMap->addMapObject(this);
+  this->geoMap = geoMap;
+}
Index: tags/latest/tools/FlairGCS/src/Landmark.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Landmark.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Landmark.h	(revision 209)
@@ -0,0 +1,39 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef LANDMARK_H
+#define LANDMARK_H
+
+#include <QGeoMapGroupObject>
+#include <QGeoCoordinate>
+
+namespace QtMobility {
+class QGraphicsGeoMap;
+class QGeoMapTextObject;
+class QGeoMapPixmapObject;
+}
+
+class Landmark : public QtMobility::QGeoMapGroupObject {
+
+public:
+  Landmark(QtMobility::QGraphicsGeoMap *geoMap,
+           const QtMobility::QGeoCoordinate &coordinate, QString name,
+           QString type = "landmark");
+  ~Landmark();
+
+  QtMobility::QGeoCoordinate coordinate(void);
+  void setCoordinate(const QtMobility::QGeoCoordinate &coordinate);
+  void setText(QString string);
+  void setColor(Qt::GlobalColor color);
+  void RemoveLandmark(void);
+  void AddLandmark(QtMobility::QGraphicsGeoMap *geoMap);
+  bool IsUptodate(void);
+
+private:
+  QtMobility::QGeoMapTextObject *text;
+  QtMobility::QGeoMapPixmapObject *pixmap;
+  QtMobility::QGraphicsGeoMap *geoMap;
+};
+
+#endif
Index: tags/latest/tools/FlairGCS/src/Layout.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Layout.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Layout.cpp	(revision 209)
@@ -0,0 +1,277 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Layout.h"
+#include "TabWidget.h"
+#include "GroupBox.h"
+#include "GridLayout.h"
+#include "SpinBox.h"
+#include "DoubleSpinBox.h"
+#include "Vector3DSpinBox.h"
+#include "CheckBox.h"
+#include "ComboBox.h"
+#include "PushButton.h"
+#include "TextEdit.h"
+#include "Label.h"
+#include "DataPlot1D.h"
+#include "DataPlot2D.h"
+#include "RangeFinderPlot.h"
+#include "Picture.h"
+#include "Map.h"
+#include <QGeoCoordinate>
+#include <QGridLayout>
+#include "ListWidget.h"
+#include <QStringList>
+
+Layout::Layout(QWidget *parent, XmlWidget *xml, QString name, QString type)
+    : XmlWidget(name, type, xml) {
+  qgridlayout = new QGridLayout(parent);
+  Constructor(name);
+}
+
+Layout::Layout(Layout *parent, QString name, QString type)
+    : XmlWidget(name, type, parent) {
+  qgridlayout = new QGridLayout(new QWidget());
+  Constructor(name);
+}
+
+void Layout::Constructor(QString name) {
+  visible_widget = qgridlayout->parentWidget();
+  // if(visible_widget==NULL) printf("null\n");
+  qgridlayout->setObjectName(name);
+  // printf("layout\n%s\n",XmlDoc().toString().toLocal8Bit().constData());
+  SetIsContainer(true);
+  SetIsExpandable(true);
+
+  qgridlayout->setHorizontalSpacing(2);
+  qgridlayout->setVerticalSpacing(2);
+  qgridlayout->setContentsMargins(2, 2, 2, 2);
+
+  // splitter = new QSplitter();
+  // addWidget(splitter);
+  /*
+  QWidget *widget = new QWidget();
+  //QHBoxLayout *parentLayout = new QHBoxLayout();
+  widget->setLayout(this);
+  parent->addWidget(widget);
+  //QTabWidget *tabWidget = new QTabWidget();
+  //parentLayout->addWidget(tabWidget);*/
+}
+
+Layout::~Layout() { delete qgridlayout; }
+
+void Layout::addWidget(QWidget *widget, int row, int column) {
+  qgridlayout->addWidget(widget, row, column);
+}
+
+QGridLayout *Layout::getQGridLayout() { return qgridlayout; }
+
+void Layout::XmlEvent(QDomElement dom) {
+  XmlWidget *widget = NULL;
+  QString type = dom.tagName();
+  QString name = dom.attribute("name");
+  QString old_name = dom.attribute("old_name");
+  int row = dom.attribute("row").toInt();
+  int col = dom.attribute("col").toInt();
+
+  // initially rowCount()=1 and columnCount()=1 but count()=0 !
+  // new row
+  if (row == -1 && col == -1) {
+    row = qgridlayout->rowCount();
+    if (qgridlayout->count() == 0)
+      row = 0;
+    col = 0;
+  }
+  // last row last col
+  if (row == -1 && col == 0) {
+    row = qgridlayout->rowCount() - 1;
+    int i;
+    for (i = 0; i <= qgridlayout->columnCount(); i++) {
+      if (qgridlayout->itemAtPosition(row, i) == NULL)
+        break;
+    }
+    col = i;
+  }
+  // if an item already exists at this position, put it on a new row
+  if (qgridlayout->itemAtPosition(row, col) != NULL) {
+    printf("existe %s\n", name.toLocal8Bit().constData());
+    row = qgridlayout->rowCount();
+  }
+
+  if (type == "TabWidget") {
+    int position = dom.attribute("position").toInt();
+    widget =
+        new TabWidget(this, row, col, name, (QTabWidget::TabPosition)position);
+  }
+  if (type == "GroupBox") {
+    widget = new GroupBox(this, row, col, name);
+  }
+  if (type == "GridLayout") {
+    widget = new GridLayout(this, row, col, name);
+  }
+  if (type == "SpinBox") {
+    int value = dom.attribute("value").toInt();
+    QString suffix = dom.attribute("suffix");
+    int min = dom.attribute("min").toInt();
+    int max = dom.attribute("max").toInt();
+    int step = dom.attribute("step").toInt();
+    widget = new SpinBox(this, row, col, name, suffix, value, min, max, step);
+  }
+  if (type == "DoubleSpinBox") {
+    QString value = dom.attribute("value");
+    QString suffix = dom.attribute("suffix");
+    double min = dom.attribute("min").toDouble();
+    double max = dom.attribute("max").toDouble();
+    double step = dom.attribute("step").toDouble();
+    int decimals = dom.attribute("decimals").toInt();
+    widget = new DoubleSpinBox(this, row, col, name, suffix, value, min, max,
+                               step, decimals);
+  }
+  if (type == "Vector3DSpinBox") {
+    QString value[3];
+    value[0] = dom.attribute("value_x");
+    value[1] = dom.attribute("value_y");
+    value[2] = dom.attribute("value_z");
+    double min = dom.attribute("min").toDouble();
+    double max = dom.attribute("max").toDouble();
+    double step = dom.attribute("step").toDouble();
+    int decimals = dom.attribute("decimals").toInt();
+    widget = new Vector3DSpinBox(this, row, col, name, value, min, max, step,
+                                 decimals);
+  }
+  if (type == "CheckBox") {
+    int value = dom.attribute("value").toInt();
+    widget = new CheckBox(this, row, col, name, value);
+  }
+  if (type == "ComboBox") {
+    int value = dom.attribute("value").toInt();
+    widget = new ComboBox(this, row, col, name, value);
+  }
+  if (type == "PushButton") {
+    widget = new PushButton(this, row, col, name);
+  }
+  if (type == "DataPlot1D") {
+    float ymin = dom.attribute("min").toFloat();
+    float ymax = dom.attribute("max").toFloat();
+    int enabled = dom.attribute("enabled").toInt();
+    int period = dom.attribute("period").toInt();
+    if (enabled == 1) {
+      widget = new DataPlot1D(this, row, col, name, ymin, ymax, true, period);
+    } else {
+      widget = new DataPlot1D(this, row, col, name, ymin, ymax, false, 100);
+    }
+  }
+  if (type == "DataPlot2D") {
+    float xmin = dom.attribute("xmin").toFloat();
+    float xmax = dom.attribute("xmax").toFloat();
+    float ymin = dom.attribute("ymin").toFloat();
+    float ymax = dom.attribute("ymax").toFloat();
+    QString x_name = dom.attribute("x_name");
+    QString y_name = dom.attribute("y_name");
+    int enabled = dom.attribute("enabled").toInt();
+    int period = dom.attribute("period").toInt();
+    if (enabled == 1) {
+      widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax,
+                              ymin, ymax, true, period);
+    } else {
+      widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax,
+                              ymin, ymax, false, 100);
+    }
+  }
+  if (type == "RangeFinderPlot") {
+    float xmin = dom.attribute("xmin").toFloat();
+    float xmax = dom.attribute("xmax").toFloat();
+    float ymin = dom.attribute("ymin").toFloat();
+    float ymax = dom.attribute("ymax").toFloat();
+    QString x_name = dom.attribute("x_name");
+    QString y_name = dom.attribute("y_name");
+    QString data_type = dom.attribute("type");
+    float start_angle = dom.attribute("start_angle").toFloat();
+    float end_angle = dom.attribute("end_angle").toFloat();
+    uint32_t nb_samples = dom.attribute("nb_samples").toUInt();
+    int enabled = dom.attribute("enabled").toInt();
+    int period = dom.attribute("period").toInt();
+    int invert_axis = dom.attribute("invert_axis").toInt();
+    bool invert_axis_bool;
+    if (invert_axis == 0) {
+      invert_axis_bool = false;
+    } else {
+      invert_axis_bool = true;
+    }
+    if (enabled == 1) {
+      widget =
+          new RangeFinderPlot(this, row, col, name, x_name, y_name, xmin, xmax,
+                              ymin, ymax, start_angle, end_angle, nb_samples,
+                              data_type, invert_axis, true, period);
+    } else {
+      widget =
+          new RangeFinderPlot(this, row, col, name, x_name, y_name, xmin, xmax,
+                              ymin, ymax, start_angle, end_angle, nb_samples,
+                              data_type, invert_axis, false, 100);
+    }
+  }
+  if (type == "Picture") {
+    int width = dom.attribute("width").toInt();
+    int height = dom.attribute("height").toInt();
+    int enabled = dom.attribute("enabled").toInt();
+    int period = dom.attribute("period").toInt();
+    if (enabled == 1) {
+      widget = new Picture(this, row, col, name, width, height, true, period);
+    } else {
+      widget = new Picture(this, row, col, name, width, height, false, period);
+    }
+  }
+  if (type == "Map") {
+    int period = dom.attribute("period").toInt();
+    int enabled = dom.attribute("enabled").toInt();
+    int i = 0;
+    QList<QtMobility::QGeoCoordinate> coordinates;
+    while (dom.hasAttribute("lat" + QString::number(i))) {
+      double latitude = dom.attribute("lat" + QString::number(i)).toDouble();
+      double longitude = dom.attribute("long" + QString::number(i)).toDouble();
+      double alt = dom.attribute("alt" + QString::number(i)).toDouble();
+      QtMobility::QGeoCoordinate coordinate =
+          QtMobility::QGeoCoordinate(latitude, longitude, alt);
+      coordinates.append(coordinate);
+      i++;
+    }
+
+    if (enabled == 1) {
+      widget = new Map(this, row, col, name, coordinates, true, period);
+    } else {
+      widget = new Map(this, row, col, name, coordinates, false, period);
+    }
+  }
+  if (type == "TextEdit") {
+    widget = new TextEdit(this, row, col, name);
+  }
+  if (type == "Label") {
+    widget = new Label(this, row, col, name);
+  }
+  if (type == "ListWidget") {
+    // Parse the item list    
+    QStringList items;
+    int count = 0;
+    while (dom.hasAttribute("item" + QString::number(count))) {
+      QString item = dom.attribute("item" + QString::number(count));
+      items.append(item);
+      count++;
+    }
+    widget = new ListWidget(this, row, col, name, items);
+  }
+
+  if (widget != NULL) {
+    if (old_name != "") {
+      widget->RenamedFrom(old_name);
+    }
+  }
+}
+
+bool Layout::IsUptodate(void) {
+  for (int i = 0; i < childs->count(); i++) {
+    if (childs->at(i)->IsUptodate() == false)
+      return false;
+  }
+  return true;
+}
Index: tags/latest/tools/FlairGCS/src/Layout.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Layout.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Layout.h	(revision 209)
@@ -0,0 +1,29 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef LAYOUT_H
+#define LAYOUT_H
+
+#include "XmlWidget.h"
+
+class QWidget;
+class QGridLayout;
+
+class Layout : public XmlWidget {
+public:
+  Layout(QWidget *parent, XmlWidget *xml, QString name, QString type);
+  Layout(Layout *parent, QString name, QString type);
+  ~Layout();
+  bool IsUptodate(void);
+  void addWidget(QWidget *, int row, int column);
+  QGridLayout *getQGridLayout();
+
+  // QSplitter *splitter;
+private:
+  void Constructor(QString name);
+  void XmlEvent(QDomElement dom);
+  QGridLayout *qgridlayout;
+};
+
+#endif // LAYOUT_H
Index: tags/latest/tools/FlairGCS/src/ListWidget.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/ListWidget.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ListWidget.cpp	(revision 209)
@@ -0,0 +1,148 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "ListWidget.h"
+#include "Layout.h"
+#include <QListWidget>
+#include <QFormLayout>
+#include <QLabel>
+#include <QListWidgetItem>
+#include <QPalette>
+#include <QStringList>
+#include <sstream>
+
+//to remove, for tests only
+#include <iostream>
+
+ListWidget::ListWidget(Layout *parent, int row, int col, QString name)
+    : currentItemRow(-1), isUpToDate(true),
+      FormLayout(parent, row, col, name, "ListWidget") {
+  listwidget = new QListWidget();
+  if (internalItemsList == NULL) {
+    internalItemsList = new QStringList();
+  }
+  // construct the object in 2 times, to have the label above the list
+  object_layout->addRow(new QLabel(name));
+  object_layout->addRow(listwidget);
+  // modify the color palette to have the selected item text in red
+  palListRed.setColor(QPalette::HighlightedText, QColor(255, 0, 0));
+  palListDefault.setColor(QPalette::HighlightedText, QColor(255, 255, 255));
+  connect(listwidget, SIGNAL(currentRowChanged(int)), this,
+          SLOT(SelectedItemChanged(int)));
+  // to avoid duplicates when adding items
+  SetIsExpandable(true);
+}
+
+ListWidget::ListWidget(Layout *parent, int row, int col, QString name,
+                       QStringList &items)
+    : ListWidget(parent, row, col, name) {
+  if (!items.isEmpty()) {
+    listwidget->addItems(items);
+    internalItemsList = new QStringList(items);
+  }
+
+}
+
+ListWidget::~ListWidget() {
+  if (listwidget) {
+    delete listwidget;
+  }
+}
+
+void ListWidget::XmlEvent(QDomElement dom) {
+  isUpToDate = false;
+  if (dom.attribute("item") != "") {
+    QString item = dom.attribute("item");
+    QListWidgetItem *widget_item = new QListWidgetItem(item);
+    // new item, so the text is red
+    widget_item->setForeground(Qt::red);
+    listwidget->addItem(widget_item);
+  }
+  if (dom.attribute("delete") != "") {
+    int row_to_del = dom.attribute("delete").toInt();
+    RemoveItemFromXml(row_to_del);
+    QListWidgetItem *item_to_del = listwidget->takeItem(row_to_del);
+    if (item_to_del) {
+      delete item_to_del;
+    }
+  }
+}
+
+void ListWidget::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  listwidget->setPalette(palListDefault);
+  isUpToDate = true;
+}
+
+void ListWidget::ui_to_var(void) {
+  currentItemRow = listwidget->currentRow();
+  internalItemsList->clear();
+  for (int count = 0; count < listwidget->count(); count++) {
+    internalItemsList->append(listwidget->item(count)->text());
+  }
+}
+
+void ListWidget::ui_to_xml(void) {
+  SetValue(QString::number(listwidget->currentRow()));
+  // add the list of items
+  for (int count = 0; count < listwidget->count(); count++) {
+    std::string item;
+    std::ostringstream item_prop;
+    item_prop << "item" << count; 
+    SetAttribute(QString::fromStdString(item_prop.str()),
+                 listwidget->item(count)->text());
+    listwidget->item(count)->setForeground(Qt::black);
+  }
+}
+
+void ListWidget::Reset(void) {
+  if (currentItemRow != -1) {
+    listwidget->setCurrentRow(currentItemRow);
+  }
+  listwidget->clear();
+  listwidget->addItems(*internalItemsList);
+}
+
+void ListWidget::LoadEvent(QDomElement dom) {
+  //function not tested
+  std::cout << "FlairGCS LoadEvent" << std::endl;
+  if (listwidget->isEnabled() == true) {
+    std::cout << "FlairGCS LoadEvent loading" << std::endl;
+    listwidget->clear();
+    QStringList items;
+    int count = 0;
+    while (dom.hasAttribute("item" + QString::number(count))) {
+      std::cout << "FlairGCS LoadEvent boucle" << std::endl;
+      listwidget->addItem(dom.attribute("item" + QString::number(count)));
+      count++;
+    }
+  }
+}
+
+void ListWidget::SelectedItemChanged(int current_row) {
+  if (current_row != currentItemRow) {
+    isUpToDate = false;
+    listwidget->setPalette(palListRed);
+  } else {
+    listwidget->setPalette(palListDefault);
+  }
+}
+
+bool ListWidget::IsUptodate(void) { return isUpToDate; }
+
+void ListWidget::RemoveItemFromXml(int row_to_del) {
+  // Shift the elements in the XML file to have the one to delete at the end
+  std::ostringstream item_prop;
+  for (int count = row_to_del; count < listwidget->count() - 1; count++) {
+    item_prop << "item" << count;
+    SetAttribute(QString::fromStdString(item_prop.str()),
+                 listwidget->item(count + 1)->text());
+    // Clear the value of the stringstream
+    item_prop.str(std::string());  
+  }
+  // Delete the last element from the XML file
+  item_prop << "item" << (listwidget->count() - 1);
+  RemoveAttribute(QString::fromStdString(item_prop.str()));
+}
Index: tags/latest/tools/FlairGCS/src/ListWidget.h
===================================================================
--- tags/latest/tools/FlairGCS/src/ListWidget.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ListWidget.h	(revision 209)
@@ -0,0 +1,142 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ListWidget.h
+ * \brief Class displaying a QListWidget on the ground station
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/07/26
+ * \version 1.0
+ */
+#ifndef LISTWIDGET_H
+#define LISTWIDGET_H
+
+#include "FormLayout.h"
+
+class QListWidget;
+class Layout;
+class QStringList;
+class QListWidgetItem;
+class QPalette;
+class QStringList;
+
+/*! \class ListWidget
+ *
+ * \brief Class displaying a QListWidget on the ground station
+ *
+ */
+class ListWidget : public FormLayout {
+  Q_OBJECT
+
+public:
+  /**
+   * \brief      Default constructor
+   *
+   * \param      parent  The parent widget
+   * \param[in]  row     The row where to position the widget
+   * \param[in]  col     The col where to position the widget
+   * \param[in]  name    The name of the widget
+   */
+  ListWidget(Layout *parent, int row, int col, QString name);
+  /**
+   * \brief      Constructor with a list of default items
+   *
+   * \param      parent  The parent widget
+   * \param[in]  row     The row where to position the widget
+   * \param[in]  col     The col where to position the widget
+   * \param[in]  name    The name of the widget
+   * \param      items   List of items to display at creation
+   */
+  ListWidget(Layout *parent, int row, int col, QString name,
+             QStringList &items);
+  /**
+   * \brief      Destructor
+   */
+  ~ListWidget();
+
+private:
+  /**
+   * \brief      Check if the widget is up to date.
+   *
+   * \return     True if uptodate, False otherwise.
+   */
+  bool IsUptodate(void);
+  /**
+   * \brief      Sets the isUpToDate internal flag.
+   */
+  void SetUptodate(void);
+  /**
+   * \brief      Handler to process a new xml file.
+   *
+   * \param[in]  dom   The dom containing the xml file.
+   */
+  void XmlEvent(QDomElement dom);
+  /**
+   * \brief      Reset the widget, load the internal parameters.
+   */
+
+  void Reset(void);
+  /**
+   * \brief      Handler to process the loading of the internal xml file.
+   *
+   * \param[in]  dom   The dom containing the xml file.
+   */
+  void LoadEvent(QDomElement dom);
+  /**
+   * \brief      Save the user interface variables state in the internal members.
+   */
+  void ui_to_var(void);
+  /**
+   * \brief      Save the user interface variables state in the internal xml file.
+   */
+  void ui_to_xml(void);
+  /**
+   * \brief      Removes the row_to_del element from the internal xml file.
+   * 
+   * As the order of the elements is important, all the elements after the one
+   * deleted are shifted to occupy the blank space.
+   *
+   * \param[in]  row_to_del  The row of the element to delete.
+   */
+  void RemoveItemFromXml(int row_to_del);
+  /**
+   * Pointer to the managed QListWidget widget.
+   */
+  QListWidget *listwidget;
+  /**
+   * Store the list of all the items, in order to use the Reset function.
+   */
+  QStringList *internalItemsList;
+  /**
+   * The row of the currently selected item.
+   */
+  int currentItemRow;
+  /**
+   * Flag to know if the widget is up to date.
+   */
+  bool isUpToDate;
+  /**
+   * Redefined color palette.
+   * The highlight item's text appears in red.
+   */
+  QPalette palListRed;
+  /**
+   * Redefined color palette.
+   * The highlight item's text appears in white (default).
+   */
+  QPalette palListDefault;
+
+private slots:
+  /**
+   * \brief      Handle the change of the selected item.
+   * 
+   * When the selected item has changed, the text of the newly selected item appears in red,
+   * to notify the user to apply the modification.
+   *
+   * \param[in]  current_row  The row of the currently selected item.
+   */
+  void SelectedItemChanged(int current_row);
+};
+
+#endif // LISTWIDGET_H
Index: tags/latest/tools/FlairGCS/src/Manager.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Manager.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Manager.cpp	(revision 209)
@@ -0,0 +1,347 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Manager.h"
+#include "UdtSocket.h"
+#include "ConnectionLayout.h"
+#include "communication.h"
+#include <QDate>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QPushButton>
+#include <QTabBar>
+#include <QTimer>
+#include <QThread>
+#include <QTextStream>
+#include <QVBoxLayout>
+#include <QModelIndex>
+//#include <qmetatype.h>
+#include <qendian.h>
+#include <iostream>
+#include <string>
+#include <fstream>
+#include <stdio.h>
+
+#ifndef WIN32
+#include <arpa/inet.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+using namespace std;
+
+Manager::Manager(QString name, int port) : QWidget() {
+  qRegisterMetaType<QModelIndex>("QModelIndex"); // pour le file ui??
+  this->name = name;
+
+  setWindowTitle(name);
+//statusBar()->showMessage(tr("Ready to serve"));
+  // manager layout
+  managerLayout = new QVBoxLayout;
+  setLayout(managerLayout);
+
+  // tab bar for multiple connections
+  tabBar = new QTabBar();
+  managerLayout->addWidget(tabBar);
+  connect(tabBar, SIGNAL(currentChanged(int)), this,
+          SLOT(tabBarCurrentChanged(int)));
+  currentTab = 0;
+
+  // layout boutons
+  button_layout = new QGridLayout();
+  managerLayout->addLayout(button_layout);
+
+  // boutons du button_Layout
+  send_button = new QPushButton("apply all");
+  reset_button = new QPushButton("reset all");
+  load_button = new QPushButton("load all locally");
+  save_button = new QPushButton("save all locally");
+  button_layout->addWidget(send_button, 0, 0);
+  button_layout->addWidget(reset_button, 0, 1);
+  button_layout->addWidget(load_button, 0, 2);
+  button_layout->addWidget(save_button, 0, 3);
+
+  connect(send_button, SIGNAL(clicked(bool)), this, SLOT(send()));
+  connect(reset_button, SIGNAL(clicked(bool)), this, SLOT(reset()));
+  connect(load_button, SIGNAL(clicked(bool)), this, SLOT(load()));
+  connect(save_button, SIGNAL(clicked(bool)), this, SLOT(save()));
+
+  status=new QStatusBar();
+  status->setSizeGripEnabled(false);
+  button_layout->addWidget(status, 1,0);
+
+  UDT::startup();
+  serv = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+
+  // for non blocking accept
+  bool blocking = false;
+  UDT::setsockopt(serv, 0, UDT_RCVSYN, &blocking, sizeof(bool));
+
+  sockaddr_in my_addr;
+  my_addr.sin_family = AF_INET;
+  my_addr.sin_port = htons(port);
+  my_addr.sin_addr.s_addr = INADDR_ANY;
+  memset(&(my_addr.sin_zero), '\0', 8);
+
+  if (UDT::ERROR == UDT::bind(serv, (sockaddr *)&my_addr, sizeof(my_addr))) {
+    printf("bind error, %s\n", UDT::getlasterror().getErrorMessage());
+  }
+
+  if (UDT::ERROR == UDT::listen(serv, 1)) {
+    printf("listen error, %s\n", UDT::getlasterror().getErrorMessage());
+  }
+
+  QTimer *timer = new QTimer(this);
+  connect(timer, SIGNAL(timeout()), this, SLOT(acceptConnections()));
+  timer->start(20);
+}
+
+Manager::~Manager() {
+  emit killUdtSockets();
+
+  // delete main_layout;
+  UDT::cleanup();
+}
+
+void Manager::acceptConnections(void) {
+  static UDTSOCKET first_socket = 0;
+  UDTSOCKET socket;
+
+  sockaddr_in their_addr;
+  int namelen = sizeof(their_addr);
+
+  if (UDT::INVALID_SOCK ==
+      (socket = UDT::accept(serv, (sockaddr *)&their_addr, &namelen))) {
+    if (UDT::getlasterror().getErrorCode() != 6002)
+      printf("accept: %s, code %i\n", UDT::getlasterror().getErrorMessage(),
+             UDT::getlasterror().getErrorCode());
+    return;
+  } else {
+    printf("connected to %s:%i\n", inet_ntoa(their_addr.sin_addr),
+           their_addr.sin_port);
+
+    if (!first_socket) {
+      first_socket = socket;
+      return;
+    } else {
+      QThread *thread = new QThread(this);
+      UdtSocket *new_udt = new UdtSocket(first_socket, socket, name);
+      new_udt->moveToThread(thread);
+
+      newConnection(new_udt);
+
+      connect(this, SIGNAL(killUdtSockets()), thread, SLOT(quit()));
+      connect(this, SIGNAL(killUdtSockets()), new_udt, SLOT(kill()),
+              Qt::BlockingQueuedConnection);
+
+      connect(thread, SIGNAL(started()), new_udt, SLOT(handleConnections()));
+
+      thread->start();
+      first_socket = 0;
+    }
+  }
+}
+
+void Manager::newConnection(UdtSocket *socket) {
+
+  // no tabs to 2 tabs
+  if (connectionsLayout.count() == 1) {
+    tabBar->addTab(hiddenTabName);
+    currentTab = 0;
+    connectionsWidget.at(0)->show();
+  }
+
+  // layout utilisateur
+  ConnectionLayout *newLayout = new ConnectionLayout(socket, "interface");
+  connectionsLayout.append(newLayout);
+  connect(newLayout, SIGNAL(setRemoteName(QString)), this,
+          SLOT(tabName(QString)));
+  connect(newLayout, SIGNAL(computedRxRate(float)), this,
+          SLOT(printRxRates(float)));
+  connect(socket, SIGNAL(dataReady(char *, int)), newLayout,
+          SLOT(receive(char *, int)));
+  connect(newLayout, SIGNAL(destroyed(QObject *)), this,
+          SLOT(layoutDestroyed(QObject *)));
+  connect(socket, SIGNAL(destroyed()), newLayout, SLOT(deleteLater()));
+
+  // widget
+  QWidget *newWidget = new QWidget();
+  connectionsWidget.append(newWidget);
+  newWidget->setLayout(newLayout->getQGridLayout());
+  managerLayout->insertWidget(1, newWidget);
+  newWidget->hide();
+
+  if (connectionsLayout.count() == 1) { // first connection
+    newWidget->show();
+  } else { // add a tab for the new connection
+    tabBar->addTab("unknown");
+  }
+}
+
+void Manager::printRxRates(float rxRate) {
+  int index = connectionsLayout.indexOf((ConnectionLayout *)sender());
+
+  if (tabBar->count() == 0) {
+    status->showMessage(tr("rx rate %1 kB/s").arg(rxRate,0,'f',3));
+  } else if (index==tabBar->currentIndex()) {
+    status->showMessage(tr("%1 rx rate %2 kB/s").arg(tabBar->tabText(index)).arg(rxRate,0,'f',3));
+  }
+}
+
+void Manager::tabBarCurrentChanged(int index) {
+  if (index >= 0) {
+    connectionsWidget.at(currentTab)->hide();
+    connectionsWidget.at(index)->show();
+    currentTab = index;
+  } else {
+    currentTab = 0;
+    connectionsWidget.at(0)->show();
+  }
+}
+
+void Manager::tabName(QString name) {
+  int index = connectionsLayout.indexOf((ConnectionLayout *)sender());
+  if (tabBar->count() == 0) {
+    hiddenTabName = name;
+  } else {
+    tabBar->setTabText(index, name);
+  }
+}
+
+void Manager::layoutDestroyed(QObject *obj) {
+  int index = connectionsLayout.indexOf((ConnectionLayout *)obj);
+
+  if (tabBar->count() > 1) {
+    tabBar->removeTab(index);
+  }
+
+  delete connectionsWidget.at(index);
+  connectionsWidget.removeAt(index);
+  connectionsLayout.removeOne((ConnectionLayout *)obj);
+
+  if (connectionsLayout.count() == 1) {
+    hiddenTabName = tabBar->tabText(0);
+    tabBar->removeTab(0);
+  }
+
+  if (connectionsLayout.count() == 0) {
+    status->showMessage("");
+  }
+}
+
+void Manager::load(void) {
+  QString dir_name =
+      QFileDialog::getExistingDirectory(this, "Select a directory", 0, 0);
+
+  if (dir_name != "") {
+    for (int i = 0; i < connectionsLayout.count(); i++) {
+      QFile *file;
+      file = new QFile(dir_name + "/" +
+                       connectionsLayout.at(i)->getRemoteName() + ".xml");
+      if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) {
+        QMessageBox::warning(this, "Warning",
+                             "Enable to load " +
+                                 connectionsLayout.at(i)->getRemoteName() +
+                                 ".xml");
+        continue;
+      }
+
+      QDomDocument doc;
+      QString errorMsg;
+      int errorLine;
+      int errorColumn;
+      if (!doc.setContent(file, &errorMsg, &errorLine, &errorColumn)) {
+        QMessageBox::critical(
+            this, "Error",
+            "unable to read " + connectionsLayout.at(i)->getRemoteName() +
+                ".xml" + " (" + errorMsg + " at " + QString::number(errorLine) +
+                "," + QString::number(errorColumn) + ")");
+      } else {
+        connectionsLayout.at(i)->LoadXml(doc);
+      }
+      delete file;
+    }
+  }
+}
+
+void Manager::save(void) {
+  bool isUptodate = true;
+
+  for (int i = 0; i < connectionsLayout.count(); i++) {
+    if (!connectionsLayout.at(i)->IsUptodate()) {
+      isUptodate = false;
+      break;
+    }
+  }
+
+  if (!isUptodate) {
+    QMessageBox msgBox;
+    msgBox.setText("There are pending modifications");
+    msgBox.setInformativeText("Apply and save?");
+    msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
+    msgBox.setDefaultButton(QMessageBox::Yes);
+    int ret = msgBox.exec();
+
+    switch (ret) {
+    case QMessageBox::Yes:
+      send();
+      break;
+    case QMessageBox::Cancel:
+      return;
+      break;
+    default:
+      // should never be reached
+      break;
+    }
+  }
+
+  // create dirctory for storage
+  QDateTime dateTime = QDateTime::currentDateTime();
+  QString dir_name =
+      "configs_" + dateTime.toString("yyyyMMdd_hhmm") + "_" + name;
+  if (QDir().exists(dir_name) == true) {
+    dir_name = "configs_" + dateTime.toString("yyyyMMdd_hhmm_ss") + "_" + name;
+  }
+  QDir().mkdir(dir_name);
+
+  for (int i = 0; i < connectionsLayout.count(); i++) {
+    QDomDocument *xml = new QDomDocument("remote_ui_xml");
+
+    connectionsLayout.at(i)->GetFullXml((QDomElement *)xml);
+
+    QFile fichier(dir_name + "/" + connectionsLayout.at(i)->getRemoteName() +
+                  ".xml");
+    QString write_doc = (xml->ownerDocument()).toString();
+
+    if (!fichier.open(QIODevice::WriteOnly)) {
+      fichier.close();
+      QMessageBox::critical(this, "Error", "Enable to write XML");
+      continue;
+    }
+    QTextStream stream(&fichier);
+    stream << write_doc; // On utilise l'opérateur << pour écrire write_doc dans
+                         // le document XML.
+    fichier.close();
+
+    delete xml;
+  }
+
+  QMessageBox::information(this, "save all", "saved to ./" + dir_name);
+}
+
+void Manager::send(void) {
+  for (int i = 0; i < connectionsLayout.count(); i++) {
+    QDomDocument doc("remote_ui_xml");
+    connectionsLayout.at(i)->GetUpdateXml((QDomElement *)&doc);
+    // printf("merge\n%s\n",doc.toString().toLocal8Bit().constData());
+
+    connectionsLayout.at(i)->XmlToSend(doc);
+  }
+}
+
+void Manager::reset() {
+  for (int i = 0; i < connectionsLayout.count(); i++)
+    connectionsLayout.at(i)->ResetAllChilds();
+}
Index: tags/latest/tools/FlairGCS/src/Manager.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Manager.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Manager.h	(revision 209)
@@ -0,0 +1,62 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <QWidget>
+#include <udt.h>
+#include <qdom.h>
+#include <QStatusBar>
+
+class UdtSocket;
+class ConnectionLayout;
+class QVBoxLayout;
+class QTabBar;
+class QPushButton;
+class QGridLayout;
+
+class Manager : public QWidget {
+  Q_OBJECT
+
+public:
+  Manager(QString name, int port);
+  ~Manager();
+
+private:
+  UDTSOCKET serv;
+  QVBoxLayout *managerLayout;
+  QList<ConnectionLayout *> connectionsLayout;
+  QList<QWidget *> connectionsWidget;
+  QTabBar *tabBar;
+  QString name, hiddenTabName;
+  int currentTab;
+
+  QPushButton *send_button;
+  QPushButton *reset_button;
+  QPushButton *load_button;
+  QPushButton *save_button;
+  QGridLayout *button_layout;
+  QStatusBar *status;
+
+  void newConnection(UdtSocket *socket);
+
+private slots:
+  void acceptConnections(void);
+  void load(void);
+  void send(void);
+  void save(void);
+  void reset(void);
+  void layoutDestroyed(QObject *obj);
+  void tabBarCurrentChanged(int index);
+  void tabName(QString name);
+  void printRxRates(float rxRate);
+
+signals:
+  void killUdtSockets(void);
+
+protected:
+};
+
+#endif // MANAGER_H
Index: tags/latest/tools/FlairGCS/src/Map.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Map.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Map.cpp	(revision 209)
@@ -0,0 +1,331 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Map.h"
+#include "Landmark.h"
+#include "Layout.h"
+#include "mapwidget.h"
+#include <QNetworkProxy>
+#include <QFormLayout>
+#include <QInputDialog>
+#include <QtGlobal>
+#include <QMenu>
+#include <QGeoMappingManager>
+#include <QGeoServiceProvider>
+#include <QComboBox>
+#include <QToolButton>
+#include <QCoreApplication>
+#include <qendian.h>
+
+//todo: merge Map and mapwidget
+
+using namespace QtMobility;
+
+Map::Map(Layout *parent, int row, int col, QString name,
+         QList<QGeoCoordinate> coordinates, bool enabled, int period)
+    : DataRemote(name, "Map", parent, enabled, period) {
+  visible_widget = new QWidget();
+  visible_widget->setObjectName(name);
+  centeredpoint = 0;
+
+  mapTypes[QGraphicsGeoMap::StreetMap] = tr("Street map");
+  mapTypes[QGraphicsGeoMap::SatelliteMapDay] = tr("Satellite map (day)");
+  mapTypes[QGraphicsGeoMap::SatelliteMapNight] = tr("Satellite map (night)");
+  mapTypes[QGraphicsGeoMap::TerrainMap] = tr("Terrain map");
+
+  mapWidget = new MapWidget(this, visible_widget);
+  geoMap = 0;
+
+  QVBoxLayout *map_layout = new QVBoxLayout();
+  parent->getQGridLayout()->addLayout(map_layout, row, col);
+  QHBoxLayout *tool_layout = new QHBoxLayout();
+  map_layout->addLayout(tool_layout, 0);
+
+  QFormLayout *servicelayout = new QFormLayout();
+  serviceCombo = new QComboBox(visible_widget);
+  servicelayout->addRow("service: ", serviceCombo);
+  QFormLayout *maplayout = new QFormLayout();
+  mapTypeCombo = new QComboBox(visible_widget);
+  maplayout->addRow("map type: ", mapTypeCombo);
+  QFormLayout *proxylayout = new QFormLayout();
+  proxyCombo = new QComboBox(visible_widget);
+  proxylayout->addRow("proxy: ", proxyCombo);
+
+  if (findServices()) {
+    tool_layout->addLayout(servicelayout, 0);
+    tool_layout->addLayout(maplayout, 1);
+    tool_layout->addLayout(proxylayout, 2);
+
+    zoomin = new QToolButton(visible_widget);
+    zoomout = new QToolButton(visible_widget);
+    zoomInAction =
+        new QAction(QIcon(QPixmap(":zoomin.png")), tr("Zoom &In"), zoomin);
+    zoomOutAction =
+        new QAction(QIcon(QPixmap(":zoomout.png")), tr("Zoom &Out"), zoomout);
+    zoomin->setDefaultAction(zoomInAction);
+    zoomout->setDefaultAction(zoomOutAction);
+    tool_layout->addWidget(zoomin, 3);
+    tool_layout->addWidget(zoomout, 4);
+    connect(zoomInAction, SIGNAL(triggered()), this, SLOT(zoomIn()));
+    connect(zoomOutAction, SIGNAL(triggered()), this, SLOT(zoomOut()));
+
+    selectService(0);
+
+    findproxy();
+
+    connect(serviceCombo, SIGNAL(currentIndexChanged(int)), this,
+            SLOT(selectService(int)));
+    connect(mapTypeCombo, SIGNAL(currentIndexChanged(int)), this,
+            SLOT(changeMapType(int)));
+    connect(proxyCombo, SIGNAL(currentIndexChanged(int)), this,
+            SLOT(changeproxy(int)));
+  } else {
+    printf("Error, no services!\n");
+    mapWidget->setEnabled(false);
+  }
+
+  map_layout->addWidget(mapWidget, 1);
+  for (int i = 0; i < coordinates.size(); i++) {
+    mapWidget->AddLandmark((QGeoCoordinate &)coordinates.at(i));
+  }
+}
+
+Map::~Map() {
+  for (int i = 0; i < points.count(); i++) delete points.at(i);
+  delete mapWidget;
+}
+
+bool Map::findServices(void) {
+  QCoreApplication::addLibraryPath(qgetenv("OECORE_HOST_SYSROOT") +
+                                   "/usr/lib/qt4/");
+
+  QStringList services = QGeoServiceProvider::availableServiceProviders();
+
+  if (services.isEmpty()) {
+    QGraphicsTextItem *item = mapWidget->scene()->addText(
+        tr("Failed to find any map services. Please ensure that "
+           "the location services plugins for Qt Mobility are "
+           "installed and, if necessary, set the IGEP_ROOT "
+           "environment variable to the good location."));
+
+    item->setTextWidth(300);
+
+    return false;
+  }
+
+  QMap<QString, QVariant> parameters;
+
+  foreach (QString name, services) {
+
+    parameters["mapping.cache.directory"] = name;
+    parameters["mapping.cache.size"] = QString("500000000");
+
+    QGeoServiceProvider *service = new QGeoServiceProvider(name, parameters);
+
+    if (service->error() != QGeoServiceProvider::NoError) {
+      delete service;
+      continue;
+    }
+
+    QGeoMappingManager *manager = service->mappingManager();
+
+    if (manager) {
+      serviceCombo->addItem(name);
+      managers.append(manager);
+    }
+  }
+
+  return true;
+}
+
+void Map::selectService(int item) {
+  QString name = serviceCombo->currentText();
+
+  QGeoCoordinate coordinate = QGeoCoordinate(0, 0);
+  QGraphicsGeoMap::MapType mapType = QGraphicsGeoMap::StreetMap;
+  int zoomLevel = 1;
+
+  if (geoMap) {
+    coordinate = geoMap->center();
+    mapType = geoMap->mapType();
+    zoomLevel = geoMap->zoomLevel();
+
+    mapWidget->RemoveLandmarks();
+    RemovePoints();
+    geoMap->deleteLater();
+  }
+
+  manager = managers[item];
+  geoMap = new QGraphicsGeoMap(manager);
+
+  mapWidget->AddLandmarks(geoMap);
+  AddPoints(geoMap);
+  geoMap->setCenter(coordinate);
+  geoMap->setMapType(mapType);
+
+  populateMapTypeCombo();
+  updateZoom(zoomLevel);
+
+  mapWidget->setMap(geoMap);
+  connect(geoMap, SIGNAL(zoomLevelChanged(qreal)), this,
+          SLOT(updateZoom(qreal)));
+}
+
+void Map::changeMapType(int index) {
+  geoMap->setMapType(
+      QGraphicsGeoMap::MapType(mapTypeCombo->itemData(index).toInt()));
+}
+
+void Map::populateMapTypeCombo(void) {
+  mapTypeCombo->clear();
+
+  foreach (QGraphicsGeoMap::MapType mapType, geoMap->supportedMapTypes()) {
+    if (mapTypes.contains(mapType))
+      mapTypeCombo->addItem(mapTypes[mapType], QVariant(mapType));
+  }
+
+  if (mapTypeCombo->count() > 0)
+    geoMap->setMapType(
+        QGraphicsGeoMap::MapType(mapTypeCombo->itemData(0).toInt()));
+}
+
+void Map::zoomIn(void) { updateZoom(geoMap->zoomLevel() + 1); }
+
+void Map::zoomOut(void) { updateZoom(geoMap->zoomLevel() - 1); }
+
+void Map::updateZoom(qreal value) {
+  value =
+      qBound(manager->minimumZoomLevel(), value, manager->maximumZoomLevel());
+
+  geoMap->setZoomLevel(value);
+  zoomin->setEnabled(geoMap->zoomLevel() < manager->maximumZoomLevel());
+  zoomout->setEnabled(geoMap->zoomLevel() > manager->minimumZoomLevel());
+}
+
+void Map::findproxy(void) {
+  proxyCombo->addItem("none");
+  proxyCombo->addItem("new");
+  proxyCombo->addItem("proxyweb.utc.fr:3128");
+}
+
+void Map::changeproxy(int index) {
+  if (index == 0) {
+    QNetworkProxy proxy;
+    proxy.setType(QNetworkProxy::NoProxy);
+    QNetworkProxy::setApplicationProxy(proxy);
+  } else if (index == 1) {
+    bool ok;
+    QString text =
+        QInputDialog::getText(visible_widget, tr("New proxy:"), tr("proxy: "),
+                              QLineEdit::Normal, "adress:port", &ok);
+    if (ok == true) {
+      proxyCombo->addItem(text);
+      proxyCombo->setCurrentIndex(proxyCombo->count() - 1);
+    }
+  } else {
+    QStringList string = proxyCombo->itemText(index).split(":");
+    QNetworkProxy proxy;
+    proxy.setType(QNetworkProxy::HttpProxy);
+    proxy.setHostName(string.at(0));
+    proxy.setPort(string.at(1).toInt());
+    QNetworkProxy::setApplicationProxy(proxy);
+    updateZoom(geoMap->zoomLevel()); // refresh
+  }
+}
+
+void Map::SetUptodate(void) {
+  QList<Landmark *> *landmarks = mapWidget->Landmarks();
+  for (int i = 0; i < landmarks->count(); i++) {
+    RemoveAttribute("lat" + QString::number(i));
+    RemoveAttribute("long" + QString::number(i));
+
+    if (mapWidget->LandmarkToSend(i)) {
+      SetAttribute("lat" + QString::number(i),
+                   landmarks->at(i)->coordinate().latitude());
+      SetAttribute("long" + QString::number(i),
+                   landmarks->at(i)->coordinate().longitude());
+    }
+  }
+
+  mapWidget->SetUptodate();
+}
+
+bool Map::IsUptodate(void) { return mapWidget->IsUptodate(); }
+
+void Map::Reset(void) { mapWidget->Reset(); }
+
+void Map::setCenteredPoint(int i) {
+  centeredpoint = i;
+  if (isCentered())
+    geoMap->setCenter(points.at(i)->coordinate());
+}
+
+int Map::centeredPoint(void) { return centeredpoint; }
+
+bool Map::isCentered(void) {
+  if (centeredpoint != -1) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+void Map::XmlEvent(QDomElement dom) {
+  if (dom.attribute("point") != "") {
+    receivesize += 3 * sizeof(double);
+    if (mapWidget->isEnabled()) {
+      Landmark *landmark = new Landmark(geoMap, QGeoCoordinate(0, 0, 0),
+                                        dom.attribute("point"), "cross");
+      landmark->setColor(Qt::black);
+      points.append(landmark);
+      mapWidget->AddPoint(dom.attribute("point"));
+    }
+  } else {
+    XmlSetup(dom);
+  }
+}
+
+void Map::BufEvent(char **buf, int *buf_size, uint16_t period,
+                   bool big_endian) {
+  if (IsEnabled() == false || RefreshRate_ms() != period)
+    return;
+
+  for (int i = 0; i < points.count(); i++) {
+    qint64 lat_raw;
+    double *lat = (double *)&lat_raw;
+    qint64 longitude_raw;
+    double *longitude = (double *)&longitude_raw;
+    qint64 alt_raw;
+    double *alt = (double *)&alt_raw;
+
+    memcpy(&lat_raw, *buf, sizeof(qint64));
+    *buf += sizeof(qint64);
+    memcpy(&longitude_raw, *buf, sizeof(qint64));
+    *buf += sizeof(qint64);
+    memcpy(&alt_raw, *buf, sizeof(qint64));
+    *buf += sizeof(qint64);
+    if (big_endian == true)
+      lat_raw = qFromBigEndian(lat_raw);
+    if (big_endian == true)
+      longitude_raw = qFromBigEndian(longitude_raw);
+    if (big_endian == true)
+      alt_raw = qFromBigEndian(alt_raw);
+    points.at(i)->setCoordinate(QGeoCoordinate(*lat, *longitude, *alt));
+
+    if (i == centeredpoint)
+      geoMap->setCenter(points.at(i)->coordinate());
+  }
+}
+
+void Map::RemovePoints(void) {
+  for (int i = 0; i < points.count(); i++) {
+    points.at(i)->RemoveLandmark();
+  }
+}
+
+void Map::AddPoints(QGraphicsGeoMap *geoMap) {
+  for (int i = 0; i < points.count(); i++) {
+    points.at(i)->AddLandmark(geoMap);
+  }
+}
Index: tags/latest/tools/FlairGCS/src/Map.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Map.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Map.h	(revision 209)
@@ -0,0 +1,73 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef MAP_H
+#define MAP_H
+
+#include <stdint.h>
+#include "DataRemote.h"
+#include <QGeoCoordinate>
+#include <QGraphicsGeoMap>
+
+class Layout;
+class MapWidget;
+class QComboBox;
+class Landmark;
+class QToolButton;
+
+namespace QtMobility {
+class QGeoMappingManager;
+class QGraphicsGeoMap;
+class QGeoServiceProvider;
+}
+
+class Map : public DataRemote {
+  Q_OBJECT
+
+  friend class MapWidget;
+
+public:
+  Map(Layout *parent, int row, int col, QString name,
+      QList<QtMobility::QGeoCoordinate> coordinates, bool enabled, int period);
+  ~Map();
+  void setCenteredPoint(int i);
+  int centeredPoint(void);
+  bool isCentered(void);
+
+private:
+  MapWidget *mapWidget;
+  QtMobility::QGeoMappingManager *manager;
+  QList<QtMobility::QGeoMappingManager *> managers;
+  QtMobility::QGraphicsGeoMap *geoMap;
+  QtMobility::QGeoServiceProvider *service;
+  QComboBox *mapTypeCombo, *serviceCombo, *proxyCombo;
+  QHash<QtMobility::QGraphicsGeoMap::MapType, QString> mapTypes;
+  QToolButton *zoomin, *zoomout;
+  QAction *zoomInAction;
+  QAction *zoomOutAction;
+  QList<Landmark *> points;
+  int centeredpoint;
+
+  bool findServices(void);
+  void findproxy(void);
+  void populateMapTypeCombo();
+  bool IsUptodate(void);
+  void SetUptodate(void);
+  void Reset(void);
+  void XmlEvent(QDomElement dom);
+  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
+
+  void RemovePoints(void);
+  void AddPoints(QtMobility::QGraphicsGeoMap *geoMap);
+
+private slots:
+  void changeMapType(int index);
+  void selectService(int index);
+  void changeproxy(int index);
+  void updateZoom(qreal value);
+  void zoomIn(void);
+  void zoomOut(void);
+};
+
+#endif // MAP_H
Index: tags/latest/tools/FlairGCS/src/Picture.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Picture.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Picture.cpp	(revision 209)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Picture.h"
+#include "Layout.h"
+#include <QMenu>
+#include <QInputDialog>
+#include <QLabel>
+#include <QMouseEvent>
+#include <QGroupBox>
+#include <QVBoxLayout>
+
+Picture::Picture(Layout *parent, int row, int col, QString name, uint16_t width,
+                 uint16_t height, bool enabled, int period)
+    : DataRemote(name, "Picture", parent, enabled, period) {
+  box = new QGroupBox(name);
+  box->setObjectName(name);
+
+  parent->addWidget(box, row, col);
+
+  label = new QLabel();
+
+  layout = new QVBoxLayout;
+  layout->addWidget(label);
+  box->setLayout(layout);
+
+  visible_widget = box;
+
+  label->setAlignment(Qt::AlignCenter);
+
+  im_width = width;
+  im_height = height;
+  label->setMinimumSize(width, height);
+  label->setMaximumSize(width, height);
+  receivesize = width * height;
+
+  for (int i = 0; i < 256; i++) {
+    color_table.append(qRgb(i, i, i));
+  }
+
+  label->installEventFilter(this);
+}
+
+Picture::~Picture() { delete layout; }
+
+void Picture::BufEvent(char **buf, int *buf_size, uint16_t period,
+                       bool big_endian) {
+  if (big_endian)
+    printf("Picture::BufEvent, big endian not handled\n");
+
+  if (IsEnabled() == false || RefreshRate_ms() != period)
+    return;
+
+  if ((*buf_size) >= im_width * im_height) {
+    QImage image = QImage((const uchar *)*buf, im_width, im_height,
+                          QImage::Format_Indexed8); // Format_RGB888);
+    *buf += im_width *im_height;
+    image.setColorTable(color_table);
+
+    label->setPixmap(QPixmap::fromImage(image));
+  } else
+    printf("buffer trop petit\n");
+}
+
+bool Picture::eventFilter(QObject *o, QEvent *e) {
+  if (o == label) {
+    switch (e->type()) {
+    case QEvent::MouseButtonPress: {
+      mousePressEvent((QMouseEvent *)e);
+      break;
+    }
+
+    default:
+      break;
+    }
+  }
+  return label->eventFilter(o, e);
+}
+
+void Picture::mousePressEvent(QMouseEvent *event) {
+
+  if (event->x() > 0 && event->x() < label->width() && event->y() > 0 &&
+      event->y() < label->height() && event->button() == Qt::RightButton) {
+
+    QMenu *menu = new QMenu("nom", label);
+    // ajout des actions
+    QAction *a, *z;
+
+    a = menu->addAction("get frame");
+    a->setEnabled(!auto_refresh);
+
+    appendmenu(menu);
+    z = execmenu(label, menu, event->globalPos());
+    delete menu;
+  }
+}
+
+void Picture::XmlEvent(QDomElement dom) { XmlSetup(dom); }
Index: tags/latest/tools/FlairGCS/src/Picture.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Picture.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Picture.h	(revision 209)
@@ -0,0 +1,43 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef PICTURE_H
+#define PICTURE_H
+
+#include <stdint.h>
+#include "DataRemote.h"
+#include <QRgb>
+#include <QVector>
+
+class Layout;
+class QGroupBox;
+class QMouseEvent;
+class QLabel;
+class QVBoxLayout;
+
+class Picture : public DataRemote {
+  Q_OBJECT
+
+public:
+  Picture(Layout *parent, int row, int col, QString name, uint16_t width,
+          uint16_t height, bool enabled, int period);
+  ~Picture();
+
+protected:
+  void mousePressEvent(QMouseEvent *event);
+
+private:
+  QGroupBox *box;
+  QLabel *label;
+  QVBoxLayout *layout;
+  QVector<QRgb> color_table;
+  uint16_t im_width;
+  uint16_t im_height;
+
+  bool eventFilter(QObject *, QEvent *);
+  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
+  void XmlEvent(QDomElement dom);
+};
+
+#endif // PICTURE_H
Index: tags/latest/tools/FlairGCS/src/PushButton.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/PushButton.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/PushButton.cpp	(revision 209)
@@ -0,0 +1,25 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "PushButton.h"
+#include "ConnectionLayout.h"
+#include <QPushButton>
+
+PushButton::PushButton(Layout *parent, int row, int col, QString name)
+    : XmlWidget(name, "PushButton", parent) {
+  button = new QPushButton(name);
+  parent->addWidget(button, row, col);
+
+  SetValue("0");
+
+  connect(button, SIGNAL(clicked(bool)), this, SLOT(button_clicked(bool)));
+}
+
+PushButton::~PushButton() { delete button; }
+
+void PushButton::button_clicked(bool state) {
+  SetValue("1");
+  connectionLayout()->XmlToSend(XmlDoc());
+  SetValue("0");
+}
Index: tags/latest/tools/FlairGCS/src/PushButton.h
===================================================================
--- tags/latest/tools/FlairGCS/src/PushButton.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/PushButton.h	(revision 209)
@@ -0,0 +1,27 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef PUSHBUTTON_H
+#define PUSHBUTTON_H
+
+#include "XmlWidget.h"
+
+class QPushButton;
+class Layout;
+
+class PushButton : public XmlWidget {
+  Q_OBJECT
+
+public:
+  PushButton(Layout *parent, int row, int col, QString name);
+  ~PushButton();
+
+private:
+  QPushButton *button;
+
+private slots:
+  void button_clicked(bool state);
+};
+
+#endif // PUSHBUTTON_H
Index: tags/latest/tools/FlairGCS/src/RangeFinderPlot.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/RangeFinderPlot.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/RangeFinderPlot.cpp	(revision 209)
@@ -0,0 +1,251 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "RangeFinderPlot.h"
+#include "Layout.h"
+#include <stdlib.h>
+#include <qwt_plot_grid.h>
+#include <qwt_plot_magnifier.h>
+#include <qwt_scale_widget.h>
+#include <qwt_plot_panner.h>
+#include <qwt_plot_rescaler.h>
+#include <qwt_plot_shapeitem.h>
+#include <QMouseEvent>
+#include <QMenu>
+#include <QInputDialog>
+#include <qendian.h>
+#include <qmath.h>
+
+RangeFinderPlot::RangeFinderPlot(Layout *parent, int row, int col, QString name,
+                                 QString x_name, QString y_name, float xmin,
+                                 float xmax, float ymin, float ymax,
+                                 float start_angle, float end_angle,
+                                 uint32_t nb_samples, QString data_type,
+                                 bool invert_axis, bool enabled, int period)
+    : DataRemote(name, "RangeFinderPlot", parent, enabled, period) {
+  invert_axis = true;
+  this->start_angle = start_angle;
+  this->end_angle = end_angle;
+  this->nb_samples = nb_samples;
+  this->data_type = data_type;
+  this->invert_axis = invert_axis;
+
+  if (data_type == "float") {
+    receivesize = nb_samples * sizeof(float);
+  } else if (data_type == "int8_t") {
+    receivesize = nb_samples * sizeof(int8_t);
+  } else if (data_type == "int16_t") {
+    receivesize = nb_samples * sizeof(int16_t);
+  } else {
+    printf("RangeFinderPlot::RangeFinderPlot unknown type %s\n",
+           data_type.toLocal8Bit().constData());
+  }
+
+  plot = new QwtPlot(NULL);
+  plot->setEnabled(enabled);
+  // plot->setAutoReplot( false );
+
+  parent->addWidget(plot, row, col);
+  visible_widget = plot;
+
+  plot->setTitle(name);
+
+  // grid
+  QwtPlotGrid *grid = new QwtPlotGrid;
+  grid->setPen(QPen(Qt::black, 0, Qt::DotLine));
+  grid->attach(plot);
+
+  plot->updateAxes();
+
+  // zoomer
+  QwtPlotMagnifier *zoomer = new QwtPlotMagnifier(plot->canvas());
+  zoomer->setMouseButton(Qt::RightButton, Qt::ControlModifier);
+
+  // scroller
+  QwtPlotPanner *scroller = new QwtPlotPanner(plot->canvas());
+
+  // Axis
+  if (!invert_axis) {
+    plot->setAxisTitle(QwtPlot::xBottom, x_name);
+    setXAxisScale(xmin, xmax);
+
+    plot->setAxisTitle(QwtPlot::yLeft, y_name);
+    setYAxisScale(ymin, ymax);
+  } else {
+    plot->setAxisTitle(QwtPlot::xBottom, y_name);
+    setXAxisScale(ymin, ymax);
+
+    plot->setAxisTitle(QwtPlot::yLeft, x_name);
+    setYAxisScale(xmin, xmax);
+  }
+
+  QwtPlotRescaler *rescaler = new QwtPlotRescaler(plot->canvas());
+  rescaler->setRescalePolicy(QwtPlotRescaler::Fixed);
+
+  //( void ) new QwtPlotMagnifier( plot->canvas() );
+
+  plot->canvas()->installEventFilter(this);
+
+  for (uint32_t i = 0; i < nb_samples; i++) {
+    addTriangle(start_angle + i * (end_angle - start_angle + 1) / nb_samples,
+                start_angle +
+                    (i + 1) * (end_angle - start_angle + 1) / nb_samples);
+  }
+}
+
+RangeFinderPlot::~RangeFinderPlot() { delete plot; }
+
+void RangeFinderPlot::XmlEvent(QDomElement dom) { XmlSetup(dom); }
+
+bool RangeFinderPlot::eventFilter(QObject *o, QEvent *e) {
+  if (o == plot->canvas()) {
+    switch (e->type()) {
+    case QEvent::MouseButtonPress: {
+      mousePressEvent((QMouseEvent *)e);
+      break;
+    }
+
+    default:
+      break;
+    }
+  }
+  return plot->eventFilter(o, e);
+}
+
+//
+//  Set a plain canvas frame and align the scales to it
+//
+void RangeFinderPlot::alignScales(void) {
+  // The code below shows how to align the scales to
+  // the canvas frame, but is also a good example demonstrating
+  // why the spreaded API needs polishing.
+  /*
+      plot->canvas()->setFrameStyle(QFrame::Box | QFrame::Plain );
+      plot->canvas()->setLineWidth(1);
+  */
+  for (int i = 0; i < QwtPlot::axisCnt; i++) {
+    QwtScaleWidget *scaleWidget = (QwtScaleWidget *)plot->axisWidget(i);
+    if (scaleWidget)
+      scaleWidget->setMargin(0);
+
+    QwtScaleDraw *scaleDraw = (QwtScaleDraw *)plot->axisScaleDraw(i);
+    if (scaleDraw)
+      scaleDraw->enableComponent(QwtAbstractScaleDraw::Backbone, false);
+  }
+}
+
+void RangeFinderPlot::setXAxisScale(float xmin, float xmax) {
+  xmin_orig = xmin;
+  xmax_orig = xmax;
+  plot->setAxisScale(QwtPlot::xBottom, xmin_orig, xmax_orig);
+}
+
+void RangeFinderPlot::setYAxisScale(float ymin, float ymax) {
+  ymin_orig = ymin;
+  ymax_orig = ymax;
+  plot->setAxisScale(QwtPlot::yLeft, ymin_orig, ymax_orig);
+}
+
+void RangeFinderPlot::BufEvent(char **buf, int *buf_size, uint16_t period,
+                               bool big_endian) {
+  plot->setEnabled(IsEnabled());
+  if (IsEnabled() == false || RefreshRate_ms() != period)
+    return;
+
+  for (uint32_t i = 0; i < nb_samples; i++) {
+    if (data_type == "float") {
+      uint32_t data_raw;
+      float *data = (float *)&data_raw;
+
+      memcpy((void *)&data_raw, *buf, sizeof(uint32_t));
+      *buf += sizeof(uint32_t);
+      if (big_endian == true)
+        data_raw = qFromBigEndian(data_raw);
+      SetTriangle(i, *data);
+    } else if (data_type == "int8_t") {
+      int8_t data;
+      memcpy((void *)&data, *buf, sizeof(data));
+      *buf += sizeof(data);
+      SetTriangle(i, data);
+    } else if (data_type == "int16_t") {
+      int16_t data;
+      memcpy((void *)&data, *buf, sizeof(data));
+      *buf += sizeof(data);
+      if (big_endian == true)
+        data = qFromBigEndian(data);
+      SetTriangle(i, data);
+    } else {
+      printf("RangeFinderPlot::BufEvent unknown type %s\n",
+             data_type.toLocal8Bit().constData());
+    }
+  }
+
+  plot->replot();
+}
+
+void RangeFinderPlot::addTriangle(float angle_min, float angle_max) {
+  QwtPlotShapeItem *item = new QwtPlotShapeItem();
+
+  item->setRenderHint(QwtPlotItem::RenderAntialiased, true);
+  item->attach(plot);
+  triangles.append(item);
+}
+
+void RangeFinderPlot::SetTriangle(uint32_t id, float length) {
+  QPainterPath path;
+  QPolygonF triangle;
+  float angle_min =
+      start_angle + id * (end_angle - start_angle + 1) / nb_samples;
+  float angle_max =
+      start_angle + (id + 1) * (end_angle - start_angle + 1) / nb_samples;
+
+  if (invert_axis) {
+    angle_min = 90 - angle_min;
+    angle_max = 90 - angle_max;
+  }
+
+  triangle += QPointF(0, 0);
+  triangle += QPointF(length * cos(angle_min * M_PI / 180.),
+                      length * sin(angle_min * M_PI / 180.));
+  triangle += QPointF(length * cos(angle_max * M_PI / 180.),
+                      length * sin(angle_max * M_PI / 180.));
+
+  path.addPolygon(triangle);
+
+  path.closeSubpath();
+  triangles.at(id)->setShape(path);
+
+  QColor fillColor = "SandyBrown";
+  fillColor.setAlpha(200);
+
+  QPen pen(QColor("SandyBrown"), 1);
+  pen.setJoinStyle(Qt::MiterJoin);
+  triangles.at(id)->setPen(pen);
+  triangles.at(id)->setBrush(fillColor);
+}
+
+// context menu
+void RangeFinderPlot::mousePressEvent(QMouseEvent *event) {
+  if (event->button() == Qt::RightButton) {
+    QMenu *menu = new QMenu("nom", plot);
+    // ajout des actions
+    QAction *a, *z;
+
+    a = menu->addAction("reset y zoom");
+
+    appendmenu(menu);
+    z = execmenu(plot, menu, event->globalPos());
+    delete menu;
+
+    if (z == a) {
+      // zoom to original size
+      if (!invert_axis) {
+        plot->setAxisScale(QwtPlot::yLeft, ymin_orig, ymax_orig);
+      } else {
+        plot->setAxisScale(QwtPlot::yLeft, xmin_orig, xmax_orig);
+      }
+      plot->replot();
+    }
+  }
+}
Index: tags/latest/tools/FlairGCS/src/RangeFinderPlot.h
===================================================================
--- tags/latest/tools/FlairGCS/src/RangeFinderPlot.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/RangeFinderPlot.h	(revision 209)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef RANGEFINDERPLOT_H_INCLUDED
+#define RANGEFINDERPLOT_H_INCLUDED
+
+#include "DataRemote.h"
+#include <stdint.h>
+
+class QwtPlotShapeItem;
+class Layout;
+class QwtPlot;
+class QMouseEvent;
+
+class RangeFinderPlot : public DataRemote {
+  Q_OBJECT
+
+public:
+  RangeFinderPlot(Layout *parent, int row, int col, QString name,
+                  QString x_name, QString y_name, float xmin, float xmax,
+                  float ymin, float ymax, float start_angle, float end_angle,
+                  uint32_t nb_samples, QString data_type, bool invert_axis,
+                  bool enabled, int period);
+  ~RangeFinderPlot();
+
+protected:
+  void mousePressEvent(QMouseEvent *event);
+
+private:
+  void setYAxisScale(float ymin, float ymax);
+  void setXAxisScale(float xmin, float xmax);
+  void addTriangle(float angle_min, float angle_max);
+  void SetTriangle(uint32_t id, float length);
+  QwtPlot *plot;
+  void XmlEvent(QDomElement dom);
+  void alignScales(void);
+  float xmin_orig, xmax_orig, ymin_orig, ymax_orig;
+  float start_angle, end_angle;
+  uint32_t nb_samples;
+  QString data_type;
+  QList<QwtPlotShapeItem *> triangles;
+  bool invert_axis;
+
+  bool eventFilter(QObject *, QEvent *);
+  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
+};
+
+#endif // RANGEFINDERPLOT_H_INCLUDED
Index: tags/latest/tools/FlairGCS/src/SpinBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/SpinBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/SpinBox.cpp	(revision 209)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "SpinBox.h"
+#include <QFormLayout>
+#include "Layout.h"
+#include <QSpinBox>
+
+SpinBox::SpinBox(Layout *parent, int row, int col, QString name, QString suffix,
+                 int value, int min, int max, int step)
+    : FormLayout(parent, row, col, name, "SpinBox") {
+  spinbox = new QSpinBox();
+
+  spinbox->setRange(min, max);
+  spinbox->setSingleStep(step);
+  spinbox->setValue(value);
+  spinbox->setSuffix(suffix);
+  spinbox_value = value;
+
+  object_layout->addRow(name, spinbox);
+
+  connect(spinbox, SIGNAL(valueChanged(int)), this, SLOT(valuechanged(int)));
+
+  SetValue(QString::number(spinbox_value));
+}
+
+SpinBox::~SpinBox() { delete spinbox; }
+
+void SpinBox::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  visible_widget->setPalette(black_pal);
+}
+
+void SpinBox::ui_to_var(void) { spinbox_value = spinbox->value(); }
+
+void SpinBox::ui_to_xml(void) { SetValue(QString::number(spinbox->value())); }
+
+void SpinBox::Reset(void) { spinbox->setValue(spinbox_value); }
+
+void SpinBox::LoadEvent(QDomElement dom) {
+  if (spinbox->isEnabled() == true) {
+    spinbox->setValue((dom.attribute("value")).toInt());
+  }
+}
+
+void SpinBox::valuechanged(int value) {
+  if (value != spinbox_value) {
+    visible_widget->setPalette(red_pal);
+  } else {
+    visible_widget->setPalette(black_pal);
+  }
+}
Index: tags/latest/tools/FlairGCS/src/SpinBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/SpinBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/SpinBox.h	(revision 209)
@@ -0,0 +1,35 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef SPINBOX_H
+#define SPINBOX_H
+
+#include "FormLayout.h"
+
+class Layout;
+class QSpinBox;
+
+class SpinBox : public FormLayout {
+  Q_OBJECT
+
+public:
+  SpinBox(Layout *parent, int row, int col, QString name, QString suffix,
+          int value, int min, int max, int step);
+  ~SpinBox();
+
+private:
+  QSpinBox *spinbox;
+  int spinbox_value;
+  void SetUptodate(void);
+  void Reset(void);
+  void LoadEvent(QDomElement dom);
+
+  void ui_to_var(void);
+  void ui_to_xml(void);
+
+private slots:
+  void valuechanged(int value);
+};
+
+#endif // SPINBOX_H
Index: tags/latest/tools/FlairGCS/src/Tab.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Tab.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Tab.cpp	(revision 209)
@@ -0,0 +1,21 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Tab.h"
+#include "TabWidget.h"
+#include <QGridLayout>
+
+Tab::Tab(TabWidget *parent, QString name, int position)
+    : Layout(new QWidget(), parent, name, "Tab") {
+  parent_tab = parent;
+  onglet = getQGridLayout()->parentWidget();
+  onglet->setObjectName(name);
+  if (position == -1) {
+    parent->tab->addTab(onglet, name);
+  } else {
+    parent->tab->insertTab(position, onglet, name);
+  }
+}
+
+Tab::~Tab() { parent_tab->tab->removeTab(parent_tab->tab->indexOf(onglet)); }
Index: tags/latest/tools/FlairGCS/src/Tab.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Tab.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Tab.h	(revision 209)
@@ -0,0 +1,23 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef TAB_H
+#define TAB_H
+
+#include "Layout.h"
+
+class TabWidget;
+
+class Tab : public Layout {
+
+public:
+  Tab(TabWidget *parent, QString name, int position);
+  ~Tab();
+
+private:
+  TabWidget *parent_tab;
+  QWidget *onglet;
+};
+
+#endif // TAB_H
Index: tags/latest/tools/FlairGCS/src/TabWidget.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/TabWidget.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/TabWidget.cpp	(revision 209)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "TabWidget.h"
+#include "Tab.h"
+#include <stdio.h>
+#include "Layout.h"
+
+//#include "qledindicator.h"
+
+TabWidget::TabWidget(Layout *parent, int row, int col, QString name,
+                     QTabWidget::TabPosition position)
+    : XmlWidget(name, "TabWidget", parent) {
+  tab = new QTabWidget();
+  // tab->setTabShape(QTabWidget::Triangular);
+  // tab->setDocumentMode(true);
+  parent->addWidget(tab, row, col);
+  tab->setTabPosition(position);
+  SetIsContainer(true);
+  SetIsExpandable(true);
+  visible_widget = tab;
+
+  // QLedIndicator* led=new QLedIndicator(tab);
+  // tab->setCornerWidget(led,Qt::TopLeftCorner);
+}
+
+TabWidget::~TabWidget() {}
+
+void TabWidget::XmlEvent(QDomElement dom) {
+  QString type = dom.tagName();
+  QString name = dom.attribute("name");
+  int position = dom.attribute("position").toInt();
+
+  if (type == "Tab") {
+    Tab *layout = new Tab(this, name, position);
+  }
+}
+
+bool TabWidget::IsUptodate(void) {
+  for (int i = 0; i < childs->count(); i++) {
+    if (childs->at(i)->IsUptodate() == false)
+      return false;
+  }
+  return true;
+}
Index: tags/latest/tools/FlairGCS/src/TabWidget.h
===================================================================
--- tags/latest/tools/FlairGCS/src/TabWidget.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/TabWidget.h	(revision 209)
@@ -0,0 +1,27 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef TABWIDGET_H
+#define TABWIDGET_H
+
+#include "XmlWidget.h"
+#include <QTabWidget>
+
+class Layout;
+
+class TabWidget : public XmlWidget {
+  friend class Tab;
+
+public:
+  TabWidget(Layout *parent, int row, int col, QString name,
+            QTabWidget::TabPosition position);
+  ~TabWidget();
+  bool IsUptodate(void);
+
+private:
+  QTabWidget *tab;
+  void XmlEvent(QDomElement dom);
+};
+
+#endif // TABWIDGET_H
Index: tags/latest/tools/FlairGCS/src/TextEdit.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/TextEdit.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/TextEdit.cpp	(revision 209)
@@ -0,0 +1,33 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "TextEdit.h"
+#include "Layout.h"
+#include <QPushButton>
+#include <QGridLayout>
+#include <QTextEdit>
+
+TextEdit::TextEdit(Layout *parent, int row, int col, QString name)
+    : XmlWidget(name, "TextEdit", parent) {
+
+  visible_widget = new QWidget();
+  visible_widget->setObjectName(name);
+
+  layout = new QGridLayout(visible_widget);
+  clear = new QPushButton("Effacer");
+  text = new QTextEdit();
+
+  layout->addWidget(text, 0, 0);
+  layout->addWidget(clear, 1, 0);
+
+  connect(clear, SIGNAL(clicked(bool)), text, SLOT(clear()));
+
+  parent->addWidget(visible_widget, row, col);
+}
+
+TextEdit::~TextEdit() {}
+
+void TextEdit::XmlEvent(QDomElement dom) {
+  text->append(dom.attribute("value"));
+}
Index: tags/latest/tools/FlairGCS/src/TextEdit.h
===================================================================
--- tags/latest/tools/FlairGCS/src/TextEdit.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/TextEdit.h	(revision 209)
@@ -0,0 +1,27 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef TEXTEDIT_H
+#define TEXTEDIT_H
+
+#include "XmlWidget.h"
+
+class QTextEdit;
+class QPushButton;
+class QGridLayout;
+class Layout;
+
+class TextEdit : public XmlWidget {
+public:
+  TextEdit(Layout *parent, int row, int col, QString name);
+  ~TextEdit();
+
+private:
+  QGridLayout *layout;
+  QPushButton *clear;
+  QTextEdit *text;
+  void XmlEvent(QDomElement dom);
+};
+
+#endif // TEXTEDIT_H
Index: tags/latest/tools/FlairGCS/src/UdtSocket.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/UdtSocket.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/UdtSocket.cpp	(revision 209)
@@ -0,0 +1,231 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "UdtSocket.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <QApplication>
+#include <QtEndian>
+#include <QDir>
+#include <QDate>
+#include "file_ui.h"
+#include "communication.h"
+
+#ifndef WIN32
+#include <arpa/inet.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+using namespace std;
+
+UdtSocket::UdtSocket(UDTSOCKET file_socket, UDTSOCKET com_socket, QString name)
+    : QObject() {
+  this->file_socket = file_socket;
+  this->com_socket = com_socket;
+  this->name = name;
+  stop = false;
+  file_dialog = new file_ui();
+
+  bool blocking = true;
+  UDT::setsockopt(file_socket, 0, UDT_RCVSYN, &blocking, sizeof(bool));
+
+  heartbeat_timer = new QTimer(this);
+  connect(heartbeat_timer, SIGNAL(timeout()), this, SLOT(heartbeat()));
+  heartbeat_timer->start(200);
+}
+
+UdtSocket::~UdtSocket() {
+  heartbeat_timer->stop();
+
+  UDT::close(file_socket);
+  UDT::close(com_socket);
+
+  file_dialog->deleteLater();
+}
+
+// send signal to uav, to check connectivity through a watchdog
+// this is necessary because we use udt (udp based), and we cannot check
+// disconnection of ground station
+void UdtSocket::heartbeat(void) {
+  char data = WATCHDOG_HEADER;
+  write(&data, 1);
+}
+
+void UdtSocket::kill(void) {
+  printf("disconnected\n");
+  stop = true;
+  deleteLater();
+}
+
+void UdtSocket::handleConnections(void) {
+  while (!stop) {
+    int eid = UDT::epoll_create();
+    if (eid < 0) {
+      printf("epoll_create error: %s\n", UDT::getlasterror().getErrorMessage());
+    }
+
+    if (UDT::epoll_add_usock(eid, file_socket) < 0) {
+      if (UDT::getlasterror().getErrorCode() == 5004) {
+        printf("epoll_add_usock error\n");
+        break;
+      } else {
+        printf("epoll_add_usock error: %s\n",
+               UDT::getlasterror().getErrorMessage());
+      }
+    }
+    if (UDT::epoll_add_usock(eid, com_socket) < 0) {
+      if (UDT::getlasterror().getErrorCode() == 5004) {
+        printf("epoll_add_usock error\n");
+        break;
+      } else {
+        printf("epoll_add_usock error: %s\n",
+               UDT::getlasterror().getErrorMessage());
+      }
+    }
+
+    set<UDTSOCKET> readfds;
+
+    int rv = UDT::epoll_wait(eid, &readfds, NULL, 10);
+
+    if (rv == -1) {
+      if (UDT::getlasterror().getErrorCode() != 6003)
+        printf("prob %i\n", UDT::getlasterror().getErrorCode());
+      // printf("wait\n");
+    } else if (rv == 0) {
+      printf("timeout\n"); // a timeout occured
+    } else {
+      /*
+      if(UDT::getlasterror().getErrorCode()==2001) {
+          UDT::epoll_release(eid);
+      }*/
+      for (set<UDTSOCKET>::iterator i = readfds.begin(); i != readfds.end();
+           i++) {
+        // printf("a\n");
+        if (*i == file_socket)
+          receiveFile();
+        if (*i == com_socket)
+          receiveData();
+      }
+    }
+
+    UDT::epoll_remove_usock(eid, file_socket);
+    UDT::epoll_remove_usock(eid, com_socket);
+    UDT::epoll_release(eid);
+
+    QCoreApplication::processEvents();
+  }
+  kill();
+}
+
+void UdtSocket::receiveFile(void) {
+  char *recv_buf;
+  int bytesRead;
+  static bool flag_new_seq = true;
+  static QString folder_name;
+
+  // receive file info
+  recv_buf = (char *)malloc(1024);
+  bytesRead = UDT::recvmsg(file_socket, recv_buf, 1024);
+
+  if (bytesRead <= 0) {
+    free(recv_buf);
+    return;
+  }
+
+  int size;
+  memcpy(&size, &recv_buf[1], sizeof(int));
+  if (recv_buf[0] == FILE_INFO_BIG_ENDIAN)
+    size = qFromBigEndian(size);
+
+  // printf("file_ui recu %i %x\n",bytesRead,recv_buf[0]);
+  if ((recv_buf[0] == FILE_INFO_LITTLE_ENDIAN ||
+       recv_buf[0] == FILE_INFO_BIG_ENDIAN) &&
+      size > 0) {
+    if (flag_new_seq == true) {
+      // create directory for storage
+      QDateTime dateTime = QDateTime::currentDateTime();
+      folder_name = dateTime.toString("yyyyMMdd_hhmm") + "_" + name;
+      if (QDir().exists(folder_name) == true) {
+        folder_name = dateTime.toString("yyyyMMdd_hhmm_ss") + "_" + name;
+      }
+      QDir().mkdir(folder_name);
+
+      flag_new_seq = false;
+      file_dialog->log("Creating directory " + folder_name);
+    }
+
+    QString file_name =
+        QString::fromAscii((const char *)&recv_buf[5], bytesRead - 5);
+    QString file_path = folder_name + "/" + file_name;
+    file_dialog->log(
+        QString("receiving %1 (%2 bytes)").arg(file_name).arg(size));
+    QFile fichier(file_path);
+
+    if (!fichier.open(QIODevice::WriteOnly)) {
+      file_dialog->log("      could not write to file!");
+    } else {
+      // receive file
+      recv_buf = (char *)realloc((void *)recv_buf, size);
+      bytesRead = UDT::recvmsg(file_socket, recv_buf, size);
+      if (bytesRead != size) {
+        file_dialog->log(QString("      error receiving file! (%1/%2)")
+                             .arg(bytesRead)
+                             .arg(size));
+        free(recv_buf);
+        return;
+      } else {
+        file_dialog->log("      ok");
+      }
+
+      QDataStream stream(&fichier);
+      stream.writeRawData(recv_buf, size);
+      fichier.close();
+
+      file_dialog->addFile(file_path);
+    }
+
+    free(recv_buf);
+  } else if (recv_buf[0] == END) {
+    file_dialog->endOfFiles();
+    flag_new_seq = true;
+    //end ack
+    UDT::sendmsg(file_socket,&recv_buf[0],1);
+  }
+}
+
+void UdtSocket::receiveData(void) {
+  while (1) {
+    int buf_size;
+    int opt_size;
+    UDT::getsockopt(com_socket, 0, UDT_RCVBUF, &buf_size, &opt_size);
+
+    char *buf = (char *)malloc(buf_size);
+    int size;
+    size = UDT::recvmsg(com_socket, buf, buf_size);
+    buf = (char *)realloc(buf, size + 1);
+
+    if (size > 0) {
+      buf[size] = 0;
+      emit dataReady(buf, size + 1);
+    } else {
+      // if(UDT::getlasterror().getErrorCode()!=6002) printf("udt socket:
+      // %s\n",UDT::getlasterror().getErrorMessage());
+      free(buf);
+      break;
+    }
+  }
+}
+
+void UdtSocket::write(const char *buf, qint64 size) {
+  // printf("write\n%s\n",buf);
+  qint64 sent = UDT::sendmsg(com_socket, buf, size, -1, true);
+  if (sent != size) {
+    printf("erreur envoi: %s\n", UDT::getlasterror().getErrorMessage());
+    if (UDT::getlasterror().getErrorCode() == 2001) {
+      stop = true;
+    }
+  }
+}
Index: tags/latest/tools/FlairGCS/src/UdtSocket.h
===================================================================
--- tags/latest/tools/FlairGCS/src/UdtSocket.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/UdtSocket.h	(revision 209)
@@ -0,0 +1,41 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef UDTSOCKET_H
+#define UDTSOCKET_H
+
+#include <udt.h>
+#include <QObject>
+#include <QTimer>
+
+class file_ui;
+
+class UdtSocket : public QObject {
+  Q_OBJECT
+
+public:
+  UdtSocket(UDTSOCKET file_socket, UDTSOCKET com_socket, QString name);
+  ~UdtSocket();
+
+private:
+  UDTSOCKET file_socket, com_socket;
+  file_ui *file_dialog;
+  bool stop;
+  QString name;
+  QTimer *heartbeat_timer;
+  void receiveData(void);
+  void receiveFile(void);
+
+signals:
+  void dataReady(char *, int size);
+
+public slots:
+  void handleConnections(void);
+  void kill(void);
+  void write(const char *buf, qint64 size);
+private slots:
+  void heartbeat(void);
+};
+
+#endif // UDTSOCKET_H
Index: tags/latest/tools/FlairGCS/src/Vector3DSpinBox.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/Vector3DSpinBox.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Vector3DSpinBox.cpp	(revision 209)
@@ -0,0 +1,179 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "Vector3DSpinBox.h"
+#include <QLineEdit>
+#include <QMenu>
+#include <QContextMenuEvent>
+#include <QFormLayout>
+#include <QGroupBox>
+#include "Layout.h"
+
+Vector3DSpinBox::Vector3DSpinBox(Layout *parent, int row, int col, QString name,
+                                 QString value[3], float min, float max,
+                                 float step, int decimals)
+    : XmlWidget(name, "Vector3DSpinBox", parent) {
+  for (int i = 0; i < 3; i++) {
+    doublespinbox[i].setRange(min, max);
+    doublespinbox[i].setSingleStep(step);
+    doublespinbox[i].setDecimals(decimals);
+  }
+
+  adjust_decimals(value);
+
+  for (int i = 0; i < 3; i++) {
+    doublespinbox[i].setValue(value[i].toDouble());
+    doublespinbox_value[i] = doublespinbox[i].cleanText();
+
+    // event filter for qdoublespinbox and its child (qlinedit and incremnt
+    // qbuttons)
+    doublespinbox[i].installEventFilter(this);
+    QObjectList o_list = doublespinbox[i].children();
+    for (int j = 0; j < o_list.length(); j++) {
+      QLineEdit *cast = qobject_cast<QLineEdit *>(o_list[j]);
+      if (cast)
+        cast->installEventFilter(this);
+    }
+
+    connect(&doublespinbox[i], SIGNAL(valueChanged(const QString &)), this,
+            SLOT(valuechanged(const QString &)));
+  }
+
+  SetValues(value);
+
+  // creation et ajout QGroupBox
+  box = new QGroupBox(name);
+  box->setObjectName(name);
+  visible_widget = box;
+  parent->addWidget(box, row, col);
+  qgridlayout = new QGridLayout(new QWidget());
+  box->setLayout(qgridlayout);
+
+  AddElement("x:", 0);
+  AddElement("y:", 1);
+  AddElement("z:", 2);
+}
+
+Vector3DSpinBox::~Vector3DSpinBox() {}
+
+void Vector3DSpinBox::SetValues(QString value[3]) {
+  SetAttribute("value_x", value[0]);
+  SetAttribute("value_y", value[1]);
+  SetAttribute("value_z", value[2]);
+}
+
+void Vector3DSpinBox::AddElement(QString name, int index) {
+  QWidget *widget = new QWidget();
+  QFormLayout *object_layout = new QFormLayout(widget);
+  object_layout->setHorizontalSpacing(2);
+  object_layout->setVerticalSpacing(2);
+  object_layout->setContentsMargins(2, 2, 2, 2);
+
+  object_layout->addRow(name, &doublespinbox[index]);
+
+  qgridlayout->addWidget(widget, index, 0);
+}
+
+void Vector3DSpinBox::adjust_decimals(QString value[3]) {
+  for (int i = 0; i < 3; i++) {
+    // auto adjust decimals
+    QLocale locale;
+    value[i].remove(locale.groupSeparator());
+
+    QStringList parts = value[i].split(locale.decimalPoint());
+    if (parts.count() == 2) {
+      doublespinbox[i].setDecimals(parts[1].size());
+    }
+  }
+}
+
+bool Vector3DSpinBox::eventFilter(QObject *object, QEvent *event) {
+  for (int i = 0; i < 3; i++) {
+    if (object == &doublespinbox[i] &&
+        event->type() == QEvent::MouseButtonPress) {
+      if (((QMouseEvent *)event)->button() == Qt::RightButton) {
+        QMenu *menu = new QMenu("menu", doublespinbox);
+        QAction *a, *b, *c, *z;
+
+        a = menu->addAction("add decimal");
+        b = menu->addAction("remove decimal");
+
+        if (doublespinbox[i].decimals() == 0)
+          b->setEnabled(false);
+        z = menu->exec(((QMouseEvent *)event)->globalPos());
+
+        if (z == a)
+          doublespinbox[i].setDecimals(doublespinbox[i].decimals() + 1);
+        if (z == b)
+          doublespinbox[i].setDecimals(doublespinbox[i].decimals() - 1);
+        delete menu;
+        return true;
+      }
+    }
+  }
+  return object->eventFilter(object, event);
+}
+
+void Vector3DSpinBox::SetUptodate(void) {
+  ui_to_var();
+  ui_to_xml();
+  visible_widget->setPalette(black_pal);
+}
+
+void Vector3DSpinBox::ui_to_var(void) {
+  for (int i = 0; i < 3; i++) {
+    doublespinbox_value[i] = doublespinbox[i].cleanText();
+  }
+}
+
+void Vector3DSpinBox::ui_to_xml(void) {
+  SetAttribute("value_x", doublespinbox[0].cleanText());
+  SetAttribute("value_y", doublespinbox[1].cleanText());
+  SetAttribute("value_z", doublespinbox[2].cleanText());
+}
+
+void Vector3DSpinBox::Reset(void) {
+  // le setvalue fait un arrondi pour l'affichage, la variable n'est donc plus
+  // egale
+  // on reprend la valeur de la boite et on force la couleur a noir
+  adjust_decimals(doublespinbox_value);
+  for (int i = 0; i < 3; i++) {
+    doublespinbox[i].setValue(doublespinbox_value[i].toDouble());
+    doublespinbox_value[i] = doublespinbox[i].cleanText();
+  }
+  visible_widget->setPalette(black_pal);
+}
+
+void Vector3DSpinBox::LoadEvent(QDomElement dom) {
+  if (doublespinbox[0].isEnabled()) {
+    doublespinbox[0].setValue((dom.attribute("value_x")).toDouble());
+  }
+  if (doublespinbox[1].isEnabled()) {
+    doublespinbox[1].setValue((dom.attribute("value_y")).toDouble());
+  }
+  if (doublespinbox[2].isEnabled()) {
+    doublespinbox[2].setValue((dom.attribute("value_z")).toDouble());
+  }
+}
+
+void Vector3DSpinBox::valuechanged(const QString &value) {
+  for (int i = 0; i < 3; i++) {
+    if ((QDoubleSpinBox *)sender() == &doublespinbox[i] &&
+        value != doublespinbox_value[i]) {
+      visible_widget->setPalette(red_pal);
+      return;
+    }
+  }
+  visible_widget->setPalette(black_pal);
+}
+
+bool Vector3DSpinBox::IsUptodate(void) {
+  // si le widget n'est pas enabled, sa palette est differente de rouge (greyed)
+  // donc on renvoit true
+  // permet de ne pas envoyer les modifs d'un widget disabled
+  // if(label->palette()==red_pal) return false;
+  if (visible_widget->palette() == red_pal)
+    return false;
+  return true;
+}
Index: tags/latest/tools/FlairGCS/src/Vector3DSpinBox.h
===================================================================
--- tags/latest/tools/FlairGCS/src/Vector3DSpinBox.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/Vector3DSpinBox.h	(revision 209)
@@ -0,0 +1,45 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef VECTOR3DSPINBOX_H
+#define VECTOR3DSPINBOX_H
+
+#include "XmlWidget.h"
+#include <QDoubleSpinBox>
+
+class Layout;
+class QGroupBox;
+class QGridLayout;
+
+class Vector3DSpinBox : public XmlWidget {
+  Q_OBJECT
+
+public:
+  // handle value as string, becouse double value are not exact
+  Vector3DSpinBox(Layout *parent, int row, int col, QString name,
+                  QString value[3], float min, float max, float step,
+                  int decimals);
+  ~Vector3DSpinBox();
+
+private:
+  QGridLayout *qgridlayout;
+  QGroupBox *box;
+  QDoubleSpinBox doublespinbox[3];
+  QString doublespinbox_value[3];
+  void AddElement(QString name, int index);
+  void SetUptodate(void);
+  void SetValues(QString value[3]);
+  void Reset(void);
+  void LoadEvent(QDomElement dom);
+  void ui_to_var(void);
+  void ui_to_xml(void);
+  bool eventFilter(QObject *o, QEvent *e);
+  void adjust_decimals(QString value[3]);
+  bool IsUptodate(void);
+
+private slots:
+  void valuechanged(const QString &value);
+};
+
+#endif // VECTOR3DSPINBOX_H
Index: tags/latest/tools/FlairGCS/src/XmlWidget.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/XmlWidget.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/XmlWidget.cpp	(revision 209)
@@ -0,0 +1,319 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "XmlWidget.h"
+#include <QWidget>
+#include "ConnectionLayout.h"
+#include <stdio.h>
+
+XmlWidget::XmlWidget(QString name, QString type, XmlWidget *parent)
+    : QObject() {
+  childs = new QList<XmlWidget *>;
+  isContainer = false;
+  isExpandable = false;
+  visible_widget = NULL;
+  parent_widget = parent;
+
+  red_pal.setColor(QPalette::Text, QColor(255, 0, 0));
+  red_pal.setColor(QPalette::Foreground, QColor(255, 0, 0));
+  red_pal_greyed.setColor(QPalette::Text, QColor(128, 0, 0));
+  red_pal_greyed.setColor(QPalette::Foreground, QColor(128, 0, 0));
+
+  black_pal.setColor(QPalette::Text, QColor(0, 0, 0));
+  black_pal.setColor(QPalette::Foreground, QColor(0, 0, 0));
+  black_pal_greyed.setColor(QPalette::Text, QColor(128, 128, 128));
+  black_pal_greyed.setColor(QPalette::Foreground, QColor(128, 128, 128));
+
+  setObjectName(name);
+
+  if (parent != NULL) {
+    parent->childs->append(this);
+
+    document = parent->document.cloneNode(true).toDocument();
+
+    write_elem = QDomElement(document.createElement(type));
+    write_elem.setAttribute("name", name);
+    // recupere le node le plus profond
+    QDomNode node = document.firstChild();
+    while (node.firstChild().isNull() == false) {
+      node = node.firstChild();
+    }
+    node.appendChild(write_elem);
+  } else {
+    document = QDomDocument("remote_ui_xml");
+    write_elem = QDomElement(document.createElement(type));
+    write_elem.setAttribute("name", name);
+    document.appendChild(write_elem);
+  }
+}
+
+XmlWidget::~XmlWidget() {
+  if (parent_widget != NULL)
+    parent_widget->childs->removeOne(this);
+
+  // on efface les widgets enfants
+  // dans le delete child on modifie le child du parent, donc on se refere
+  // toujours au premier
+  while (childs->count() != 0) {
+    delete childs->first();
+  }
+
+  delete childs;
+  if (visible_widget != NULL) {
+    delete visible_widget;
+  }
+}
+
+QString XmlWidget::Name(void) { return write_elem.attribute("name"); }
+
+void XmlWidget::SetIsContainer(bool status) { isContainer = status; }
+
+void XmlWidget::SetIsExpandable(bool status) { isExpandable = status; }
+
+XmlWidget *XmlWidget::GetXmlWidget(QString name, QString type) {
+  // printf("recherche %s
+  // %s\n",name.toLocal8Bit().constData(),type.toLocal8Bit().constData());
+
+  for (int i = 0; i < childs->count(); i++) {
+    // printf("child name
+    // %s\n",childs->at(i)->write_elem.attribute("name").toLocal8Bit().constData());
+    // printf("child tag
+    // %s\n",childs->at(i)->write_elem.tagName().toLocal8Bit().constData());
+    if (childs->at(i)->write_elem.attribute("name") == name &&
+        childs->at(i)->write_elem.tagName() == type)
+      return childs->at(i);
+  }
+  return NULL;
+}
+
+void XmlWidget::ParseXml(QDomElement to_parse) {
+
+  if (to_parse.isNull())
+    return;
+
+  QString type = to_parse.tagName();
+  QString name = to_parse.attribute("name");
+
+  // printf("parse %s
+  // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData());
+  XmlWidget *match;
+  match = GetXmlWidget(name, type);
+
+  if (match == NULL) {
+    // printf("not match\n");
+    XmlEvent(to_parse);
+  } else {
+    // printf("match\n");
+    // si on a une balise IsEnabled, on ne traite que ca
+    if (match->visible_widget != NULL) {
+      if (to_parse.attribute("IsEnabled") == "0") {
+        match->visible_widget->setEnabled(false);
+        return;
+      }
+      if (to_parse.attribute("IsEnabled") == "1") {
+        match->visible_widget->setEnabled(true);
+        return;
+      }
+    }
+
+    // si on a une balise delete, on ne traite que ca
+    if (to_parse.attribute("Delete") == "1") {
+      // printf("delete flag\n");
+      if (match->isContainer == true && match->childs->count() != 0) {
+        // printf("non vide
+        // %s\n",match->objectName().toLocal8Bit().constData());
+        return;
+      }
+
+      delete match;
+      return;
+    }
+
+    if (to_parse.firstChild().isNull() == true &&
+        match->isExpandable == false) {
+      QString new_name;
+      printf("possible doublon\n");
+      for (int i = 0; i < 65535; i++) {
+        new_name = QString("%1_%2").arg(name).arg(i);
+        bool continuer = false;
+        for (int i = 0; i < childs->count(); i++) {
+          if (childs->at(i)->write_elem.attribute("name") == new_name) {
+            continuer = true;
+            break;
+          }
+        }
+        if (continuer == false)
+          break;
+      }
+      printf("new_name %s\n", new_name.toLocal8Bit().constData());
+      to_parse.setAttribute("name", new_name);
+      to_parse.setAttribute("old_name", name);
+
+      XmlEvent(to_parse);
+
+      // return -1;//ou retourner le xml a renvoyer pour chager de nom
+    } else {
+      if (to_parse.firstChild().toElement().isNull()) {
+        match->XmlEvent(to_parse);
+        return;
+      } else {
+        match->ParseXml(to_parse.firstChild().toElement());
+      }
+    }
+  }
+}
+
+void XmlWidget::LoadXml(QDomElement to_parse) {
+  if (to_parse.isNull())
+    return;
+
+  LoadEvent(to_parse);
+
+  QDomElement elem = to_parse.firstChild().toElement();
+
+  while (!elem.isNull()) {
+
+    QString type = elem.tagName();
+    QString name = elem.attribute("name");
+    // printf("%s
+    // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData());
+    XmlWidget *match;
+    match = GetXmlWidget(name, type);
+
+    if (match != NULL) {
+      // printf("match\n");
+      match->LoadXml(elem);
+    }
+    elem = elem.nextSibling().toElement();
+  }
+}
+
+void XmlWidget::GetFullXml(QDomElement *doc) {
+  QDomDocument tmp_doc = XmlDoc();
+  merge((QDomElement *)&tmp_doc, doc);
+
+  for (int i = 0; i < childs->count(); i++) {
+    childs->at(i)->GetFullXml(doc);
+  }
+}
+
+void XmlWidget::GetUpdateXml(QDomElement *doc) {
+  if (IsUptodate() == false && isContainer == false) {
+    SetUptodate();
+    QDomDocument tmp_doc = XmlDoc();
+    merge((QDomElement *)&tmp_doc, doc);
+  }
+
+  for (int i = 0; i < childs->count(); i++) {
+    childs->at(i)->GetUpdateXml(doc);
+  }
+}
+
+void XmlWidget::ResetAllChilds(void) {
+  Reset();
+  for (int i = 0; i < childs->count(); i++) {
+    childs->at(i)->ResetAllChilds();
+  }
+}
+
+void XmlWidget::merge(QDomElement *from, QDomElement *into) {
+  QDomElement tmp_into, tmp_from;
+  tmp_from = from->firstChildElement();
+
+  while (tmp_from.isNull() == false) {
+    // search corresponding child
+    bool match = false;
+    tmp_into = into->firstChildElement(tmp_from.tagName());
+    while (tmp_into.isNull() == false) {
+      if (tmp_into.attribute("name") == tmp_from.attribute("name")) {
+        merge(&tmp_from, &tmp_into);
+        match = true;
+        break;
+      }
+      tmp_into = tmp_into.nextSiblingElement(tmp_from.tagName());
+    }
+
+    if (match == false) {
+      into->appendChild(tmp_from.cloneNode());
+    }
+
+    tmp_from = tmp_from.nextSiblingElement();
+  }
+}
+
+QDomDocument XmlWidget::XmlDoc(void) {
+  return document.cloneNode(true).toDocument();
+}
+
+QDomElement *XmlWidget::AddXmlChild(QString type) {
+  QDomElement *elem;
+
+  elem = new QDomElement(document.createElement(type));
+  write_elem.appendChild(*elem);
+
+  return elem;
+}
+
+void XmlWidget::RemoveXmlChild(QDomElement *element) {
+  write_elem.removeChild(*element);
+  delete element;
+}
+
+void XmlWidget::ClearDoc(void) { document.clear(); }
+
+void XmlWidget::SetValue(QString value) {
+  write_elem.setAttribute("value", value);
+}
+
+void XmlWidget::SetAttribute(const QString &name, const QString &value) {
+  write_elem.setAttribute(name, value);
+}
+
+void XmlWidget::SetAttribute(const QString &name, qlonglong value) {
+  write_elem.setAttribute(name, value);
+}
+
+void XmlWidget::SetAttribute(const QString &name, qulonglong value) {
+  write_elem.setAttribute(name, value);
+}
+
+void XmlWidget::SetAttribute(const QString &name, float value) {
+  write_elem.setAttribute(name, value);
+}
+
+void XmlWidget::SetAttribute(const QString &name, double value) {
+  write_elem.setAttribute(name, value);
+}
+
+void XmlWidget::RemoveAttribute(const QString &name) {
+  write_elem.removeAttribute(name);
+}
+
+void XmlWidget::RemoveAllAttributes() {
+  QString name = write_elem.attribute("name");
+
+  QDomNamedNodeMap attributes=write_elem.attributes();
+  while(attributes.count()!=0) {
+    //printf("%i %s\n",attributes.count(),attributes.item(0).toAttr().name().toLocal8Bit().constData());
+    write_elem.removeAttribute(attributes.item(0).toAttr().name());
+  }
+  SetAttribute("name", name);
+}
+
+void XmlWidget::RenamedFrom(QString old_name) {
+  QString name = write_elem.attribute("name");
+  SetAttribute("name", old_name);
+  SetAttribute("new_name", name);
+  connectionLayout()->XmlToSend(XmlDoc());
+  SetAttribute("name", name);
+  write_elem.removeAttribute("new_name");
+}
+
+ConnectionLayout *XmlWidget::connectionLayout(void) {
+  if (parent_widget != NULL) {
+    return (ConnectionLayout *)(parent_widget->connectionLayout());
+  } else {
+    return (ConnectionLayout *)this;
+  }
+}
Index: tags/latest/tools/FlairGCS/src/XmlWidget.h
===================================================================
--- tags/latest/tools/FlairGCS/src/XmlWidget.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/XmlWidget.h	(revision 209)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef XMLWIDGET_H
+#define XMLWIDGET_H
+
+#include <QObject>
+#include <stdint.h>
+#include <qdom.h>
+#include <QPalette>
+
+class QWidget;
+class ConnectionLayout;
+
+class XmlWidget : public QObject {
+  Q_OBJECT
+
+public:
+  XmlWidget(QString name, QString type, XmlWidget *parent);
+  ~XmlWidget();
+  QDomDocument XmlDoc(void);
+  void ParseXml(QDomElement to_parse);
+  void GetFullXml(QDomElement *doc);
+  void GetUpdateXml(QDomElement *doc);
+  void ResetAllChilds(void);
+  virtual bool IsUptodate(void) { return true; };
+  void LoadXml(QDomElement to_parse);
+  void RenamedFrom(QString old_name);
+  QString Name(void);
+
+private:
+  QDomDocument document;
+  QDomElement write_elem;
+  XmlWidget *GetXmlWidget(QString name, QString type);
+  static void merge(QDomElement *from, QDomElement *into);
+  bool isExpandable; // true if we can receive extra frame for this widget (ex
+                     // combobox, plots, layout)
+  bool isContainer;  // true if it can contain other widget (ex layout),
+                     // isExpandable is also true in this case
+  virtual void SetUptodate(void){};
+  virtual void Reset(void){};
+  XmlWidget *parent_widget;
+
+protected:
+  QList<XmlWidget *> *childs;
+  ConnectionLayout *connectionLayout(void);
+  QWidget *visible_widget;
+  QPalette red_pal, red_pal_greyed;
+  QPalette black_pal, black_pal_greyed;
+  void SetIsContainer(bool status);
+  void SetIsExpandable(bool status);
+  virtual void XmlEvent(QDomElement dom){};
+  virtual void LoadEvent(QDomElement dom){};
+  QDomElement *AddXmlChild(QString type);
+  void RemoveXmlChild(QDomElement *element);
+  void ClearDoc(void);
+  void SetValue(QString value);
+  void SetAttribute(const QString &name, const QString &value);
+  void SetAttribute(const QString &name, qlonglong value);
+  void SetAttribute(const QString &name, qulonglong value);
+  inline void SetAttribute(const QString &name, int value) {
+    SetAttribute(name, qlonglong(value));
+  }
+  inline void SetAttribute(const QString &name, uint value) {
+    SetAttribute(name, qulonglong(value));
+  }
+  void SetAttribute(const QString &name, float value);
+  void SetAttribute(const QString &name, double value);
+  void RemoveAllAttributes(); //except name
+  void RemoveAttribute(const QString &name);
+};
+
+#endif // XMLWIDGET_H
Index: tags/latest/tools/FlairGCS/src/file_ui.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/file_ui.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/file_ui.cpp	(revision 209)
@@ -0,0 +1,411 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include "file_ui.h"
+#include <stdio.h>
+
+#include <cstring>
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+#include <QDir>
+#include <QDate>
+#include <QTextStream>
+#include <QGridLayout>
+#include <io_hdfile.h>
+#include <QtEndian>
+#include <QComboBox>
+#include <QPushButton>
+#include <QTextEdit>
+#include <QDialog>
+#include <QStringList>
+#include <QFormLayout>
+
+#ifndef WIN32
+#include <arpa/inet.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+using namespace std;
+
+file_ui::file_ui() {
+  dialog = new QDialog();
+  dialog->setWindowTitle("log files");
+  QGridLayout *main_layout = new QGridLayout(dialog);
+  ok_button = new QPushButton("Ok", dialog);
+  log_text = new QTextEdit(dialog);
+  log_text->setReadOnly(true);
+  input_text = new QTextEdit(dialog);
+  input_text->setText("add your log comment here");
+  input_cleared = false;
+
+  ok_button->setEnabled(false);
+
+  main_layout->addWidget(log_text, 0, 0);
+  main_layout->addWidget(input_text, 1, 0);
+
+  QWidget *widget = new QWidget(dialog);
+  QFormLayout *formLayout = new QFormLayout(widget);
+  csv_combo = new QComboBox(widget);
+  formLayout->addRow(tr("save all log with following base time"), csv_combo);
+  csv_combo->addItem("(no base time)");
+  main_layout->addWidget(widget, 2, 0);
+  main_layout->addWidget(ok_button, 3, 0);
+
+  connect(ok_button, SIGNAL(clicked()), this, SLOT(save()),
+          Qt::QueuedConnection);
+  connect(this, SIGNAL(showDialog()), dialog, SLOT(show()),
+          Qt::QueuedConnection);
+  connect(this, SIGNAL(appendToLog(QString)), log_text, SLOT(append(QString)),
+          Qt::QueuedConnection);
+  connect(input_text, SIGNAL(cursorPositionChanged()), this,
+          SLOT(clearInputText()), Qt::QueuedConnection);
+
+  file_names = new QStringList();
+}
+
+file_ui::~file_ui() { delete dialog; }
+
+void file_ui::log(QString text) { appendToLog(text); }
+
+void file_ui::addFile(QString file_path) {
+  // framework sends dbt file then txt file
+  // when we receive txt, we have both files
+  // and we can convert it to .csv
+  if (file_path.endsWith(".dbt") == true) {
+    QString name =
+        file_path.section('/', -1); // remove path for displaying on combobox
+    csv_combo->addItem(name.replace(QString(".dbt"), QString(".csv")));
+    file_names->append(file_path.replace(QString(".dbt"), QString(".csv")));
+  }
+
+  if (file_path.endsWith(".txt") == true) {
+    dbt2csv(file_path.replace(QString(".txt"), QString(".dbt")));
+  }
+
+  if (file_names->size() == 1) {
+    input_cleared = false;
+    showDialog();
+  }
+}
+
+void file_ui::endOfFiles(void) {
+  ok_button->setEnabled(true);
+
+  qint64 max_file_size = 0;
+  for (int i = 0; i < file_names->count(); i++) {
+    QFileInfo info(file_names->at(i));
+    if (info.size() > max_file_size) {
+      max_file_size = info.size();
+      csv_combo->setCurrentIndex(i +
+                                 1); // first item of combobox is already taken
+    }
+  }
+}
+
+void file_ui::dbt2csv(QString file_path) {
+  hdfile_t *dbtFile = NULL;
+  char *data;
+  QStringList data_type;
+
+  QString filename =
+      file_path.section('/', -1); // remove path for displaying on logs
+  appendToLog(QString("converting %1 to csv").arg(filename));
+
+  // open csv file
+  QString csv_filename = file_path;
+  csv_filename.replace(QString(".dbt"), QString(".csv"));
+  QFile csv_file(csv_filename);
+
+  if (!csv_file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+    appendToLog("      error opening csv file!");
+    return;
+  }
+  QTextStream out(&csv_file);
+
+  // open txt file
+  QString txt_filename = file_path;
+  txt_filename.replace(QString(".dbt"), QString(".txt"));
+  QFile txt_file(txt_filename);
+
+  if (!txt_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+    appendToLog("      error opening txt file!");
+    return;
+  }
+
+  // read txt file
+  QTextStream txt_in(&txt_file);
+  txt_in.readLine(); // time us
+  txt_in.readLine(); // time ns
+  while (1) {
+    if (txt_in.atEnd() == true)
+      break;
+    QString txt_line = txt_in.readLine();
+    data_type.append(txt_line.section(
+        "(",
+        -1)); // on part de la fin pour trouver la premiere parenthese ouvrante
+    // printf("type %s\n",txt_line.section("(",-1).toLocal8Bit().constData());
+  }
+  txt_file.close();
+
+  dbtFile = open_hdfile(file_path.toLocal8Bit().data(), READ_MODE);
+
+  if (!dbtFile) {
+    appendToLog("      error opening dbt file!");
+    return;
+  }
+  data = (char *)malloc(dbtFile->h.DataSize);
+  if (data == NULL) {
+    appendToLog("      error malloc!");
+    return;
+  }
+
+  bool dataWritten = false;
+  while (1) {
+    road_time_t time;
+    road_timerange_t tr = 0;
+    int offset = 0;
+    QTextStream csv_line;
+
+    if (read_hdfile(dbtFile, (void *)data, &time, &tr) == 0) {
+      break;
+    }
+    dataWritten = true;
+
+    out << time << "," << tr;
+    for (int i = 0; i < data_type.size(); i++) {
+      if (data_type.at(i) == "double)") {
+        double *value = (double *)(data + offset);
+        offset += sizeof(double);
+        out << "," << *value;
+      } else if (data_type.at(i) == "float)") {
+        float *value = (float *)(data + offset);
+        offset += sizeof(float);
+        out << "," << *value;
+      } else if (data_type.at(i) == "int8_t)") {
+        int8_t *value = (int8_t *)(data + offset);
+        offset += sizeof(int8_t);
+        out << "," << *value;
+      } else if (data_type.at(i) == "uint8_t)") {
+        uint8_t *value = (uint8_t *)(data + offset);
+        offset += sizeof(uint8_t);
+        out << "," << *value;
+      } else {
+        appendToLog(QString("      unhandled type: %1").arg(data_type.at(i)));
+      }
+    }
+
+    out << "\n";
+  }
+
+  if (!dataWritten) {
+    // empty file!
+    out << "0,0"; // timr
+    for (int i = 0; i < data_type.size(); i++) {
+      out << ",0";
+    }
+    out << "\n";
+  }
+
+  csv_file.close();
+  close_hdfile(dbtFile);
+  if (data != NULL)
+    free(data);
+
+  appendToLog("      ok");
+}
+
+void file_ui::clearInputText(void) {
+  if (input_cleared == false) {
+    input_cleared = true;
+    input_text->clear();
+  }
+}
+
+void file_ui::save(void) {
+  save_comment();
+  if (csv_combo->currentIndex() != 0) {
+    save_csv();
+    save_txt();
+  }
+
+  log_text->clear();
+  input_cleared = true; // avoid clearing it with setText
+  input_text->setText("add your log comment here");
+  file_names->clear();
+  csv_combo->clear();
+  csv_combo->addItem(QString("(no base time)"));
+
+  dialog->setVisible(false);
+  ok_button->setEnabled(false);
+  emit finished();
+}
+
+void file_ui::save_comment(void) {
+  QString folder_name = file_names->at(0).section('/', 0, -2);
+
+  QString filename = folder_name + "/commentaire.txt";
+  QFile file(filename);
+  if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+    printf("file_ui::save_comment: erreur ouverture fichier %s\n",
+           filename.toLocal8Bit().constData());
+  QTextStream out(&file);
+
+  out << input_text->toPlainText();
+  file.close();
+}
+
+void file_ui::save_csv(void) {
+  // global csv file
+  QString folder_name = file_names->at(0).section('/', 0, -2);
+  QString filename = folder_name + "/all_logs.csv";
+  QFile global_file(filename);
+  if (!global_file.open(QIODevice::WriteOnly | QIODevice::Text))
+    printf("file_ui::save_csv: erreur ouverture fichier %s\n",
+           filename.toLocal8Bit().constData());
+  QTextStream out(&global_file);
+
+  // reference csv file
+  filename = file_names->at(csv_combo->currentIndex() - 1);
+  QFile ref_file(filename);
+  // printf("file_ui::save_csv: ref %s\n",filename.toLocal8Bit().constData());
+  if (!ref_file.open(QIODevice::ReadOnly | QIODevice::Text))
+    printf("file_ui::save_csv: erreur ouverture ficher %s\n",
+           filename.toLocal8Bit().constData());
+
+  // other csv files
+  int j = 0;
+  QFile m_file[file_names->count() - 1];
+  QTextStream m_in[file_names->count() - 1];
+  for (int i = 0; i < file_names->count(); i++) {
+    if (i == csv_combo->currentIndex() - 1)
+      continue;
+    filename = file_names->at(i);
+    m_file[j].setFileName(filename);
+    if (!m_file[j].open(QIODevice::ReadOnly | QIODevice::Text))
+      printf("file_ui::save_csv: erreur ouverture ficher %s\n",
+             filename.toLocal8Bit().constData());
+    m_in[j].setDevice(&m_file[j]);
+    j++;
+  }
+
+  // init
+  QTextStream ref_in(&ref_file);
+  QString m_line[file_names->count() - 1];
+  QString m_line_prev[file_names->count() - 1];
+  for (int i = 0; i < file_names->count() - 1; i++) {
+    m_line[i] = m_in[i].readLine();
+    m_line_prev[i] = m_line[i];
+  }
+
+  // organize csv files in one file
+  while (1) {
+    if (ref_in.atEnd() == true)
+      break;
+    QString ref_line = ref_in.readLine();
+
+    qint64 ref_us = ref_line.section(',', 0, 0).toLongLong();
+    int ref_ns = ref_line.section(',', 1, 1).toInt();
+    // printf("ref %lld %i\n",ref_us,ref_ns);
+
+    for (int i = 0; i < file_names->count() - 1; i++) {
+      qint64 csv_us = m_line[i].section(',', 0, 0).toLongLong();
+      int csv_ns = m_line[i].section(',', 1, 1).toInt();
+      // printf("m %lld %i\n",csv_us,csv_ns);
+
+      while (is_greater(ref_us, csv_us, ref_ns, csv_ns) == true) {
+        m_line_prev[i] = m_line[i];
+        if (m_in[i].atEnd() == true)
+          break;
+        m_line[i] = m_in[i].readLine();
+        csv_us = m_line[i].section(',', 0, 0).toLongLong();
+        csv_ns = m_line[i].section(',', 1, 1).toInt();
+        // printf("m %lld %i\n",csv_us,csv_ns);
+      }
+      csv_us = m_line_prev[i].section(',', 0, 0).toLongLong();
+      csv_ns = m_line_prev[i].section(',', 1, 1).toInt();
+      // printf("m ok %lld %i\n",csv_us,csv_ns);
+
+      ref_line += "," + m_line_prev[i].section(',', 2);
+    }
+
+    out << ref_line << "\n";
+  }
+
+  global_file.close();
+  ref_file.close();
+  for (int i = 0; i < file_names->count() - 1; i++)
+    m_file[i].close();
+}
+
+void file_ui::save_txt(void) {
+  // global txt file
+  QString folder_name = file_names->at(0).section('/', 0, -2);
+  QString filename = folder_name + "/all_logs.txt";
+  QFile global_file(filename);
+  if (!global_file.open(QIODevice::WriteOnly | QIODevice::Text))
+    printf("file_ui::save_txt: erreur ouverture ficher %s\n",
+           filename.toLocal8Bit().constData());
+  QTextStream out(&global_file);
+
+  // reference txt file
+  filename = file_names->at(csv_combo->currentIndex() - 1);
+  filename.replace(QString(".csv"), QString(".txt"));
+  QFile ref_file(filename);
+  if (!ref_file.open(QIODevice::ReadOnly | QIODevice::Text))
+    printf("file_ui::save_txt: erreur ouverture ficher %s\n",
+           filename.toLocal8Bit().constData());
+
+  QTextStream ref_in(&ref_file);
+  QString current_line = ref_in.readLine();
+  int nb_lines = 1;
+  while (current_line != NULL) {
+    out << current_line << "\n";
+    ;
+    current_line = ref_in.readLine();
+    nb_lines++;
+  }
+
+  // other txt files
+  for (int i = 0; i < file_names->count(); i++) {
+    if (i == csv_combo->currentIndex() - 1)
+      continue;
+    filename = file_names->at(i);
+    filename.replace(QString(".csv"), QString(".txt"));
+    QFile txt_file(filename);
+    if (!txt_file.open(QIODevice::ReadOnly | QIODevice::Text))
+      printf("file_ui::save_txt: erreur ouverture ficher %s\n",
+             filename.toLocal8Bit().constData());
+    QTextStream txt_in(&txt_file);
+    txt_in.readLine(); // time us
+    txt_in.readLine(); // time ns
+    current_line = txt_in.readLine();
+    while (current_line != NULL) {
+      out << nb_lines << ":" << current_line.section(':', 1) << "\n";
+      ;
+      current_line = txt_in.readLine();
+      nb_lines++;
+    }
+    txt_file.close();
+  }
+  global_file.close();
+  ref_file.close();
+}
+
+bool file_ui::is_greater(qint64 ref_us, qint64 csv_us, int ref_ns, int csv_ns) {
+  if (ref_us == csv_us) {
+    if (ref_ns > csv_ns) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+  if (ref_us > csv_us) {
+    return true;
+  } else {
+    return false;
+  }
+}
Index: tags/latest/tools/FlairGCS/src/file_ui.h
===================================================================
--- tags/latest/tools/FlairGCS/src/file_ui.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/file_ui.h	(revision 209)
@@ -0,0 +1,51 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef FILE_UI_H
+#define FILE_UI_H
+
+#include <QObject>
+
+class QStringList;
+class QDialog;
+class QTextEdit;
+class QPushButton;
+class QComboBox;
+class QCloseEvent;
+
+class file_ui : public QObject {
+  Q_OBJECT
+
+public:
+  file_ui();
+  ~file_ui();
+  void log(QString text);
+  void addFile(QString file_path);
+  void endOfFiles(void);
+
+private:
+  QDialog *dialog;
+  QStringList *file_names;
+  QTextEdit *log_text, *input_text;
+  QPushButton *ok_button;
+  QComboBox *csv_combo;
+  void save_comment(void);
+  void save_csv(void);
+  void save_txt(void);
+  void dbt2csv(QString file_path);
+  bool is_greater(qint64 ref_us, qint64 csv_us, int ref_ns, int csv_ns);
+  void closeEvent(QCloseEvent *e);
+  bool input_cleared;
+
+private slots:
+  void save(void);
+  void clearInputText(void);
+
+signals:
+  void showDialog(void);
+  void appendToLog(QString);
+  void finished();
+};
+
+#endif // FILE_UI_H
Index: tags/latest/tools/FlairGCS/src/main.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/main.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/main.cpp	(revision 209)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#include <QApplication>
+#include <QCleanlooksStyle>
+#include <QLocale>
+#include <qmetatype.h>
+#include <tclap/CmdLine.h>
+
+#include "Manager.h"
+#include "unexported/compile_info.h"
+
+using namespace TCLAP;
+using namespace std;
+
+string name;
+int port;
+
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> nameArg("n", "name", "uav name", false, "x4-0", "string");
+    cmd.add(nameArg);
+
+    ValueArg<int> portArg("p", "port", "port number", false, 9000, "int");
+    cmd.add(portArg);
+
+    cmd.parse(argc, argv);
+
+    // Get the value parsed by each arg.
+    name = nameArg.getValue();
+    port = portArg.getValue();
+
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
+
+int main(int argc, char *argv[]) {
+
+  union {
+    uint32_t i;
+    char c[4];
+  } bint = {0x01020304};
+
+  if (bint.c[0] == 1) {
+    printf("error, ground station is only compatible with little endian\n");
+    return -1;
+  }
+
+  compile_info("FlairGCS");
+
+  parseOptions(argc, argv);
+  printf("listening on port %i\n", port);
+
+  qRegisterMetaType<const char *>("const char*");
+  QLocale::setDefault(QLocale::C);
+  QApplication app(argc, argv);
+  app.setStyle(new QCleanlooksStyle);
+
+  Manager manager(QString::fromStdString(name), port);
+
+  manager.show();
+
+  app.exec();
+}
Index: tags/latest/tools/FlairGCS/src/mapwidget.cpp
===================================================================
--- tags/latest/tools/FlairGCS/src/mapwidget.cpp	(revision 209)
+++ tags/latest/tools/FlairGCS/src/mapwidget.cpp	(revision 209)
@@ -0,0 +1,398 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of Qt. It was originally
+** published as part of Qt Quarterly.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGeoCoordinate>
+#include <QGraphicsScene>
+
+#include <QTimer>
+#include <QMenu>
+#include "mapwidget.h"
+#include "Landmark.h"
+#include "Map.h"
+#include "ConnectionLayout.h"
+
+using namespace QtMobility;
+
+MapWidget::MapWidget(Map *map, QWidget *parent) : QGraphicsView(parent) {
+  setCursor(Qt::ArrowCursor);
+  setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+  geoMap = 0;
+  dragging = false;
+  pressed = false;
+  landmark_match = NULL;
+  this->map = map;
+
+  m_scene = new QGraphicsScene(this);
+  setScene(m_scene);
+  setMouseTracking(true);
+
+  landmarks = new QList<Landmark *>;
+  landmarks_old = new QList<Landmark *>;
+}
+
+MapWidget::~MapWidget() {
+  m_scene->removeItem(geoMap);
+  delete m_scene;
+}
+
+QGraphicsScene *MapWidget::scene(void) const { return m_scene; }
+
+void MapWidget::setMap(QGraphicsGeoMap *geoMap) {
+  m_scene->clear();
+  m_scene->addItem(geoMap);
+  this->geoMap = geoMap;
+  geoMap->resize(m_scene->sceneRect().width(), m_scene->sceneRect().height());
+}
+
+void MapWidget::mousePressEvent(QMouseEvent *event) {
+  if (event->button() == Qt::LeftButton) {
+    pressed = true;
+    dragStartPosition = event->pos();
+    QTimer::singleShot(qApp->startDragTime(), this, SLOT(initDrag()));
+    event->accept();
+  }
+
+  if (event->button() == Qt::RightButton) {
+    QMenu *menu = new QMenu("nom", this);
+
+    if (cursor().shape() != Qt::PointingHandCursor) {
+      QAction *b, *z; //*a,
+      QList<QAction *> go_to_actions;
+      QList<QAction *> centered_actions;
+
+      //add centered for every point
+      QMenu *centered_menu = menu->addMenu("centered");
+      for (int i = 0; i < points.count(); i++) {
+        QAction *action = centered_menu->addAction(points.at(i));
+        centered_actions.append(action);
+        action->setCheckable(true);
+        if (map->centeredPoint() == i) {
+          action->setChecked(true);
+        } else {
+          action->setChecked(false);
+        }
+      }
+
+      menu->addSeparator();
+
+      b = menu->addAction("place checkpoint");
+
+      //add go to for every landmark
+      QMenu *go_to_menu = menu->addMenu("go to");
+      for (int i = 0; i < landmarks->count(); i++) {
+        QAction *action =
+            go_to_menu->addAction(QString("checkpoint %1").arg(i + 1));
+        go_to_actions.append(action);
+      }
+      if (landmarks->count() == 0)
+        go_to_menu->setEnabled(false);
+
+      map->appendmenu(menu);
+      z = map->execmenu(this, menu, event->globalPos());
+
+      //center to the desired point
+      for (int i = 0; i < centered_actions.count(); i++) {
+        if (z == centered_actions.at(i)) {
+          if (centered_actions.at(i)->isChecked()) {
+            map->setCenteredPoint(i);
+          } else {
+            map->setCenteredPoint(-1);
+          }
+
+          break;
+        }
+      }
+
+      //add a landmark
+      if (z == b) {
+        Landmark *landmark = new Landmark(
+            geoMap, geoMap->screenPositionToCoordinate(event->pos()),
+            QString("%1").arg(landmarks->count() + 1));
+        landmarks->append(landmark);
+      }
+      for (int i = 0; i < go_to_actions.count(); i++) {
+        if (z == go_to_actions.at(i)) {
+          map->setCenteredPoint(-1);
+          geoMap->setCenter(landmarks->at(i)->coordinate());
+          break;
+        }
+      }
+
+    //delete landmark
+    } else {
+      QAction *a, *z;
+      a = menu->addAction("delete");
+      //get selected landmark id
+      int landmark_index;
+      for (landmark_index = 0; landmark_index < landmarks->count(); landmark_index++) {
+          if (landmarks->at(landmark_index)->contains(
+                  geoMap->screenPositionToCoordinate(event->pos()))) {
+            a->setEnabled(landmarks->at(landmark_index)->IsUptodate());
+            break;
+          }
+      }
+      z = menu->exec(event->globalPos());
+
+      if (z == a) {
+        //remove from landmarks_old
+        for (int i = 0; i < landmarks_old->count(); i++) {
+          if (landmarks_old->at(i)->contains(
+                  geoMap->screenPositionToCoordinate(event->pos()))) {
+            landmarks_old->removeAt(i);
+            break;
+          }
+        }
+
+        //remove from landmarks
+        delete landmarks->at(landmark_index);
+        landmarks->removeAt(landmark_index);
+
+        //reorder the remaining ones
+        for (int j = landmark_index; j < landmarks->count(); j++) {
+          landmarks->at(j)->setText(QString("%1").arg(j + 1));
+        }
+
+        //send delete
+        map->RemoveAllAttributes();
+        map->SetAttribute("lat" + QString::number(landmark_index),"delete");
+        map->SetAttribute("long" + QString::number(landmark_index),"delete");
+        map->connectionLayout()->XmlToSend(map->XmlDoc());
+        map->RemoveAttribute("lat" + QString::number(landmark_index));
+        map->RemoveAttribute("long" + QString::number(landmark_index));
+      }
+    }
+
+    delete menu;
+  }
+}
+
+void MapWidget::initDrag(void) {
+  if (pressed && map->isCentered() && landmark_match == NULL) {
+    dragging = true;
+  }
+}
+
+void MapWidget::mouseMoveEvent(QMouseEvent *event) {
+  if (!geoMap)
+    return;
+
+  Qt::CursorShape new_cursor;
+  if (dragging == true) {
+    new_cursor = Qt::ClosedHandCursor;
+  } else {
+    if (map->isCentered()) {
+      if (pressed == true) {
+        new_cursor = Qt::ForbiddenCursor;
+      } else {
+        new_cursor = Qt::ArrowCursor;
+      }
+    } else {
+      new_cursor = Qt::OpenHandCursor;
+    }
+    if (landmark_match != NULL)
+      new_cursor = Qt::PointingHandCursor;
+  }
+
+  for (int i = 0; i < landmarks->count(); i++) {
+    if (landmarks->at(i)
+            ->contains(geoMap->screenPositionToCoordinate(event->pos()))) {
+      if (pressed && landmark_match == NULL) {
+        landmark_match = landmarks->at(i);
+        landmark_match->setColor(Qt::red);
+      }
+      new_cursor = Qt::PointingHandCursor;
+      break;
+    }
+  }
+
+  if (new_cursor != cursor().shape())
+    setCursor(new_cursor);
+
+  QPoint v = event->pos() - dragStartPosition;
+
+  if (dragging) {
+    geoMap->pan(-v.x(), -v.y());
+    dragStartPosition = event->pos();
+
+  } else if (landmark_match != NULL) {
+    landmark_match->setCoordinate(
+        geoMap->screenPositionToCoordinate(event->pos()));
+
+  } else if (pressed && !map->isCentered() &&
+             v.manhattanLength() >= qApp->startDragDistance()) {
+    dragging = true;
+
+  } else {
+    dragStartPosition = event->pos();
+    emit positionChanged(geoMap->screenPositionToCoordinate(event->pos()));
+  }
+
+  event->accept();
+}
+
+void MapWidget::mouseReleaseEvent(QMouseEvent *event) {
+  pressed = false;
+  landmark_match = NULL;
+
+  if (dragging) {
+    QPoint v = event->pos() - dragStartPosition;
+    geoMap->pan(-v.x(), -v.y());
+    dragging = false;
+  }
+
+  event->accept();
+}
+
+void MapWidget::resizeEvent(QResizeEvent *event) {
+  if (geoMap) {
+    m_scene->setSceneRect(
+        QRectF(0, 0, event->size().width(), event->size().height()));
+    geoMap->resize(event->size().width(), event->size().height());
+  }
+
+  QGraphicsView::resizeEvent(event);
+}
+
+void MapWidget::wheelEvent(QWheelEvent *event) {
+  int steps = event->delta() / 120;
+  int zoom = qBound(geoMap->minimumZoomLevel(), geoMap->zoomLevel() + steps,
+                    geoMap->maximumZoomLevel());
+
+  if (zoom != geoMap->zoomLevel())
+    geoMap->setZoomLevel(zoom);
+  // if(!centered)
+  // geoMap->setCenter(geoMap->screenPositionToCoordinate(event->pos()));
+}
+
+void MapWidget::mouseDoubleClickEvent(QMouseEvent *event) {
+  if (!map->isCentered())
+    geoMap->setCenter(geoMap->screenPositionToCoordinate(event->pos()));
+}
+
+bool MapWidget::IsUptodate(void) {
+  for (int i = 0; i < landmarks->count(); i++) {
+    if(!landmarks->at(i)->IsUptodate()) return false;
+  }
+  return true;
+}
+
+void MapWidget::SetUptodate(void) {
+  for (int i = 0; i < landmarks_old->count(); i++) {
+    delete landmarks_old->at(i);
+  }
+  landmarks_old->clear();
+
+  for (int i = 0; i < landmarks->count(); i++) {
+    landmarks->at(i)->setColor(Qt::white);
+    Landmark *landmark =
+        new Landmark(geoMap, landmarks->at(i)->coordinate(),
+                     QString("%1").arg(landmarks->count() + 1));
+    landmarks_old->append(landmark);
+    landmarks_old->at(i)->setVisible(false);
+  }
+}
+
+void MapWidget::Reset(void) {
+  for (int i = 0; i < landmarks->count(); i++) {
+    delete landmarks->at(i);
+  }
+  landmarks->clear();
+
+  for (int i = 0; i < landmarks_old->count(); i++) {
+    Landmark *landmark =
+        new Landmark(geoMap, landmarks_old->at(i)->coordinate(),
+                     QString("%1").arg(landmarks->count() + 1));
+    landmarks->append(landmark);
+    landmarks->at(i)->setColor(Qt::white);
+  }
+}
+
+QList<Landmark *> *MapWidget::Landmarks(void) { return landmarks; }
+
+bool MapWidget::LandmarkToSend(int index) {
+  if (index >= landmarks_old->count())
+    return true;
+
+  if (landmarks->at(index)->coordinate() !=
+      landmarks_old->at(index)->coordinate())
+    return true;
+  else
+    return false;
+}
+void MapWidget::RemoveLandmarks(void) {
+  for (int i = 0; i < landmarks->count(); i++) {
+    landmarks->at(i)->RemoveLandmark();
+  }
+  for (int i = 0; i < landmarks_old->count(); i++) {
+    landmarks_old->at(i)->RemoveLandmark();
+  }
+}
+
+void MapWidget::AddLandmarks(QGraphicsGeoMap *geoMap) {
+  for (int i = 0; i < landmarks->count(); i++) {
+    landmarks->at(i)->AddLandmark(geoMap);
+  }
+  for (int i = 0; i < landmarks_old->count(); i++) {
+    landmarks_old->at(i)->AddLandmark(geoMap);
+  }
+}
+
+void MapWidget::AddLandmark(const QGeoCoordinate &coordinate) {
+  Landmark *landmark = new Landmark(geoMap, coordinate,
+                                    QString("%1").arg(landmarks->count() + 1));
+  landmarks->append(landmark);
+  landmark->setColor(Qt::white);
+  landmark = new Landmark(geoMap, coordinate,
+                          QString("%1").arg(landmarks_old->count() + 1));
+  landmarks_old->append(landmark);
+  landmark->setColor(Qt::white);
+  landmark->setVisible(false);
+}
+
+void MapWidget::AddPoint(QString name) { points.append(name); }
Index: tags/latest/tools/FlairGCS/src/mapwidget.h
===================================================================
--- tags/latest/tools/FlairGCS/src/mapwidget.h	(revision 209)
+++ tags/latest/tools/FlairGCS/src/mapwidget.h	(revision 209)
@@ -0,0 +1,105 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of Qt. It was originally
+** published as part of Qt Quarterly.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAPWIDGET_H
+#define MAPWIDGET_H
+
+#include <QGraphicsView>
+#include <QGraphicsGeoMap>
+
+class QGraphicsScene;
+class Map;
+class Landmark;
+
+using namespace QtMobility;
+
+class MapWidget : public QGraphicsView {
+  Q_OBJECT
+
+public:
+  MapWidget(Map *map, QWidget *parent = 0);
+  ~MapWidget();
+  void setMap(QtMobility::QGraphicsGeoMap *geoMap);
+  QGraphicsScene *scene() const;
+  bool IsUptodate(void);
+  void SetUptodate(void);
+  void Reset(void);
+  QList<Landmark *> *Landmarks(void);
+  bool LandmarkToSend(int index);
+  void AddLandmark(const QGeoCoordinate &coordinate);
+  void RemoveLandmarks(void);
+  void AddLandmarks(QGraphicsGeoMap *geoMap);
+  void AddPoint(QString name);
+
+signals:
+  void positionChanged(const QGeoCoordinate &coordinate);
+
+protected:
+  void mousePressEvent(QMouseEvent *event);
+  void mouseMoveEvent(QMouseEvent *event);
+  void mouseReleaseEvent(QMouseEvent *event);
+  void resizeEvent(QResizeEvent *event);
+  void wheelEvent(QWheelEvent *event);
+  void mouseDoubleClickEvent(QMouseEvent *event);
+
+private slots:
+  void initDrag();
+
+private:
+  QGraphicsGeoMap *geoMap;
+  bool dragging;
+  QPoint dragStartPosition;
+  bool pressed;
+
+  QGraphicsScene *m_scene;
+  QList<Landmark *> *landmarks;
+  QList<Landmark *> *landmarks_old;
+  QList<QString> points;
+  Landmark *landmark_match;
+  Map *map;
+};
+
+#endif
Index: tags/latest/tools/FlairGCS/src/ressources.qrc
===================================================================
--- tags/latest/tools/FlairGCS/src/ressources.qrc	(revision 209)
+++ tags/latest/tools/FlairGCS/src/ressources.qrc	(revision 209)
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+  <file>zoomin.png</file>
+  <file>zoomout.png</file>
+  <file>landmark.png</file>
+  <file>cross.png</file>
+</qresource>
+</RCC>
