diff --git a/libraries/GCS_MAVLink/.gitignore b/libraries/GCS_MAVLink/.gitignore index d67b9114a8..0b16395bed 100644 --- a/libraries/GCS_MAVLink/.gitignore +++ b/libraries/GCS_MAVLink/.gitignore @@ -1,3 +1,16 @@ *~ doc/html doc/*.log + +include/mavlink/v0.9/slugs/ +include/mavlink/v0.9/ualberta/ +include/mavlink/v0.9/minimal/ +include/mavlink/v0.9/test/ +include/mavlink/v0.9/pixhawk/ + +include/mavlink/v1.0/slugs/ +include/mavlink/v1.0/ualberta/ +include/mavlink/v1.0/minimal/ +include/mavlink/v1.0/test/ +include/mavlink/v1.0/pixhawk/ +include/mavlink/v1.0/sensoar/ diff --git a/libraries/GCS_MAVLink/GCS_MAVLink.cpp b/libraries/GCS_MAVLink/GCS_MAVLink.cpp index bbf3cf4412..fa8759f1e7 100644 --- a/libraries/GCS_MAVLink/GCS_MAVLink.cpp +++ b/libraries/GCS_MAVLink/GCS_MAVLink.cpp @@ -12,9 +12,9 @@ BetterStream *mavlink_comm_1_port; mavlink_system_t mavlink_system = {7,1,0,0}; #ifdef MAVLINK10 -# include "include_v1.0/mavlink_helpers.h" +# include "include/mavlink/v1.0/mavlink_helpers.h" #else -# include "include/mavlink_helpers.h" +# include "include/mavlink/v0.9/mavlink_helpers.h" #endif uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid) diff --git a/libraries/GCS_MAVLink/GCS_MAVLink.h b/libraries/GCS_MAVLink/GCS_MAVLink.h index 4b3a038e0b..d2003b84fa 100644 --- a/libraries/GCS_MAVLink/GCS_MAVLink.h +++ b/libraries/GCS_MAVLink/GCS_MAVLink.h @@ -11,9 +11,9 @@ #define MAVLINK_SEPARATE_HELPERS #ifdef MAVLINK10 -# include "include_v1.0/ardupilotmega/version.h" +# include "include/mavlink/v1.0/ardupilotmega/version.h" #else -# include "include/ardupilotmega/version.h" +# include "include/mavlink/v0.9/ardupilotmega/version.h" #endif // this allows us to make mavlink_message_t much smaller @@ -21,9 +21,9 @@ #define MAVLINK_COMM_NUM_BUFFERS 2 #ifdef MAVLINK10 -# include "include_v1.0/mavlink_types.h" +# include "include/mavlink/v1.0/mavlink_types.h" #else -# include "include/mavlink_types.h" +# include "include/mavlink/v0.9/mavlink_types.h" #endif /// MAVLink stream used for HIL interaction @@ -118,9 +118,9 @@ static inline int comm_get_txspace(mavlink_channel_t chan) #define MAVLINK_USE_CONVENIENCE_FUNCTIONS #ifdef MAVLINK10 -# include "include_v1.0/ardupilotmega/mavlink.h" +# include "include/mavlink/v1.0/ardupilotmega/mavlink.h" #else -# include "include/ardupilotmega/mavlink.h" +# include "include/mavlink/v0.9/ardupilotmega/mavlink.h" #endif uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid); diff --git a/libraries/GCS_MAVLink/README b/libraries/GCS_MAVLink/README deleted file mode 100644 index 513d5c77f7..0000000000 --- a/libraries/GCS_MAVLink/README +++ /dev/null @@ -1,29 +0,0 @@ -MAVLink Micro Air Vehicle Message Marshalling Library - -This is a library for lightweight communication between -Micro Air Vehicles (swarm) and/or ground control stations. -It serializes C-structs for serial channels and can be used with -any type of radio modem. - -For help, please visit the mailing list: http://groups.google.com/group/mavlink - -MAVLink is licensed under the terms of the Lesser General Public License of the Free Software Foundation (LGPL). -As MAVLink is a header-only library, compiling an application with it is considered "using the libary", not a derived work. MAVLink can therefore be used without limits in any closed-source application without publishing the source code of the closed-source application. - -To generate/update packets, select mavlink_standard_message.xml -in the QGroundControl station settings view, select mavlink/include as -the output directory and click on "Save and Generate". -You will find the newly generated/updated message_xx.h files in -the mavlink/include/generated folder. - -To use MAVLink, #include the file, not the individual -message files. In some cases you will have to add the main folder to the include search path as well. To be safe, we recommend these flags: - -gcc -I mavlink/include -I mavlink/include/ - -For more information, please visit: - -http://qgroundcontrol.org/mavlink/ - -(c) 2009-2011 Lorenz Meier - diff --git a/libraries/GCS_MAVLink/VERSION b/libraries/GCS_MAVLink/VERSION new file mode 100644 index 0000000000..af0b7ddbff --- /dev/null +++ b/libraries/GCS_MAVLink/VERSION @@ -0,0 +1 @@ +1.0.6 diff --git a/libraries/GCS_MAVLink/doc/Doxyfile b/libraries/GCS_MAVLink/doc/Doxyfile deleted file mode 100755 index 4ab7c0e06f..0000000000 --- a/libraries/GCS_MAVLink/doc/Doxyfile +++ /dev/null @@ -1,1521 +0,0 @@ -# Doxyfile 1.6.1 - -# 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 a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "PIXHAWK IMU / Autopilot" - -# 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 = - -# 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 = - -# 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, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, 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 = - -# 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 = YES - -# 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. - -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 is your file systems -# 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 = - -# 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 = YES - -# 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, C#, 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 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 make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# 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 to 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 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 SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_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 and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# 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_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 = YES - -# 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 namespace 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 = NO - -# 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 = YES - -# 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 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 = YES - -# 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 - -# 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 sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define 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 defines 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 = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# 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 , where is the value of -# the FILE_VERSION_FILTER tag, and 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. The 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 = - -#--------------------------------------------------------------------------- -# 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 = YES - -# 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 - -# This WARN_NO_PARAMDOC option can be abled 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 = YES - -# 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 = doxy.log - -#--------------------------------------------------------------------------- -# 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 = .. - -# 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++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c *.h *.hpp *.hxx *.cc *.cpp *.cxx *.dox -#FILE_PATTERNS = - -# 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 = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# 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. - -EXCLUDE = ../Debug \ - ../Release \ - ../external \ - ../testing \ - ../tools \ - ../arm7/include \ - ../measurements - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem 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 , where -# is the value of the INPUT_FILTER tag, and 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. - -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, INPUT_FILTER -# is applied to all files. - -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 - -#--------------------------------------------------------------------------- -# 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 = YES - -# 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 and C++ 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 = YES - -# 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 = NO - -# 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 = html - -# 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. - -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 the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = 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. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# 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 - -# 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 = - -# 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 -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -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 = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# 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. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# 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 - -# 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 - -# When the SEARCHENGINE tag is enable 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) or Qt help (GENERATE_QHP) -# there is already a search function so this one should typically -# be disabled. - -SEARCHENGINE = YES - -#--------------------------------------------------------------------------- -# 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. - -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, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# 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 = - -# 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 - -#--------------------------------------------------------------------------- -# 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 stylesheet 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 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 -# in the INCLUDE_PATH (see below) will be search if 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 = IMU_PIXHAWK_V200 IMU_PIXHAWK_V210 - -# 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. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = NO - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. 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. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# 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 = - -# 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 = 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 is superseded by the HAVE_DOT option below. This is only a -# fallback. 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 = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need 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 = FreeSans - -# 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 output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -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 -# 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 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 graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES 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 png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# 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 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 = YES - -# 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 diff --git a/libraries/GCS_MAVLink/doc/README b/libraries/GCS_MAVLink/doc/README deleted file mode 100644 index 587460140e..0000000000 --- a/libraries/GCS_MAVLink/doc/README +++ /dev/null @@ -1,9 +0,0 @@ -MAVLink Micro Air Vehicle Message Marshalling Library - -The mavlink_to_html_table.xsl file is used to transform the MAVLink XML into a human-readable HTML table for online documentation. - -For more information, please visit: - -http://pixhawk.ethz.ch/software/mavlink - -(c) 2009-2010 Lorenz Meier / PIXHAWK Team diff --git a/libraries/GCS_MAVLink/doc/mavlink.css b/libraries/GCS_MAVLink/doc/mavlink.css deleted file mode 100644 index aeee8368a6..0000000000 --- a/libraries/GCS_MAVLink/doc/mavlink.css +++ /dev/null @@ -1,54 +0,0 @@ -table.sortable { - spacing: 5px; - border: 1px solid #656575; - width: 100%; -} - -table.sortable th { - margin: 5px; -} - -tr:nth-child(odd) { background-color:#eee; } -tr:nth-child(even) { background-color:#fff; } - -table.sortable thead { - background-color:#eee; - color:#666666; - font-weight: bold; - cursor: default; -} - -table.sortable td { - margin: 5px 5px 20px 5px; - vertical-align: top; -} - -table.sortable td.mavlink_name { - color:#226633; - font-weight: bold; - width: 25%; - vertical-align: top; -} - -table.sortable td.mavlink_mission_param { - color:#334455; - font-weight: bold; - width: 25%; -} - -table.sortable td.mavlink_type { - color:#323232; - font-weight: normal; - width: 12%; -} - -table.sortable td.mavlink_comment { - color:#555555; - font-weight: normal; - width: 60%; -} - -p.description { - color:#808080; - font-weight: normal; -} \ No newline at end of file diff --git a/libraries/GCS_MAVLink/doc/mavlink.php b/libraries/GCS_MAVLink/doc/mavlink.php deleted file mode 100644 index 871a1306d5..0000000000 --- a/libraries/GCS_MAVLink/doc/mavlink.php +++ /dev/null @@ -1,63 +0,0 @@ - - -// Requires the installation of php5-xsl -// e.g. on Debian/Ubuntu: sudo apt-get install php5-xsl - -// Load the file from the repository / server. -// Update this URL if the file location changes - -$xml_file_name = "http://github.com/pixhawk/mavlink/raw/master/mavlink_standard_message.xml"; - -// Load the XSL transformation file from the repository / server. -// This file can be updated by any client to adjust the table - -$xsl_file_name= "http://github.com/pixhawk/mavlink/raw/master/doc/mavlink_to_html_table.xsl"; - - - -// Load data XML file -$xml = file_get_contents($xml_file_name); -$xml_doc = new DomDocument; -$xml_doc->loadXML($xml); - -// Load stylesheet XSL file -$xsl = file_get_contents($xsl_file_name); -$xsl_doc = new DomDocument; -$xsl_doc->loadXML($xsl); - -$xsltproc = new XsltProcessor(); -$xsltproc->importStylesheet($xsl_doc); - -// process the files and write the output to $out_file -if ($html = $xsltproc->transformToXML($xml_doc)) -{ - echo $html; -} -else -{ - trigger_error('XSL transformation failed.',E_USER_ERROR); -} - - - - -

Messages XML Definition

- -Messages are defined by the mavlink_standard_message.xml file. The C packing/unpacking code is generated from this specification, as well as the HTML documentaiton in the section above.
-
-The XML displayed here is updated on every commit and therefore up-to-date. - - -//require_once("inc/geshi.php"); -//$xml_file_name = "http://github.com/pixhawk/mavlink/raw/master/mavlink_standard_message.xml"; -// -//// Load data XML file -//$xml = file_get_contents($xml_file_name); -// -//// Show the current code -//$geshi_xml = new GeSHi($xml, 'xml'); -//$display_xml = $geshi_xml->parse_code(); -// -//echo $display_xml; - - \ No newline at end of file diff --git a/libraries/GCS_MAVLink/doc/mavlink_to_html_table.xsl b/libraries/GCS_MAVLink/doc/mavlink_to_html_table.xsl deleted file mode 100644 index 1b1d9461ae..0000000000 --- a/libraries/GCS_MAVLink/doc/mavlink_to_html_table.xsl +++ /dev/null @@ -1,93 +0,0 @@ - - - - - -

MAVLink Include Files

-

Including files:

-
- - -

MAVLink Type Enumerations

- -
- - -

MAVLink Messages

- -
- - - -

- - - - - - - - - - - - -
Field NameTypeDescription
-
- - - - - - - - - - -

MAVLink Protocol Version

-

This file has protocol version: . The version numbers range from 1-255.

-
- - - -

- - - - - - - - - - - - -
CMD IDField NameDescription
-
- - - - - - - - - - - - -
- -
- - - - - Mission Param # - - - - - -
diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_dcm.h b/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_dcm.h deleted file mode 100644 index 60b89c1afd..0000000000 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_dcm.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE DCM PACKING - -#define MAVLINK_MSG_ID_DCM 163 - -typedef struct __mavlink_dcm_t -{ - float omegaIx; ///< X gyro drift estimate rad/s - float omegaIy; ///< Y gyro drift estimate rad/s - float omegaIz; ///< Z gyro drift estimate rad/s - float accel_weight; ///< average accel_weight - float renorm_val; ///< average renormalisation value - float error_rp; ///< average error_roll_pitch value - float error_yaw; ///< average error_yaw value -} mavlink_dcm_t; - -#define MAVLINK_MSG_ID_DCM_LEN 28 -#define MAVLINK_MSG_ID_163_LEN 28 - - - -#define MAVLINK_MESSAGE_INFO_DCM { \ - "DCM", \ - 7, \ - { { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_dcm_t, omegaIx) }, \ - { "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_dcm_t, omegaIy) }, \ - { "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_dcm_t, omegaIz) }, \ - { "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_dcm_t, accel_weight) }, \ - { "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_dcm_t, renorm_val) }, \ - { "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_dcm_t, error_rp) }, \ - { "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_dcm_t, error_yaw) }, \ - } \ -} - - -/** - * @brief Pack a dcm 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 omegaIx X gyro drift estimate rad/s - * @param omegaIy Y gyro drift estimate rad/s - * @param omegaIz Z gyro drift estimate rad/s - * @param accel_weight average accel_weight - * @param renorm_val average renormalisation value - * @param error_rp average error_roll_pitch value - * @param error_yaw average error_yaw value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_float(buf, 0, omegaIx); - _mav_put_float(buf, 4, omegaIy); - _mav_put_float(buf, 8, omegaIz); - _mav_put_float(buf, 12, accel_weight); - _mav_put_float(buf, 16, renorm_val); - _mav_put_float(buf, 20, error_rp); - _mav_put_float(buf, 24, error_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 28); -#else - mavlink_dcm_t packet; - packet.omegaIx = omegaIx; - packet.omegaIy = omegaIy; - packet.omegaIz = omegaIz; - packet.accel_weight = accel_weight; - packet.renorm_val = renorm_val; - packet.error_rp = error_rp; - packet.error_yaw = error_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 28); -#endif - - msg->msgid = MAVLINK_MSG_ID_DCM; - return mavlink_finalize_message(msg, system_id, component_id, 28); -} - -/** - * @brief Pack a dcm 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param omegaIx X gyro drift estimate rad/s - * @param omegaIy Y gyro drift estimate rad/s - * @param omegaIz Z gyro drift estimate rad/s - * @param accel_weight average accel_weight - * @param renorm_val average renormalisation value - * @param error_rp average error_roll_pitch value - * @param error_yaw average error_yaw value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_float(buf, 0, omegaIx); - _mav_put_float(buf, 4, omegaIy); - _mav_put_float(buf, 8, omegaIz); - _mav_put_float(buf, 12, accel_weight); - _mav_put_float(buf, 16, renorm_val); - _mav_put_float(buf, 20, error_rp); - _mav_put_float(buf, 24, error_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 28); -#else - mavlink_dcm_t packet; - packet.omegaIx = omegaIx; - packet.omegaIy = omegaIy; - packet.omegaIz = omegaIz; - packet.accel_weight = accel_weight; - packet.renorm_val = renorm_val; - packet.error_rp = error_rp; - packet.error_yaw = error_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 28); -#endif - - msg->msgid = MAVLINK_MSG_ID_DCM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28); -} - -/** - * @brief Encode a dcm struct into a 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 dcm C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_dcm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_dcm_t* dcm) -{ - return mavlink_msg_dcm_pack(system_id, component_id, msg, dcm->omegaIx, dcm->omegaIy, dcm->omegaIz, dcm->accel_weight, dcm->renorm_val, dcm->error_rp, dcm->error_yaw); -} - -/** - * @brief Send a dcm message - * @param chan MAVLink channel to send the message - * - * @param omegaIx X gyro drift estimate rad/s - * @param omegaIy Y gyro drift estimate rad/s - * @param omegaIz Z gyro drift estimate rad/s - * @param accel_weight average accel_weight - * @param renorm_val average renormalisation value - * @param error_rp average error_roll_pitch value - * @param error_yaw average error_yaw value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_float(buf, 0, omegaIx); - _mav_put_float(buf, 4, omegaIy); - _mav_put_float(buf, 8, omegaIz); - _mav_put_float(buf, 12, accel_weight); - _mav_put_float(buf, 16, renorm_val); - _mav_put_float(buf, 20, error_rp); - _mav_put_float(buf, 24, error_yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DCM, buf, 28); -#else - mavlink_dcm_t packet; - packet.omegaIx = omegaIx; - packet.omegaIy = omegaIy; - packet.omegaIz = omegaIz; - packet.accel_weight = accel_weight; - packet.renorm_val = renorm_val; - packet.error_rp = error_rp; - packet.error_yaw = error_yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DCM, (const char *)&packet, 28); -#endif -} - -#endif - -// MESSAGE DCM UNPACKING - - -/** - * @brief Get field omegaIx from dcm message - * - * @return X gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field omegaIy from dcm message - * - * @return Y gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field omegaIz from dcm message - * - * @return Z gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field accel_weight from dcm message - * - * @return average accel_weight - */ -static inline float mavlink_msg_dcm_get_accel_weight(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field renorm_val from dcm message - * - * @return average renormalisation value - */ -static inline float mavlink_msg_dcm_get_renorm_val(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field error_rp from dcm message - * - * @return average error_roll_pitch value - */ -static inline float mavlink_msg_dcm_get_error_rp(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field error_yaw from dcm message - * - * @return average error_yaw value - */ -static inline float mavlink_msg_dcm_get_error_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Decode a dcm message into a struct - * - * @param msg The message to decode - * @param dcm C-struct to decode the message contents into - */ -static inline void mavlink_msg_dcm_decode(const mavlink_message_t* msg, mavlink_dcm_t* dcm) -{ -#if MAVLINK_NEED_BYTE_SWAP - dcm->omegaIx = mavlink_msg_dcm_get_omegaIx(msg); - dcm->omegaIy = mavlink_msg_dcm_get_omegaIy(msg); - dcm->omegaIz = mavlink_msg_dcm_get_omegaIz(msg); - dcm->accel_weight = mavlink_msg_dcm_get_accel_weight(msg); - dcm->renorm_val = mavlink_msg_dcm_get_renorm_val(msg); - dcm->error_rp = mavlink_msg_dcm_get_error_rp(msg); - dcm->error_yaw = mavlink_msg_dcm_get_error_yaw(msg); -#else - memcpy(dcm, _MAV_PAYLOAD(msg), 28); -#endif -} diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h b/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h deleted file mode 100644 index 7ae650c71b..0000000000 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_fetch_point.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE FENCED_FETCH_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT 161 - -typedef struct __mavlink_fenced_fetch_point_t -{ - uint8_t idx; ///< point index (first point is 1, 0 is for return point) -} mavlink_fenced_fetch_point_t; - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT_LEN 1 -#define MAVLINK_MSG_ID_161_LEN 1 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_FETCH_POINT { \ - "FENCED_FETCH_POINT", \ - 1, \ - { { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fenced_fetch_point_t, idx) }, \ - } \ -} - - -/** - * @brief Pack a fenced_fetch_point 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 idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 1); -} - -/** - * @brief Pack a fenced_fetch_point 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 1); -} - -/** - * @brief Encode a fenced_fetch_point struct into a 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 fenced_fetch_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ - return mavlink_msg_fenced_fetch_point_pack(system_id, component_id, msg, fenced_fetch_point->idx); -} - -/** - * @brief Send a fenced_fetch_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_fetch_point_send(mavlink_channel_t chan, uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, (const char *)&packet, 1); -#endif -} - -#endif - -// MESSAGE FENCED_FETCH_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_fetch_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_fetch_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Decode a fenced_fetch_point message into a struct - * - * @param msg The message to decode - * @param fenced_fetch_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_fetch_point_decode(const mavlink_message_t* msg, mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_fetch_point->idx = mavlink_msg_fenced_fetch_point_get_idx(msg); -#else - memcpy(fenced_fetch_point, _MAV_PAYLOAD(msg), 1); -#endif -} diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h b/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h deleted file mode 100644 index 9b849b7763..0000000000 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fenced_point.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE FENCED_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_POINT 160 - -typedef struct __mavlink_fenced_point_t -{ - uint8_t idx; ///< point index (first point is 1, 0 is for return point) - uint8_t count; ///< total number of points (for sanity checking) - float lat; ///< Latitude of point - float lng; ///< Longitude of point -} mavlink_fenced_point_t; - -#define MAVLINK_MSG_ID_FENCED_POINT_LEN 10 -#define MAVLINK_MSG_ID_160_LEN 10 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_POINT { \ - "FENCED_POINT", \ - 4, \ - { { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fenced_point_t, idx) }, \ - { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fenced_point_t, count) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 2, offsetof(mavlink_fenced_point_t, lat) }, \ - { "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_fenced_point_t, lng) }, \ - } \ -} - - -/** - * @brief Pack a fenced_point 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 idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 10); -} - -/** - * @brief Pack a fenced_point 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx,uint8_t count,float lat,float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 10); -} - -/** - * @brief Encode a fenced_point struct into a 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 fenced_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_point_t* fenced_point) -{ - return mavlink_msg_fenced_point_pack(system_id, component_id, msg, fenced_point->idx, fenced_point->count, fenced_point->lat, fenced_point->lng); -} - -/** - * @brief Send a fenced_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_point_send(mavlink_channel_t chan, uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_uint8_t(buf, 0, idx); - _mav_put_uint8_t(buf, 1, count); - _mav_put_float(buf, 2, lat); - _mav_put_float(buf, 6, lng); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, buf, 10); -#else - mavlink_fenced_point_t packet; - packet.idx = idx; - packet.count = count; - packet.lat = lat; - packet.lng = lng; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, (const char *)&packet, 10); -#endif -} - -#endif - -// MESSAGE FENCED_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field count from fenced_point message - * - * @return total number of points (for sanity checking) - */ -static inline uint8_t mavlink_msg_fenced_point_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field lat from fenced_point message - * - * @return Latitude of point - */ -static inline float mavlink_msg_fenced_point_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 2); -} - -/** - * @brief Get field lng from fenced_point message - * - * @return Longitude of point - */ -static inline float mavlink_msg_fenced_point_get_lng(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 6); -} - -/** - * @brief Decode a fenced_point message into a struct - * - * @param msg The message to decode - * @param fenced_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_point_decode(const mavlink_message_t* msg, mavlink_fenced_point_t* fenced_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_point->idx = mavlink_msg_fenced_point_get_idx(msg); - fenced_point->count = mavlink_msg_fenced_point_get_count(msg); - fenced_point->lat = mavlink_msg_fenced_point_get_lat(msg); - fenced_point->lng = mavlink_msg_fenced_point_get_lng(msg); -#else - memcpy(fenced_point, _MAV_PAYLOAD(msg), 10); -#endif -} diff --git a/libraries/GCS_MAVLink/include/common/common.h b/libraries/GCS_MAVLink/include/common/common.h deleted file mode 100644 index d61e06153d..0000000000 --- a/libraries/GCS_MAVLink/include/common/common.h +++ /dev/null @@ -1,159 +0,0 @@ -/** @file - * @brief MAVLink comm protocol generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef COMMON_H -#define COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -// MESSAGE LENGTHS AND CRCS - -#ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 19, 2, 23, 21, 0, 37, 26, 101, 26, 16, 32, 32, 37, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 24, 24, 0, 0, 0, 26, 16, 36, 5, 6, 56, 26, 21, 18, 0, 0, 18, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 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, 36, 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, 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, 30, 14, 14, 51, 5} -#endif - -#ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {72, 39, 190, 92, 191, 217, 104, 119, 0, 219, 60, 186, 10, 0, 0, 0, 0, 0, 0, 0, 89, 159, 162, 121, 0, 149, 222, 110, 179, 136, 66, 126, 185, 147, 112, 252, 162, 215, 229, 128, 9, 106, 101, 213, 4, 229, 21, 214, 215, 14, 206, 50, 157, 126, 108, 213, 95, 5, 127, 0, 0, 0, 57, 126, 130, 119, 193, 191, 236, 158, 143, 0, 0, 104, 123, 131, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 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, 155, 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, 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, 178, 224, 60, 106, 7} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_BOOT, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, MAVLINK_MESSAGE_INFO_ACTION_ACK, MAVLINK_MESSAGE_INFO_ACTION, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_NAV_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_CONTROL_STATUS, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, MAVLINK_MESSAGE_INFO_SET_ALTITUDE, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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} -#endif - -#include "../protocol.h" - -#define MAVLINK_ENABLED_COMMON - - - -// MAVLINK VERSION - -#ifndef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -#if (MAVLINK_VERSION == 0) -#undef MAVLINK_VERSION -#define MAVLINK_VERSION 2 -#endif - -// ENUM DEFINITIONS - - -/** @brief Data stream IDs. 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 -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, /* | */ -}; -#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 -enum MAV_ROI -{ - MAV_ROI_NONE=0, /* No region of interest. | */ - MAV_ROI_WPNEXT=1, /* Point toward next waypoint. | */ - MAV_ROI_WPINDEX=2, /* Point toward given waypoint. | */ - MAV_ROI_LOCATION=3, /* Point toward fixed location. | */ - MAV_ROI_TARGET=4, /* Point toward of given id. | */ - MAV_ROI_ENUM_END=5, /* | */ -}; -#endif - -// MESSAGE DEFINITIONS -#include "./mavlink_msg_heartbeat.h" -#include "./mavlink_msg_boot.h" -#include "./mavlink_msg_system_time.h" -#include "./mavlink_msg_ping.h" -#include "./mavlink_msg_system_time_utc.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_action_ack.h" -#include "./mavlink_msg_action.h" -#include "./mavlink_msg_set_mode.h" -#include "./mavlink_msg_set_nav_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_scaled_imu.h" -#include "./mavlink_msg_gps_status.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_local_position.h" -#include "./mavlink_msg_global_position.h" -#include "./mavlink_msg_gps_raw.h" -#include "./mavlink_msg_sys_status.h" -#include "./mavlink_msg_rc_channels_raw.h" -#include "./mavlink_msg_rc_channels_scaled.h" -#include "./mavlink_msg_servo_output_raw.h" -#include "./mavlink_msg_waypoint.h" -#include "./mavlink_msg_waypoint_request.h" -#include "./mavlink_msg_waypoint_set_current.h" -#include "./mavlink_msg_waypoint_current.h" -#include "./mavlink_msg_waypoint_request_list.h" -#include "./mavlink_msg_waypoint_count.h" -#include "./mavlink_msg_waypoint_clear_all.h" -#include "./mavlink_msg_waypoint_reached.h" -#include "./mavlink_msg_waypoint_ack.h" -#include "./mavlink_msg_gps_set_global_origin.h" -#include "./mavlink_msg_gps_local_origin_set.h" -#include "./mavlink_msg_local_position_setpoint_set.h" -#include "./mavlink_msg_local_position_setpoint.h" -#include "./mavlink_msg_control_status.h" -#include "./mavlink_msg_safety_set_allowed_area.h" -#include "./mavlink_msg_safety_allowed_area.h" -#include "./mavlink_msg_set_roll_pitch_yaw_thrust.h" -#include "./mavlink_msg_set_roll_pitch_yaw_speed_thrust.h" -#include "./mavlink_msg_roll_pitch_yaw_thrust_setpoint.h" -#include "./mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h" -#include "./mavlink_msg_nav_controller_output.h" -#include "./mavlink_msg_position_target.h" -#include "./mavlink_msg_state_correction.h" -#include "./mavlink_msg_set_altitude.h" -#include "./mavlink_msg_request_data_stream.h" -#include "./mavlink_msg_hil_state.h" -#include "./mavlink_msg_hil_controls.h" -#include "./mavlink_msg_manual_control.h" -#include "./mavlink_msg_rc_channels_override.h" -#include "./mavlink_msg_global_position_int.h" -#include "./mavlink_msg_vfr_hud.h" -#include "./mavlink_msg_command.h" -#include "./mavlink_msg_command_ack.h" -#include "./mavlink_msg_optical_flow.h" -#include "./mavlink_msg_object_detection_event.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" - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // COMMON_H diff --git a/libraries/GCS_MAVLink/include/mavlink/config.h b/libraries/GCS_MAVLink/include/mavlink/config.h new file mode 100644 index 0000000000..a1fb99f0f0 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/config.h @@ -0,0 +1 @@ +#define MAVLINK_VERSION "1.0.6" diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/ardupilotmega.h similarity index 55% rename from libraries/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/ardupilotmega.h index 204c907555..4148b5a6a9 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/ardupilotmega.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/ardupilotmega.h @@ -20,7 +20,7 @@ extern "C" { #endif #ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_BOOT, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, MAVLINK_MESSAGE_INFO_ACTION_ACK, MAVLINK_MESSAGE_INFO_ACTION, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_NAV_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_CONTROL_STATUS, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, MAVLINK_MESSAGE_INFO_SET_ALTITUDE, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {NULL}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, MAVLINK_MESSAGE_INFO_AHRS, MAVLINK_MESSAGE_INFO_SIMSTATE, MAVLINK_MESSAGE_INFO_HWSTATUS, MAVLINK_MESSAGE_INFO_RADIO, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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} +#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_BOOT, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, 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}}}, MAVLINK_MESSAGE_INFO_ACTION_ACK, MAVLINK_MESSAGE_INFO_ACTION, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_NAV_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}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_CONTROL_STATUS, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {"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_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, MAVLINK_MESSAGE_INFO_SET_ALTITUDE, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, 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_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND, 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}}}, {"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_OPTICAL_FLOW, {"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_OBJECT_DETECTION_EVENT, {"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_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, MAVLINK_MESSAGE_INFO_AHRS, MAVLINK_MESSAGE_INFO_SIMSTATE, MAVLINK_MESSAGE_INFO_HWSTATUS, MAVLINK_MESSAGE_INFO_RADIO, {"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}}}, {"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_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG} #endif #include "../protocol.h" diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink.h similarity index 100% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink.h diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ahrs.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ahrs.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ahrs.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ahrs.h index c82afe2f23..9cb06e6b1a 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ahrs.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ahrs.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t componen _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t componen packet.error_rp = error_rp; packet.error_yaw = error_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_AHRS; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com packet.error_rp = error_rp; packet.error_yaw = error_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_AHRS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ap_adc.h similarity index 96% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ap_adc.h index d42edb15d3..07eacc9a91 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_ap_adc.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ap_adc.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_configure.h similarity index 98% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_configure.h index 92263b86a2..8df0a00d8b 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_configure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_configure.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 10, extra_param); _mav_put_float(buf, 11, extra_value); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_digicam_configure_t packet; packet.target_system = target_system; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin packet.extra_param = extra_param; packet.extra_value = extra_value; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 10, extra_param); _mav_put_float(buf, 11, extra_value); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_digicam_configure_t packet; packet.target_system = target_system; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id packet.extra_param = extra_param; packet.extra_value = extra_value; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_control.h similarity index 98% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_control.h index ee7d68124c..f0cc511de7 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_digicam_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_control.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 8, extra_param); _mav_put_float(buf, 9, extra_value); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_digicam_control_t packet; packet.target_system = target_system; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 packet.extra_param = extra_param; packet.extra_value = extra_value; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 8, extra_param); _mav_put_float(buf, 9, extra_value); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_digicam_control_t packet; packet.target_system = target_system; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, packet.extra_param = extra_param; packet.extra_value = extra_value; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_fetch_point.h similarity index 96% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_fetch_point.h index fb2a9831a4..112b1ecf07 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_fetch_point.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_fetch_point.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_point.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_point.h index 35d41de410..b46b259f44 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_point.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_point.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c _mav_put_float(buf, 4, lat); _mav_put_float(buf, 8, lng); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_fence_point_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c packet.lat = lat; packet.lng = lng; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint _mav_put_float(buf, 4, lat); _mav_put_float(buf, 8, lng); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_fence_point_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint packet.lat = lat; packet.lng = lng; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_status.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_status.h index cb72301117..77b3e56310 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_fence_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_status.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 3, breach_type); _mav_put_uint32_t(buf, 4, breach_time); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_fence_status_t packet; packet.breach_status = breach_status; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t packet.breach_type = breach_type; packet.breach_time = breach_time; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 3, breach_type); _mav_put_uint32_t(buf, 4, breach_time); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_fence_status_t packet; packet.breach_status = breach_status; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin packet.breach_type = breach_type; packet.breach_time = breach_time; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_hwstatus.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_hwstatus.h similarity index 95% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_hwstatus.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_hwstatus.h index 20fca8139c..47cc21484a 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_hwstatus.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_hwstatus.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t comp _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_meminfo.h similarity index 95% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_meminfo.h index b131967df9..e9efa5da22 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_meminfo.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_meminfo.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t compo _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_configure.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_configure.h index f2c73d301f..688d89415a 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_configure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_configure.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_control.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_control.h index 5f1d13eb8e..f13bea2d9f 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_control.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t _mav_put_int32_t(buf, 10, input_c); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_mount_control_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t packet.input_c = input_c; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui _mav_put_int32_t(buf, 10, input_c); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_mount_control_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui packet.input_c = input_c; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_status.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_status.h index 04bddae287..75a44321ec 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_mount_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_status.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t _mav_put_int32_t(buf, 6, pointing_b); _mav_put_int32_t(buf, 10, pointing_c); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_mount_status_t packet; packet.target_system = target_system; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t packet.pointing_b = pointing_b; packet.pointing_c = pointing_c; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin _mav_put_int32_t(buf, 6, pointing_b); _mav_put_int32_t(buf, 10, pointing_c); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_mount_status_t packet; packet.target_system = target_system; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin packet.pointing_b = pointing_b; packet.pointing_c = pointing_c; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_radio.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_radio.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_radio.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_radio.h index ee7e8f16cf..50b23b4e0f 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_radio.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_radio.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone _mav_put_uint16_t(buf, 5, rxerrors); _mav_put_uint16_t(buf, 7, fixed); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_radio_t packet; packet.rssi = rssi; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone packet.rxerrors = rxerrors; packet.fixed = fixed; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co _mav_put_uint16_t(buf, 5, rxerrors); _mav_put_uint16_t(buf, 7, fixed); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_radio_t packet; packet.rssi = rssi; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co packet.rxerrors = rxerrors; packet.fixed = fixed; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_sensor_offsets.h similarity index 98% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_sensor_offsets.h index 216211a8f8..3016ea9bd9 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_sensor_offsets.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_sensor_offsets.h @@ -80,7 +80,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ _mav_put_float(buf, 34, accel_cal_y); _mav_put_float(buf, 38, accel_cal_z); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_sensor_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ packet.accel_cal_y = accel_cal_y; packet.accel_cal_z = accel_cal_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u _mav_put_float(buf, 34, accel_cal_y); _mav_put_float(buf, 38, accel_cal_z); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_sensor_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -158,7 +158,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u packet.accel_cal_y = accel_cal_y; packet.accel_cal_z = accel_cal_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_set_mag_offsets.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_set_mag_offsets.h index 6243b440a9..99473e2f12 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_set_mag_offsets.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_set_mag_offsets.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 _mav_put_int16_t(buf, 4, mag_ofs_y); _mav_put_int16_t(buf, 6, mag_ofs_z); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_set_mag_offsets_t packet; packet.target_system = target_system; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, _mav_put_int16_t(buf, 4, mag_ofs_y); _mav_put_int16_t(buf, 6, mag_ofs_z); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_set_mag_offsets_t packet; packet.target_system = target_system; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_simstate.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_simstate.h similarity index 97% rename from libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_simstate.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_simstate.h index 4d487c99b5..05f9ca3cc4 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/mavlink_msg_simstate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_simstate.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 28, ygyro); _mav_put_float(buf, 32, zgyro); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_simstate_t packet; packet.roll = roll; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp packet.ygyro = ygyro; packet.zgyro = zgyro; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 28, ygyro); _mav_put_float(buf, 32, zgyro); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_simstate_t packet; packet.roll = roll; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t packet.ygyro = ygyro; packet.zgyro = zgyro; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; diff --git a/libraries/GCS_MAVLink/include/ardupilotmega/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/testsuite.h similarity index 94% rename from libraries/GCS_MAVLink/include/ardupilotmega/testsuite.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/testsuite.h index cbc002d64f..a3ac5476ca 100644 --- a/libraries/GCS_MAVLink/include/ardupilotmega/testsuite.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/ardupilotmega/testsuite.h @@ -534,14 +534,14 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma }; mavlink_fence_point_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.idx = packet_in.idx; - packet1.count = packet_in.count; - packet1.lat = packet_in.lat; - packet1.lng = packet_in.lng; - - + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.idx = packet_in.idx; + packet1.count = packet_in.count; + packet1.lat = packet_in.lat; + packet1.lng = packet_in.lng; + + memset(&packet2, 0, sizeof(packet2)); mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1); @@ -561,11 +561,11 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; i 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 waypoint (rotary wing)| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this waypoint an unlimited amount of time |Empty| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this waypoint for X turns |Turns| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this waypoint for X seconds |Seconds (decimal)| Empty| Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise| 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 |Empty| 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_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)| Waypoint 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_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| Empty| Empty| 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)| Empty| 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_CONTROL_VIDEO=200, /* Control onboard camera capturing. |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 + devices such as cameras. + |Region of interest mode. (see MAV_ROI enum)| Waypoint index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple cameras etc.)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + 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| Empty| Empty| Empty| */ + 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| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */ + MAV_CMD_ENUM_END=246, /* | */ +}; +#endif + +/** @brief Data stream IDs. 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 +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, /* | */ +}; +#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 +enum MAV_ROI +{ + MAV_ROI_NONE=0, /* No region of interest. | */ + MAV_ROI_WPNEXT=1, /* Point toward next waypoint. | */ + MAV_ROI_WPINDEX=2, /* Point toward given waypoint. | */ + MAV_ROI_LOCATION=3, /* Point toward fixed location. | */ + MAV_ROI_TARGET=4, /* Point toward of given id. | */ + MAV_ROI_ENUM_END=5, /* | */ +}; +#endif + +// MESSAGE DEFINITIONS +#include "./mavlink_msg_heartbeat.h" +#include "./mavlink_msg_boot.h" +#include "./mavlink_msg_system_time.h" +#include "./mavlink_msg_ping.h" +#include "./mavlink_msg_system_time_utc.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_action_ack.h" +#include "./mavlink_msg_action.h" +#include "./mavlink_msg_set_mode.h" +#include "./mavlink_msg_set_nav_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_scaled_imu.h" +#include "./mavlink_msg_gps_status.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_local_position.h" +#include "./mavlink_msg_global_position.h" +#include "./mavlink_msg_gps_raw.h" +#include "./mavlink_msg_sys_status.h" +#include "./mavlink_msg_rc_channels_raw.h" +#include "./mavlink_msg_rc_channels_scaled.h" +#include "./mavlink_msg_servo_output_raw.h" +#include "./mavlink_msg_waypoint.h" +#include "./mavlink_msg_waypoint_request.h" +#include "./mavlink_msg_waypoint_set_current.h" +#include "./mavlink_msg_waypoint_current.h" +#include "./mavlink_msg_waypoint_request_list.h" +#include "./mavlink_msg_waypoint_count.h" +#include "./mavlink_msg_waypoint_clear_all.h" +#include "./mavlink_msg_waypoint_reached.h" +#include "./mavlink_msg_waypoint_ack.h" +#include "./mavlink_msg_gps_set_global_origin.h" +#include "./mavlink_msg_gps_local_origin_set.h" +#include "./mavlink_msg_local_position_setpoint_set.h" +#include "./mavlink_msg_local_position_setpoint.h" +#include "./mavlink_msg_control_status.h" +#include "./mavlink_msg_safety_set_allowed_area.h" +#include "./mavlink_msg_safety_allowed_area.h" +#include "./mavlink_msg_set_roll_pitch_yaw_thrust.h" +#include "./mavlink_msg_set_roll_pitch_yaw_speed_thrust.h" +#include "./mavlink_msg_roll_pitch_yaw_thrust_setpoint.h" +#include "./mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h" +#include "./mavlink_msg_nav_controller_output.h" +#include "./mavlink_msg_position_target.h" +#include "./mavlink_msg_state_correction.h" +#include "./mavlink_msg_set_altitude.h" +#include "./mavlink_msg_request_data_stream.h" +#include "./mavlink_msg_hil_state.h" +#include "./mavlink_msg_hil_controls.h" +#include "./mavlink_msg_manual_control.h" +#include "./mavlink_msg_rc_channels_override.h" +#include "./mavlink_msg_global_position_int.h" +#include "./mavlink_msg_vfr_hud.h" +#include "./mavlink_msg_command.h" +#include "./mavlink_msg_command_ack.h" +#include "./mavlink_msg_optical_flow.h" +#include "./mavlink_msg_object_detection_event.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" + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // COMMON_H diff --git a/libraries/GCS_MAVLink/include/common/mavlink.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink.h similarity index 100% rename from libraries/GCS_MAVLink/include/common/mavlink.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink.h diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_action.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_action.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action.h index a92f3e0052..ada9aa7a29 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_action.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_action_pack(uint8_t system_id, uint8_t compon _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, action); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_action_t packet; packet.target = target; packet.target_component = target_component; packet.action = action; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_ACTION; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_action_pack_chan(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, action); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_action_t packet; packet.target = target; packet.target_component = target_component; packet.action = action; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_ACTION; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_action_ack.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action_ack.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_action_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action_ack.h index b7fb3256db..a87b35b599 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_action_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_action_ack.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_action_ack_pack(uint8_t system_id, uint8_t co _mav_put_uint8_t(buf, 0, action); _mav_put_uint8_t(buf, 1, result); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_action_ack_t packet; packet.action = action; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_action_ack_pack_chan(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 0, action); _mav_put_uint8_t(buf, 1, result); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_action_ack_t packet; packet.action = action; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_attitude.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_attitude.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_attitude.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_attitude.h index d3e3cb3dc2..188f1eb0ff 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_attitude.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_attitude.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_attitude_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_attitude_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_auth_key.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_auth_key.h similarity index 94% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_auth_key.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_auth_key.h index c563fb7828..c451444eac 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_auth_key.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_auth_key.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp char buf[32]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t char buf[32]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_boot.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_boot.h similarity index 94% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_boot.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_boot.h index 7541cabef6..570949bd56 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_boot.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_boot.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_boot_pack(uint8_t system_id, uint8_t componen char buf[4]; _mav_put_uint32_t(buf, 0, version); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_boot_t packet; packet.version = version; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_BOOT; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_boot_pack_chan(uint8_t system_id, uint8_t com char buf[4]; _mav_put_uint32_t(buf, 0, version); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_boot_t packet; packet.version = version; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_BOOT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control.h index 6292849bd0..8fad932ea8 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i _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(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #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(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys _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(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #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(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control_ack.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control_ack.h index a24c6f5a06..e9e195bbb9 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_change_operator_control_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_change_operator_control_ack.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #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(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #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(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_command.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_command.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command.h index a7221fa444..b5d44f8b2b 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_command.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_command_pack(uint8_t system_id, uint8_t compo _mav_put_float(buf, 12, param3); _mav_put_float(buf, 16, param4); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_command_t packet; packet.target_system = target_system; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_command_pack(uint8_t system_id, uint8_t compo packet.param3 = param3; packet.param4 = param4; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_command_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 12, param3); _mav_put_float(buf, 16, param4); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_command_t packet; packet.target_system = target_system; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_command_pack_chan(uint8_t system_id, uint8_t packet.param3 = param3; packet.param4 = param4; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_command_ack.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command_ack.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_command_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command_ack.h index 7fc8c86232..ee4c89dcfa 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_command_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_command_ack.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c _mav_put_float(buf, 0, command); _mav_put_float(buf, 4, result); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint _mav_put_float(buf, 0, command); _mav_put_float(buf, 4, result); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_control_status.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_control_status.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_control_status.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_control_status.h index 617cf5ba98..ebc1568cc1 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_control_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_control_status.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_control_status_pack(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 6, control_pos_z); _mav_put_uint8_t(buf, 7, control_pos_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_control_status_t packet; packet.position_fix = position_fix; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_control_status_pack(uint8_t system_id, uint8_ packet.control_pos_z = control_pos_z; packet.control_pos_yaw = control_pos_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_control_status_pack_chan(uint8_t system_id, u _mav_put_uint8_t(buf, 6, control_pos_z); _mav_put_uint8_t(buf, 7, control_pos_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_control_status_t packet; packet.position_fix = position_fix; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_control_status_pack_chan(uint8_t system_id, u packet.control_pos_z = control_pos_z; packet.control_pos_yaw = control_pos_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_debug.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_debug.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug.h index 1f0788a3a4..5a0fbdd710 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_debug.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone _mav_put_uint8_t(buf, 0, ind); _mav_put_float(buf, 1, value); - memcpy(_MAV_PAYLOAD(msg), buf, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); #else mavlink_debug_t packet; packet.ind = ind; packet.value = value; - memcpy(_MAV_PAYLOAD(msg), &packet, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co _mav_put_uint8_t(buf, 0, ind); _mav_put_float(buf, 1, value); - memcpy(_MAV_PAYLOAD(msg), buf, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); #else mavlink_debug_t packet; packet.ind = ind; packet.value = value; - memcpy(_MAV_PAYLOAD(msg), &packet, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug_vect.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug_vect.h index 5a1a070997..51895f3bad 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_debug_vect.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_debug_vect.h @@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co _mav_put_float(buf, 22, y); _mav_put_float(buf, 26, z); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_debug_vect_t packet; packet.usec = usec; @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; @@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 _mav_put_float(buf, 22, y); _mav_put_float(buf, 26, z); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_debug_vect_t packet; packet.usec = usec; @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_global_position.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_global_position.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position.h index d281646a56..5e0b9fe810 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_global_position.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_global_position_pack(uint8_t system_id, uint8 _mav_put_float(buf, 24, vy); _mav_put_float(buf, 28, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_global_position_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_global_position_pack(uint8_t system_id, uint8 packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_global_position_pack_chan(uint8_t system_id, _mav_put_float(buf, 24, vy); _mav_put_float(buf, 28, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_global_position_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_global_position_pack_chan(uint8_t system_id, packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position_int.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position_int.h index fa984daadf..859a500499 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_global_position_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_global_position_int.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u _mav_put_int16_t(buf, 14, vy); _mav_put_int16_t(buf, 16, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_global_position_int_t packet; packet.lat = lat; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ _mav_put_int16_t(buf, 14, vy); _mav_put_int16_t(buf, 16, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_global_position_int_t packet; packet.lat = lat; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_local_origin_set.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_local_origin_set.h index 0e011483bd..5faec2812c 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_local_origin_set.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_local_origin_set.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_gps_local_origin_set_pack(uint8_t system_id, _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_gps_local_origin_set_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_gps_local_origin_set_pack_chan(uint8_t system _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_gps_local_origin_set_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw.h index e2e0051498..255cb27bef 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_raw_pack(uint8_t system_id, uint8_t compo _mav_put_float(buf, 29, v); _mav_put_float(buf, 33, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_gps_raw_t packet; packet.usec = usec; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_gps_raw_pack(uint8_t system_id, uint8_t compo packet.v = v; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_gps_raw_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 29, v); _mav_put_float(buf, 33, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_gps_raw_t packet; packet.usec = usec; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_gps_raw_pack_chan(uint8_t system_id, uint8_t packet.v = v; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw_int.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw_int.h index 5f5b595601..f1e7a05e5d 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_raw_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_raw_int.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c _mav_put_float(buf, 29, v); _mav_put_float(buf, 33, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_gps_raw_int_t packet; packet.usec = usec; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c packet.v = v; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint _mav_put_float(buf, 29, v); _mav_put_float(buf, 33, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_gps_raw_int_t packet; packet.usec = usec; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint packet.v = v; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_set_global_origin.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_set_global_origin.h index 664f781646..cdd1f242a7 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_set_global_origin.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_set_global_origin.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_gps_set_global_origin_pack(uint8_t system_id, _mav_put_int32_t(buf, 6, longitude); _mav_put_int32_t(buf, 10, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_gps_set_global_origin_t packet; packet.target_system = target_system; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_gps_set_global_origin_pack(uint8_t system_id, packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_gps_set_global_origin_pack_chan(uint8_t syste _mav_put_int32_t(buf, 6, longitude); _mav_put_int32_t(buf, 10, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_gps_set_global_origin_t packet; packet.target_system = target_system; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_gps_set_global_origin_pack_chan(uint8_t syste packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_status.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_status.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_gps_status.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_status.h index c0ed8c1a78..e13ffe3829 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_gps_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_gps_status.h @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co _mav_put_int8_t_array(buf, 41, satellite_elevation, 20); _mav_put_int8_t_array(buf, 61, satellite_azimuth, 20); _mav_put_int8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(int8_t)*20); mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(int8_t)*20); mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(int8_t)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; @@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 _mav_put_int8_t_array(buf, 41, satellite_elevation, 20); _mav_put_int8_t_array(buf, 61, satellite_azimuth, 20); _mav_put_int8_t_array(buf, 81, satellite_snr, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(int8_t)*20); mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(int8_t)*20); mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(int8_t)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_heartbeat.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_heartbeat.h index 86bf637b1b..aad90d29f3 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_heartbeat.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_heartbeat.h @@ -43,14 +43,14 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 1, autopilot); _mav_put_uint8_t(buf, 2, 2); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_heartbeat_t packet; packet.type = type; packet.autopilot = autopilot; packet.mavlink_version = 2; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; @@ -77,14 +77,14 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 1, autopilot); _mav_put_uint8_t(buf, 2, 2); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_heartbeat_t packet; packet.type = type; packet.autopilot = autopilot; packet.mavlink_version = 2; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_controls.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_controls.h index 302b23d41c..231c6f216b 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_hil_controls.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_controls.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 24, mode); _mav_put_uint8_t(buf, 25, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_hil_controls_t packet; packet.time_us = time_us; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 24, mode); _mav_put_uint8_t(buf, 25, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_hil_controls_t packet; packet.time_us = time_us; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_hil_state.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_state.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_hil_state.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_state.h index 53c3a8efeb..6692c22580 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_hil_state.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_hil_state.h @@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); #else mavlink_hil_state_t packet; packet.usec = usec; @@ -116,7 +116,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; @@ -170,7 +170,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); #else mavlink_hil_state_t packet; packet.usec = usec; @@ -190,7 +190,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_local_position.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position.h index fca313b8e9..121fb3af64 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_local_position_pack(uint8_t system_id, uint8_ _mav_put_float(buf, 24, vy); _mav_put_float(buf, 28, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_local_position_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_local_position_pack(uint8_t system_id, uint8_ packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_local_position_pack_chan(uint8_t system_id, u _mav_put_float(buf, 24, vy); _mav_put_float(buf, 28, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_local_position_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_local_position_pack_chan(uint8_t system_id, u packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint.h index 08c8e35eb2..2e6178d96e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint_set.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint_set.h index de3aee9498..e676c28329 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_local_position_setpoint_set.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_local_position_setpoint_set.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_set_pack(uint8_t syst _mav_put_float(buf, 10, z); _mav_put_float(buf, 14, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_local_position_setpoint_set_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_set_pack(uint8_t syst packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_set_pack_chan(uint8_t _mav_put_float(buf, 10, z); _mav_put_float(buf, 14, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_local_position_setpoint_set_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_set_pack_chan(uint8_t packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_manual_control.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_manual_control.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_manual_control.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_manual_control.h index 09db3d9216..26b70ce4ae 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_manual_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_manual_control.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 19, yaw_manual); _mav_put_uint8_t(buf, 20, thrust_manual); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_manual_control_t packet; packet.target = target; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ packet.yaw_manual = yaw_manual; packet.thrust_manual = thrust_manual; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u _mav_put_uint8_t(buf, 19, yaw_manual); _mav_put_uint8_t(buf, 20, thrust_manual); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_manual_control_t packet; packet.target = target; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u packet.yaw_manual = yaw_manual; packet.thrust_manual = thrust_manual; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_float.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_float.h index 7b41755d21..5cf76e372e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_float.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_float.h @@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin char buf[14]; _mav_put_float(buf, 10, value); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_named_value_float_t packet; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; @@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id char buf[14]; _mav_put_float(buf, 10, value); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_named_value_float_t packet; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_int.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_int.h index a484e6e1f1..93f0911aa8 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_named_value_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_named_value_int.h @@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8 char buf[14]; _mav_put_int32_t(buf, 10, value); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_named_value_int_t packet; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; @@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, char buf[14]; _mav_put_int32_t(buf, 10, value); _mav_put_char_array(buf, 0, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_named_value_int_t packet; packet.value = value; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_nav_controller_output.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_nav_controller_output.h index 8322c8fabb..64a4a7fb4e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_nav_controller_output.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_nav_controller_output.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, _mav_put_float(buf, 18, aspd_error); _mav_put_float(buf, 22, xtrack_error); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, packet.aspd_error = aspd_error; packet.xtrack_error = xtrack_error; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste _mav_put_float(buf, 18, aspd_error); _mav_put_float(buf, 22, xtrack_error); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste packet.aspd_error = aspd_error; packet.xtrack_error = xtrack_error; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_object_detection_event.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_object_detection_event.h index fc707cb739..617eb50d44 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_object_detection_event.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_object_detection_event.h @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_object_detection_event_pack(uint8_t system_id _mav_put_float(buf, 28, bearing); _mav_put_float(buf, 32, distance); _mav_put_char_array(buf, 7, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_object_detection_event_t packet; packet.time = time; @@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_object_detection_event_pack(uint8_t system_id packet.bearing = bearing; packet.distance = distance; mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; @@ -104,7 +104,7 @@ static inline uint16_t mavlink_msg_object_detection_event_pack_chan(uint8_t syst _mav_put_float(buf, 28, bearing); _mav_put_float(buf, 32, distance); _mav_put_char_array(buf, 7, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_object_detection_event_t packet; packet.time = time; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_object_detection_event_pack_chan(uint8_t syst packet.bearing = bearing; packet.distance = distance; mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_optical_flow.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_optical_flow.h index a4bfb18a7c..33067cc891 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_optical_flow.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_optical_flow.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 13, quality); _mav_put_float(buf, 14, ground_distance); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_optical_flow_t packet; packet.time = time; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t packet.quality = quality; packet.ground_distance = ground_distance; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 13, quality); _mav_put_float(buf, 14, ground_distance); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_optical_flow_t packet; packet.time = time; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin packet.quality = quality; packet.ground_distance = ground_distance; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_list.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_list.h index 123ac79778..39e35915e1 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_list.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_read.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_read.h index d84ed5f032..c02cb04492 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_request_read.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_request_read.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 1, target_component); _mav_put_int16_t(buf, 17, param_index); _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); #else mavlink_param_request_read_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.param_index = param_index; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 1, target_component); _mav_put_int16_t(buf, 17, param_index); _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); #else mavlink_param_request_read_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.param_index = param_index; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_set.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_set.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_param_set.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_set.h index 2703b70765..e6648430f6 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_set.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_set.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 1, target_component); _mav_put_float(buf, 17, param_value); _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_param_set_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.param_value = param_value; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 1, target_component); _mav_put_float(buf, 17, param_value); _mav_put_int8_t_array(buf, 2, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_param_set_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.param_value = param_value; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_value.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_value.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_param_value.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_value.h index 1ded094763..634fbb1527 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_param_value.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_param_value.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c _mav_put_uint16_t(buf, 19, param_count); _mav_put_uint16_t(buf, 21, param_index); _mav_put_int8_t_array(buf, 0, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); #else mavlink_param_value_t packet; packet.param_value = param_value; packet.param_count = param_count; packet.param_index = param_index; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint _mav_put_uint16_t(buf, 19, param_count); _mav_put_uint16_t(buf, 21, param_index); _mav_put_int8_t_array(buf, 0, param_id, 15); - memcpy(_MAV_PAYLOAD(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); #else mavlink_param_value_t packet; packet.param_value = param_value; packet.param_count = param_count; packet.param_index = param_index; mav_array_memcpy(packet.param_id, param_id, sizeof(int8_t)*15); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_ping.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_ping.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_ping.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_ping.h index c424221380..ad076fd9b5 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_ping.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_ping.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen _mav_put_uint8_t(buf, 5, target_component); _mav_put_uint64_t(buf, 6, time); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_ping_t packet; packet.seq = seq; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen packet.target_component = target_component; packet.time = time; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_PING; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 5, target_component); _mav_put_uint64_t(buf, 6, time); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_ping_t packet; packet.seq = seq; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com packet.target_component = target_component; packet.time = time; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_PING; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_position_target.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_position_target.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_position_target.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_position_target.h index 4d9cdc4806..6cd7719fb2 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_position_target.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_position_target.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_position_target_pack(uint8_t system_id, uint8 _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_position_target_t packet; packet.x = x; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_position_target_pack(uint8_t system_id, uint8 packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_position_target_pack_chan(uint8_t system_id, _mav_put_float(buf, 8, z); _mav_put_float(buf, 12, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_position_target_t packet; packet.x = x; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_position_target_pack_chan(uint8_t system_id, packet.z = z; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_imu.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_imu.h index a3a3500fde..c60945ae9f 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_raw_imu.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_imu.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_raw_imu_t packet; packet.usec = usec; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_raw_imu_t packet; packet.usec = usec; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_pressure.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_pressure.h index b56d3e622e..b493b7e988 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_raw_pressure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_raw_pressure.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_raw_pressure_t packet; packet.usec = usec; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_raw_pressure_t packet; packet.usec = usec; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_override.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_override.h index d163158f7f..30e5a8f98e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_override.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_override.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, _mav_put_uint16_t(buf, 14, chan7_raw); _mav_put_uint16_t(buf, 16, chan8_raw); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_rc_channels_override_t packet; packet.target_system = target_system; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, packet.chan7_raw = chan7_raw; packet.chan8_raw = chan8_raw; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system _mav_put_uint16_t(buf, 14, chan7_raw); _mav_put_uint16_t(buf, 16, chan8_raw); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_rc_channels_override_t packet; packet.target_system = target_system; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system packet.chan7_raw = chan7_raw; packet.chan8_raw = chan8_raw; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_raw.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_raw.h index 6df3485082..855f7cced3 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_raw.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 _mav_put_uint16_t(buf, 14, chan8_raw); _mav_put_uint8_t(buf, 16, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_rc_channels_raw_t packet; packet.chan1_raw = chan1_raw; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 packet.chan8_raw = chan8_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, _mav_put_uint16_t(buf, 14, chan8_raw); _mav_put_uint8_t(buf, 16, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_rc_channels_raw_t packet; packet.chan1_raw = chan1_raw; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, packet.chan8_raw = chan8_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_scaled.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_scaled.h index b178ad1731..49df14a7ac 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_rc_channels_scaled.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_rc_channels_scaled.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui _mav_put_int16_t(buf, 14, chan8_scaled); _mav_put_uint8_t(buf, 16, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_rc_channels_scaled_t packet; packet.chan1_scaled = chan1_scaled; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui packet.chan8_scaled = chan8_scaled; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i _mav_put_int16_t(buf, 14, chan8_scaled); _mav_put_uint8_t(buf, 16, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_rc_channels_scaled_t packet; packet.chan1_scaled = chan1_scaled; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i packet.chan8_scaled = chan8_scaled; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_request_data_stream.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_request_data_stream.h index 895897738c..e80473aa11 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_request_data_stream.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_request_data_stream.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u _mav_put_uint16_t(buf, 3, req_message_rate); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_request_data_stream_t packet; packet.target_system = target_system; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u packet.req_message_rate = req_message_rate; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ _mav_put_uint16_t(buf, 3, req_message_rate); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_request_data_stream_t packet; packet.target_system = target_system; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ packet.req_message_rate = req_message_rate; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h index 4d0a87e2fd..b344f3aa27 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin _mav_put_float(buf, 16, yaw_speed); _mav_put_float(buf, 20, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_us = time_us; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha _mav_put_float(buf, 16, yaw_speed); _mav_put_float(buf, 20, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_us = time_us; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h index 7de8441ab0..16155f1343 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s _mav_put_float(buf, 16, yaw); _mav_put_float(buf, 20, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_us = time_us; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint _mav_put_float(buf, 16, yaw); _mav_put_float(buf, 20, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_us = time_us; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 24); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_allowed_area.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_allowed_area.h index d76c204f7a..07b91fd0ed 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_safety_allowed_area.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_allowed_area.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u _mav_put_float(buf, 17, p2y); _mav_put_float(buf, 21, p2z); - memcpy(_MAV_PAYLOAD(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_safety_allowed_area_t packet; packet.frame = frame; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u packet.p2y = p2y; packet.p2z = p2z; - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ _mav_put_float(buf, 17, p2y); _mav_put_float(buf, 21, p2z); - memcpy(_MAV_PAYLOAD(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_safety_allowed_area_t packet; packet.frame = frame; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ packet.p2y = p2y; packet.p2z = p2z; - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_set_allowed_area.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_set_allowed_area.h index 8afdf6f133..3c122227a6 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_safety_set_allowed_area.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_safety_set_allowed_area.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i _mav_put_float(buf, 19, p2y); _mav_put_float(buf, 23, p2z); - memcpy(_MAV_PAYLOAD(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); #else mavlink_safety_set_allowed_area_t packet; packet.target_system = target_system; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i packet.p2y = p2y; packet.p2z = p2z; - memcpy(_MAV_PAYLOAD(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys _mav_put_float(buf, 19, p2y); _mav_put_float(buf, 23, p2z); - memcpy(_MAV_PAYLOAD(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); #else mavlink_safety_set_allowed_area_t packet; packet.target_system = target_system; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys packet.p2y = p2y; packet.p2z = p2z; - memcpy(_MAV_PAYLOAD(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_imu.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_imu.h index 7bec81d9d5..4315dac275 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_imu.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_imu.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_scaled_imu_t packet; packet.usec = usec; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_scaled_imu_t packet; packet.usec = usec; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_pressure.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_pressure.h index 287c9a95b7..579f7f4ee3 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_scaled_pressure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_scaled_pressure.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 _mav_put_float(buf, 12, press_diff); _mav_put_int16_t(buf, 16, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_scaled_pressure_t packet; packet.usec = usec; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, _mav_put_float(buf, 12, press_diff); _mav_put_int16_t(buf, 16, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_scaled_pressure_t packet; packet.usec = usec; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_servo_output_raw.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_servo_output_raw.h index 3c2b52e906..b5be3318cc 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_servo_output_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_servo_output_raw.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint _mav_put_uint16_t(buf, 12, servo7_raw); _mav_put_uint16_t(buf, 14, servo8_raw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_servo_output_raw_t packet; packet.servo1_raw = servo1_raw; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint packet.servo7_raw = servo7_raw; packet.servo8_raw = servo8_raw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, _mav_put_uint16_t(buf, 12, servo7_raw); _mav_put_uint16_t(buf, 14, servo8_raw); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_servo_output_raw_t packet; packet.servo1_raw = servo1_raw; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, packet.servo7_raw = servo7_raw; packet.servo8_raw = servo8_raw; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_altitude.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_altitude.h index 14398bc53e..72cc5e7b0c 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_altitude.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_altitude.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_set_altitude_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 0, target); _mav_put_uint32_t(buf, 1, mode); - memcpy(_MAV_PAYLOAD(msg), buf, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); #else mavlink_set_altitude_t packet; packet.target = target; packet.mode = mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); #endif msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_set_altitude_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 0, target); _mav_put_uint32_t(buf, 1, mode); - memcpy(_MAV_PAYLOAD(msg), buf, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); #else mavlink_set_altitude_t packet; packet.target = target; packet.mode = mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 5); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); #endif msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_mode.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_mode.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_set_mode.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_mode.h index 6630aea486..8a3f20593d 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_mode.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_mode.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp _mav_put_uint8_t(buf, 0, target); _mav_put_uint8_t(buf, 1, mode); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_set_mode_t packet; packet.target = target; packet.mode = mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 0, target); _mav_put_uint8_t(buf, 1, mode); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_set_mode_t packet; packet.target = target; packet.mode = mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_nav_mode.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_nav_mode.h index fafb6ec7e5..02efa26b19 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_nav_mode.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_nav_mode.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_set_nav_mode_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 0, target); _mav_put_uint8_t(buf, 1, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_set_nav_mode_t packet; packet.target = target; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_set_nav_mode_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 0, target); _mav_put_uint8_t(buf, 1, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_set_nav_mode_t packet; packet.target = target; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h index d666d0cca6..6a9c01215b 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t _mav_put_float(buf, 10, yaw_speed); _mav_put_float(buf, 14, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin _mav_put_float(buf, 10, yaw_speed); _mav_put_float(buf, 14, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_thrust.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_thrust.h index ad9425158e..dad4f657dd 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_set_roll_pitch_yaw_thrust.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_set_roll_pitch_yaw_thrust.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system _mav_put_float(buf, 10, yaw); _mav_put_float(buf, 14, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s _mav_put_float(buf, 10, yaw); _mav_put_float(buf, 14, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_state_correction.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_state_correction.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_state_correction.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_state_correction.h index 9c9f6d9b89..ddd785a2ac 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_state_correction.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_state_correction.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_statustext.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_statustext.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_statustext.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_statustext.h index da6cd7a18c..c65f629e99 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_statustext.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_statustext.h @@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co char buf[51]; _mav_put_uint8_t(buf, 0, severity); _mav_put_int8_t_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(int8_t)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; @@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8 char buf[51]; _mav_put_uint8_t(buf, 0, severity); _mav_put_int8_t_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(int8_t)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_sys_status.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_sys_status.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_sys_status.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_sys_status.h index 9add0d069f..1217ea60e9 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_sys_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_sys_status.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co _mav_put_uint16_t(buf, 7, battery_remaining); _mav_put_uint16_t(buf, 9, packet_drop); - memcpy(_MAV_PAYLOAD(msg), buf, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11); #else mavlink_sys_status_t packet; packet.mode = mode; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co packet.battery_remaining = battery_remaining; packet.packet_drop = packet_drop; - memcpy(_MAV_PAYLOAD(msg), &packet, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 _mav_put_uint16_t(buf, 7, battery_remaining); _mav_put_uint16_t(buf, 9, packet_drop); - memcpy(_MAV_PAYLOAD(msg), buf, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11); #else mavlink_sys_status_t packet; packet.mode = mode; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 packet.battery_remaining = battery_remaining; packet.packet_drop = packet_drop; - memcpy(_MAV_PAYLOAD(msg), &packet, 11); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_system_time.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_system_time.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time.h index cf2b1f6fe9..362586a70d 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_system_time.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c char buf[8]; _mav_put_uint64_t(buf, 0, time_usec); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_t packet; packet.time_usec = time_usec; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint char buf[8]; _mav_put_uint64_t(buf, 0, time_usec); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_t packet; packet.time_usec = time_usec; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time_utc.h similarity index 95% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time_utc.h index 70ebf56389..5688435d53 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_system_time_utc.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_system_time_utc.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_system_time_utc_pack(uint8_t system_id, uint8 _mav_put_uint32_t(buf, 0, utc_date); _mav_put_uint32_t(buf, 4, utc_time); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_utc_t packet; packet.utc_date = utc_date; packet.utc_time = utc_time; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_system_time_utc_pack_chan(uint8_t system_id, _mav_put_uint32_t(buf, 0, utc_date); _mav_put_uint32_t(buf, 4, utc_time); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_utc_t packet; packet.utc_date = utc_date; packet.utc_time = utc_time; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_vfr_hud.h similarity index 97% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_vfr_hud.h index 705d8d4db0..0f92de775e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_vfr_hud.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_vfr_hud.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo _mav_put_float(buf, 12, alt); _mav_put_float(buf, 16, climb); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo packet.alt = alt; packet.climb = climb; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 12, alt); _mav_put_float(buf, 16, climb); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t packet.alt = alt; packet.climb = climb; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint.h similarity index 98% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint.h index 27e89de1f7..d9b21e3c94 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint.h @@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_waypoint_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 28, y); _mav_put_float(buf, 32, z); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_waypoint_t packet; packet.target_system = target_system; @@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_waypoint_pack(uint8_t system_id, uint8_t comp packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT; @@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_waypoint_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 28, y); _mav_put_float(buf, 32, z); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_waypoint_t packet; packet.target_system = target_system; @@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_waypoint_pack_chan(uint8_t system_id, uint8_t packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_ack.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_ack.h index 2b36087189..ddba2adf4c 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_ack.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_waypoint_ack_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_waypoint_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_waypoint_ack_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_waypoint_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_clear_all.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_clear_all.h index bca8dcc1f4..8eab44b267 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_clear_all.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_clear_all.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_waypoint_clear_all_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_waypoint_clear_all_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_count.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_count.h index 73c62f831d..af1dd382b6 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_count.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_count.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_waypoint_count_pack(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, count); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_count_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.count = count; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_waypoint_count_pack_chan(uint8_t system_id, u _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, count); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_count_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.count = count; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_current.h similarity index 94% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_current.h index 411b867667..a7e4557d6e 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_current.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_current.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_waypoint_current_pack(uint8_t system_id, uint char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_waypoint_current_pack_chan(uint8_t system_id, char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_reached.h similarity index 94% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_reached.h index 6f291c7095..d28dce1494 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_reached.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_reached.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_waypoint_reached_pack(uint8_t system_id, uint char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_waypoint_reached_pack_chan(uint8_t system_id, char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request.h index e9d616ab1d..38167c0806 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_waypoint_request_pack(uint8_t system_id, uint _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_request_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_waypoint_request_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_request_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request_list.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request_list.h index caeb620375..ba21fbc82d 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_request_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_request_list.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_waypoint_request_list_pack(uint8_t system_id, _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_waypoint_request_list_pack_chan(uint8_t syste _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_waypoint_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; diff --git a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_set_current.h similarity index 96% rename from libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_set_current.h index 7a9fd614a4..f1ba68b456 100644 --- a/libraries/GCS_MAVLink/include/common/mavlink_msg_waypoint_set_current.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/mavlink_msg_waypoint_set_current.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_waypoint_set_current_pack(uint8_t system_id, _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_set_current_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_waypoint_set_current_pack_chan(uint8_t system _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint16_t(buf, 2, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_waypoint_set_current_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; diff --git a/libraries/GCS_MAVLink/include/common/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/testsuite.h similarity index 100% rename from libraries/GCS_MAVLink/include/common/testsuite.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/testsuite.h diff --git a/libraries/GCS_MAVLink/include/common/version.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/version.h similarity index 84% rename from libraries/GCS_MAVLink/include/common/version.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/common/version.h index 4eab9a8979..699dc654b3 100644 --- a/libraries/GCS_MAVLink/include/common/version.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/common/version.h @@ -5,7 +5,7 @@ #ifndef MAVLINK_VERSION_H #define MAVLINK_VERSION_H -#define MAVLINK_BUILD_DATE "Sun Apr 8 11:01:51 2012" +#define MAVLINK_BUILD_DATE "Thu Apr 19 15:40:00 2012" #define MAVLINK_WIRE_PROTOCOL_VERSION "0.9" #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 diff --git a/libraries/GCS_MAVLink/include/mavlink_helpers.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/mavlink_helpers.h similarity index 100% rename from libraries/GCS_MAVLink/include/mavlink_helpers.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/mavlink_helpers.h diff --git a/libraries/GCS_MAVLink/include/mavlink_types.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/mavlink_types.h similarity index 99% rename from libraries/GCS_MAVLink/include/mavlink_types.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/mavlink_types.h index c9c5fc47fb..630cb84b77 100644 --- a/libraries/GCS_MAVLink/include/mavlink_types.h +++ b/libraries/GCS_MAVLink/include/mavlink/v0.9/mavlink_types.h @@ -243,6 +243,7 @@ typedef struct __mavlink_message_info { } mavlink_message_info_t; #define _MAV_PAYLOAD(msg) ((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(msg)) diff --git a/libraries/GCS_MAVLink/include/protocol.h b/libraries/GCS_MAVLink/include/mavlink/v0.9/protocol.h similarity index 100% rename from libraries/GCS_MAVLink/include/protocol.h rename to libraries/GCS_MAVLink/include/mavlink/v0.9/protocol.h diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/ardupilotmega.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h similarity index 50% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/ardupilotmega.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h index 4325b57e21..a77a453855 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/ardupilotmega.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h @@ -12,15 +12,15 @@ extern "C" { // 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, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 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, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 36, 3, 9, 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, 0, 0, 36, 30, 18, 18, 51, 9, 3} +#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, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 54, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 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, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 36, 3, 9, 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, 0, 0, 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, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 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, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 42, 21, 21, 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, 0, 0, 204, 49, 170, 44, 83, 46, 247} +#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, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 200, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 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, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 42, 21, 21, 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, 0, 0, 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, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, {NULL}, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {NULL}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, MAVLINK_MESSAGE_INFO_AHRS, MAVLINK_MESSAGE_INFO_SIMSTATE, MAVLINK_MESSAGE_INFO_HWSTATUS, MAVLINK_MESSAGE_INFO_RADIO, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE} +#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_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT, MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, 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}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VFR_HUD, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, 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}}}, {"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_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, {"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_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, MAVLINK_MESSAGE_INFO_AHRS, MAVLINK_MESSAGE_INFO_SIMSTATE, MAVLINK_MESSAGE_INFO_HWSTATUS, MAVLINK_MESSAGE_INFO_RADIO, {"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}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, 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" @@ -69,10 +69,7 @@ enum MAV_CMD 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 |Empty| 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_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_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_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| */ @@ -101,7 +98,8 @@ enum MAV_CMD 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.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */ 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_ENUM_END=301, /* | */ + MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm| */ + MAV_CMD_ENUM_END=401, /* | */ }; #endif diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink.h similarity index 100% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink.h diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ahrs.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ahrs.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ahrs.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ahrs.h index 884f084ea7..a59f89aeeb 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ahrs.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ahrs.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t componen _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t componen packet.error_rp = error_rp; packet.error_yaw = error_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_AHRS; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com _mav_put_float(buf, 20, error_rp); _mav_put_float(buf, 24, error_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_ahrs_t packet; packet.omegaIx = omegaIx; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t com packet.error_rp = error_rp; packet.error_yaw = error_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_AHRS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ap_adc.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ap_adc.h index dbe7f19370..ea640c4fb0 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_ap_adc.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ap_adc.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c _mav_put_uint16_t(buf, 8, adc5); _mav_put_uint16_t(buf, 10, adc6); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_ap_adc_t packet; packet.adc1 = adc1; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c packet.adc5 = adc5; packet.adc6 = adc6; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_AP_ADC; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_configure.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_configure.h index 89df0d9a4e..cc49c50255 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_configure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_configure.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 13, engine_cut_off); _mav_put_uint8_t(buf, 14, extra_param); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_digicam_configure_t packet; packet.extra_value = extra_value; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin packet.engine_cut_off = engine_cut_off; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 13, engine_cut_off); _mav_put_uint8_t(buf, 14, extra_param); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_digicam_configure_t packet; packet.extra_value = extra_value; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id packet.engine_cut_off = engine_cut_off; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_control.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_control.h index baf63d6c7d..a3b4878c43 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_digicam_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_control.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 11, command_id); _mav_put_uint8_t(buf, 12, extra_param); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_digicam_control_t packet; packet.extra_value = extra_value; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8 packet.command_id = command_id; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 11, command_id); _mav_put_uint8_t(buf, 12, extra_param); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_digicam_control_t packet; packet.extra_value = extra_value; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, packet.command_id = command_id; packet.extra_param = extra_param; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h index e79ebeca39..c1e405b0a5 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_fence_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h index 8890a1e0b2..b31319c749 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_point.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 10, idx); _mav_put_uint8_t(buf, 11, count); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_fence_point_t packet; packet.lat = lat; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c packet.idx = idx; packet.count = count; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 10, idx); _mav_put_uint8_t(buf, 11, count); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_fence_point_t packet; packet.lat = lat; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint packet.idx = idx; packet.count = count; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_status.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_status.h index 56a6cf6c02..ce3e7ee67b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fence_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_status.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 6, breach_status); _mav_put_uint8_t(buf, 7, breach_type); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_fence_status_t packet; packet.breach_time = breach_time; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t packet.breach_status = breach_status; packet.breach_type = breach_type; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 6, breach_status); _mav_put_uint8_t(buf, 7, breach_type); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_fence_status_t packet; packet.breach_time = breach_time; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin packet.breach_status = breach_status; packet.breach_type = breach_type; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_hwstatus.h similarity index 95% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_hwstatus.h index a439560fb5..952e65951b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_hwstatus.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_hwstatus.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t comp _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t _mav_put_uint16_t(buf, 0, Vcc); _mav_put_uint8_t(buf, 2, I2Cerr); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_hwstatus_t packet; packet.Vcc = Vcc; packet.I2Cerr = I2Cerr; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_HWSTATUS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_meminfo.h similarity index 95% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_meminfo.h index 85b7d96fc8..a095a804f3 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_meminfo.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_meminfo.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t compo _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t _mav_put_uint16_t(buf, 0, brkval); _mav_put_uint16_t(buf, 2, freemem); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_meminfo_t packet; packet.brkval = brkval; packet.freemem = freemem; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MEMINFO; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_configure.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_configure.h index 84979b3e4d..051a718379 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_configure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_configure.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8 packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 4, stab_pitch); _mav_put_uint8_t(buf, 5, stab_yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mount_configure_t packet; packet.target_system = target_system; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, packet.stab_pitch = stab_pitch; packet.stab_yaw = stab_yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_control.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_control.h index 37f87fd7ac..a519922997 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_control.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 13, target_component); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_mount_control_t packet; packet.input_a = input_a; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t packet.target_component = target_component; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui _mav_put_uint8_t(buf, 13, target_component); _mav_put_uint8_t(buf, 14, save_position); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_mount_control_t packet; packet.input_a = input_a; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui packet.target_component = target_component; packet.save_position = save_position; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_status.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_status.h index f43709ba78..edc188ebd4 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_mount_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_status.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_mount_status_t packet; packet.pointing_a = pointing_a; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_mount_status_t packet; packet.pointing_a = pointing_a; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_radio.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_radio.h index db64da5c31..0f3d03c0a6 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_radio.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_radio.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone _mav_put_uint8_t(buf, 7, noise); _mav_put_uint8_t(buf, 8, remnoise); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_radio_t packet; packet.rxerrors = rxerrors; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t compone packet.noise = noise; packet.remnoise = remnoise; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co _mav_put_uint8_t(buf, 7, noise); _mav_put_uint8_t(buf, 8, remnoise); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_radio_t packet; packet.rxerrors = rxerrors; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t co packet.noise = noise; packet.remnoise = remnoise; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_RADIO; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h index b3b38e6df2..56fb52d96d 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h @@ -80,7 +80,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ _mav_put_int16_t(buf, 38, mag_ofs_y); _mav_put_int16_t(buf, 40, mag_ofs_z); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_sensor_offsets_t packet; packet.mag_declination = mag_declination; @@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_ packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u _mav_put_int16_t(buf, 38, mag_ofs_y); _mav_put_int16_t(buf, 40, mag_ofs_z); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_sensor_offsets_t packet; packet.mag_declination = mag_declination; @@ -158,7 +158,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u packet.mag_ofs_y = mag_ofs_y; packet.mag_ofs_z = mag_ofs_z; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h index 0151161901..4c13fd1863 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 6, target_system); _mav_put_uint8_t(buf, 7, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_set_mag_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8 packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 6, target_system); _mav_put_uint8_t(buf, 7, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_set_mag_offsets_t packet; packet.mag_ofs_x = mag_ofs_x; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_simstate.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_simstate.h index aa7e6edfaf..dfcddfc2b6 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_simstate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_simstate.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 28, ygyro); _mav_put_float(buf, 32, zgyro); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_simstate_t packet; packet.roll = roll; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t comp packet.ygyro = ygyro; packet.zgyro = zgyro; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 28, ygyro); _mav_put_float(buf, 32, zgyro); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_simstate_t packet; packet.roll = roll; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t packet.ygyro = ygyro; packet.zgyro = zgyro; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_SIMSTATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/testsuite.h similarity index 94% rename from libraries/GCS_MAVLink/include_v1.0/ardupilotmega/testsuite.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/testsuite.h index acd50ec021..aa83889d66 100644 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/testsuite.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/testsuite.h @@ -534,14 +534,14 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma }; mavlink_fence_point_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.lat = packet_in.lat; - packet1.lng = packet_in.lng; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.idx = packet_in.idx; - packet1.count = packet_in.count; - - + packet1.lat = packet_in.lat; + packet1.lng = packet_in.lng; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.idx = packet_in.idx; + packet1.count = packet_in.count; + + memset(&packet2, 0, sizeof(packet2)); mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1); @@ -561,11 +561,11 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; i 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| 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| 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 |Empty| 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_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_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| Empty| Empty| 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)| Empty| 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_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_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| Empty| Empty| 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| 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_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| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| 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.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */ + 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_ENUM_END=401, /* | */ +}; +#endif + +/** @brief Data stream IDs. 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 +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, /* | */ +}; +#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 +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, /* | */ +}; +#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 +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, /* | */ +}; +#endif + +/** @brief type of a mavlink parameter */ +#ifndef HAVE_ENUM_MAV_VAR +#define HAVE_ENUM_MAV_VAR +enum MAV_VAR +{ + MAV_VAR_FLOAT=0, /* 32 bit float | */ + MAV_VAR_UINT8=1, /* 8 bit unsigned integer | */ + MAV_VAR_INT8=2, /* 8 bit signed integer | */ + MAV_VAR_UINT16=3, /* 16 bit unsigned integer | */ + MAV_VAR_INT16=4, /* 16 bit signed integer | */ + MAV_VAR_UINT32=5, /* 32 bit unsigned integer | */ + MAV_VAR_INT32=6, /* 32 bit signed integer | */ + MAV_VAR_ENUM_END=7, /* | */ +}; +#endif + +/** @brief result from a mavlink command */ +#ifndef HAVE_ENUM_MAV_RESULT +#define HAVE_ENUM_MAV_RESULT +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, /* | */ +}; +#endif + +/** @brief result in a mavlink mission ack */ +#ifndef HAVE_ENUM_MAV_MISSION_RESULT +#define HAVE_ENUM_MAV_MISSION_RESULT +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, /* | */ +}; +#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 +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, /* | */ +}; +#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_set_local_position_setpoint.h" +#include "./mavlink_msg_local_position_setpoint.h" +#include "./mavlink_msg_global_position_setpoint_int.h" +#include "./mavlink_msg_set_global_position_setpoint_int.h" +#include "./mavlink_msg_safety_set_allowed_area.h" +#include "./mavlink_msg_safety_allowed_area.h" +#include "./mavlink_msg_set_roll_pitch_yaw_thrust.h" +#include "./mavlink_msg_set_roll_pitch_yaw_speed_thrust.h" +#include "./mavlink_msg_roll_pitch_yaw_thrust_setpoint.h" +#include "./mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h" +#include "./mavlink_msg_set_quad_motors_setpoint.h" +#include "./mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h" +#include "./mavlink_msg_nav_controller_output.h" +#include "./mavlink_msg_state_correction.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_vfr_hud.h" +#include "./mavlink_msg_command_long.h" +#include "./mavlink_msg_command_ack.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_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" + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // COMMON_H diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink.h similarity index 100% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink.h diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude.h index 16045b9747..9074a1d80f 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp _mav_put_float(buf, 20, pitchspeed); _mav_put_float(buf, 24, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_attitude_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t _mav_put_float(buf, 20, pitchspeed); _mav_put_float(buf, 24, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_attitude_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude_quaternion.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude_quaternion.h index 215aff6d03..5560488655 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_attitude_quaternion.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_attitude_quaternion.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_attitude_quaternion_t packet; packet.time_boot_ms = time_boot_ms; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ _mav_put_float(buf, 24, pitchspeed); _mav_put_float(buf, 28, yawspeed); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_attitude_quaternion_t packet; packet.time_boot_ms = time_boot_ms; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ packet.pitchspeed = pitchspeed; packet.yawspeed = yawspeed; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_auth_key.h similarity index 94% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_auth_key.h index cc77e4e549..baa119fde1 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_auth_key.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_auth_key.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp char buf[32]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t char buf[32]; _mav_put_char_array(buf, 0, key, 32); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_auth_key_t packet; mav_array_memcpy(packet.key, key, sizeof(char)*32); - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control.h index d18194e2da..a558510084 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i _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(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #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(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys _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(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #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(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control_ack.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control_ack.h index 25e6a6d831..1d89a0f787 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_change_operator_control_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_change_operator_control_ack.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #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(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t _mav_put_uint8_t(buf, 1, control_request); _mav_put_uint8_t(buf, 2, ack); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #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(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_ack.h similarity index 95% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_ack.h index 2109e32072..df6e9b9e3b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_ack.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c _mav_put_uint16_t(buf, 0, command); _mav_put_uint8_t(buf, 2, result); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint _mav_put_uint16_t(buf, 0, command); _mav_put_uint8_t(buf, 2, result); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_command_ack_t packet; packet.command = command; packet.result = result; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_long.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_long.h index 7a8bac533f..54ca77eaa2 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command_long.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_long.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 31, target_component); _mav_put_uint8_t(buf, 32, confirmation); - memcpy(_MAV_PAYLOAD(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); #else mavlink_command_long_t packet; packet.param1 = param1; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t packet.target_component = target_component; packet.confirmation = confirmation; - memcpy(_MAV_PAYLOAD(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 31, target_component); _mav_put_uint8_t(buf, 32, confirmation); - memcpy(_MAV_PAYLOAD(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); #else mavlink_command_long_t packet; packet.param1 = param1; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin packet.target_component = target_component; packet.confirmation = confirmation; - memcpy(_MAV_PAYLOAD(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); #endif msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_data_stream.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_data_stream.h index 1c8df4b413..e5ec290452 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_data_stream.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_data_stream.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 2, stream_id); _mav_put_uint8_t(buf, 3, on_off); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_data_stream_t packet; packet.message_rate = message_rate; packet.stream_id = stream_id; packet.on_off = on_off; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 2, stream_id); _mav_put_uint8_t(buf, 3, on_off); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_data_stream_t packet; packet.message_rate = message_rate; packet.stream_id = stream_id; packet.on_off = on_off; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug.h index 1687a16cd2..5ff88e6a8a 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone _mav_put_float(buf, 4, value); _mav_put_uint8_t(buf, 8, ind); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_debug_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; packet.ind = ind; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co _mav_put_float(buf, 4, value); _mav_put_uint8_t(buf, 8, ind); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_debug_t packet; packet.time_boot_ms = time_boot_ms; packet.value = value; packet.ind = ind; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug_vect.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug_vect.h index 8f3b909728..0b443a0611 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_debug_vect.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug_vect.h @@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); _mav_put_char_array(buf, 20, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_debug_vect_t packet; packet.time_usec = time_usec; @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; @@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); _mav_put_char_array(buf, 20, name, 10); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_debug_vect_t packet; packet.time_usec = time_usec; @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 packet.y = y; packet.z = z; mav_array_memcpy(packet.name, name, sizeof(char)*10); - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_int.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_int.h index c5be7fec62..780f562c5b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_int.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u _mav_put_int16_t(buf, 24, vz); _mav_put_uint16_t(buf, 26, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_global_position_int_t packet; packet.time_boot_ms = time_boot_ms; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u packet.vz = vz; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ _mav_put_int16_t(buf, 24, vz); _mav_put_uint16_t(buf, 26, hdg); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_global_position_int_t packet; packet.time_boot_ms = time_boot_ms; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ packet.vz = vz; packet.hdg = hdg; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_setpoint_int.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_setpoint_int.h index e38df91dcf..853b85daeb 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position_setpoint_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_position_setpoint_int.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_ _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_ packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_vision_position_estimate.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_vision_position_estimate.h index 06c6357b1f..e4617702bd 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_vision_position_estimate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_global_vision_position_estimate.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_global_vision_position_estimate_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_global_vision_position_estimate_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_global_origin.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_global_origin.h index 3df5a58f95..2084718b5d 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_global_origin.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_global_origin.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_gps_global_origin_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id _mav_put_int32_t(buf, 4, longitude); _mav_put_int32_t(buf, 8, altitude); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_gps_global_origin_t packet; packet.latitude = latitude; packet.longitude = longitude; packet.altitude = altitude; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_raw_int.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_raw_int.h index 866ada26e4..57ec973763 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_raw_int.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 28, fix_type); _mav_put_uint8_t(buf, 29, satellites_visible); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_gps_raw_int_t packet; packet.time_usec = time_usec; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c packet.fix_type = fix_type; packet.satellites_visible = satellites_visible; - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 28, fix_type); _mav_put_uint8_t(buf, 29, satellites_visible); - memcpy(_MAV_PAYLOAD(msg), buf, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30); #else mavlink_gps_raw_int_t packet; packet.time_usec = time_usec; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint packet.fix_type = fix_type; packet.satellites_visible = satellites_visible; - memcpy(_MAV_PAYLOAD(msg), &packet, 30); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30); #endif msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_status.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_status.h index 5ae1f3ab1c..bd3257f889 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_status.h @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co _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(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co 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(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; @@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 _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(msg), buf, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101); #else mavlink_gps_status_t packet; packet.satellites_visible = satellites_visible; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 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(msg), &packet, 101); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101); #endif msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_heartbeat.h similarity index 84% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_heartbeat.h index d194f21277..599ea0bc5e 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_heartbeat.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_heartbeat.h @@ -4,12 +4,12 @@ typedef struct __mavlink_heartbeat_t { - uint32_t custom_mode; ///< Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. + 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_CLASS ENUM + uint8_t autopilot; ///< Autopilot type / class. defined in MAV_AUTOPILOT ENUM uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - uint8_t system_status; ///< System status flag, see MAV_STATUS ENUM - uint8_t mavlink_version; ///< MAVLink version + 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 @@ -37,10 +37,10 @@ typedef struct __mavlink_heartbeat_t * @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_CLASS ENUM + * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM * @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - * @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. - * @param system_status System status flag, see MAV_STATUS ENUM + * @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, @@ -55,7 +55,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 7, system_status); _mav_put_uint8_t(buf, 8, 3); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_heartbeat_t packet; packet.custom_mode = custom_mode; @@ -65,7 +65,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com packet.system_status = system_status; packet.mavlink_version = 3; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; @@ -79,10 +79,10 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com * @param chan The MAVLink channel this message was 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_CLASS ENUM + * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM * @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - * @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. - * @param system_status System status flag, see MAV_STATUS ENUM + * @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, @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 7, system_status); _mav_put_uint8_t(buf, 8, 3); - memcpy(_MAV_PAYLOAD(msg), buf, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); #else mavlink_heartbeat_t packet; packet.custom_mode = custom_mode; @@ -108,7 +108,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ packet.system_status = system_status; packet.mavlink_version = 3; - memcpy(_MAV_PAYLOAD(msg), &packet, 9); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); #endif msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; @@ -133,10 +133,10 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c * @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_CLASS ENUM + * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM * @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - * @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. - * @param system_status System status flag, see MAV_STATUS ENUM + * @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 @@ -183,7 +183,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* ms /** * @brief Get field autopilot from heartbeat message * - * @return Autopilot type / class. defined in MAV_CLASS ENUM + * @return Autopilot type / class. defined in MAV_AUTOPILOT ENUM */ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg) { @@ -203,7 +203,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_ /** * @brief Get field custom_mode from heartbeat message * - * @return Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. + * @return A bitfield for use for autopilot-specific flags. */ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg) { @@ -213,7 +213,7 @@ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_messa /** * @brief Get field system_status from heartbeat message * - * @return System status flag, see MAV_STATUS ENUM + * @return System status flag, see MAV_STATE ENUM */ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg) { @@ -223,7 +223,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_mess /** * @brief Get field mavlink_version from heartbeat message * - * @return MAVLink version + * @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) { diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_controls.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_controls.h index 23c84bc562..41a9bc9498 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_controls.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_controls.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 40, mode); _mav_put_uint8_t(buf, 41, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_hil_controls_t packet; packet.time_usec = time_usec; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 40, mode); _mav_put_uint8_t(buf, 41, nav_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42); #else mavlink_hil_controls_t packet; packet.time_usec = time_usec; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin packet.mode = mode; packet.nav_mode = nav_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 42); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42); #endif msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_rc_inputs_raw.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_rc_inputs_raw.h index d02c415397..7ac0853d31 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_rc_inputs_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_rc_inputs_raw.h @@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin _mav_put_uint16_t(buf, 30, chan12_raw); _mav_put_uint8_t(buf, 32, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); #else mavlink_hil_rc_inputs_raw_t packet; packet.time_usec = time_usec; @@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin packet.chan12_raw = chan12_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); #endif msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; @@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id _mav_put_uint16_t(buf, 30, chan12_raw); _mav_put_uint8_t(buf, 32, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33); #else mavlink_hil_rc_inputs_raw_t packet; packet.time_usec = time_usec; @@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id packet.chan12_raw = chan12_raw; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 33); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33); #endif msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_state.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_state.h index f61c5170fd..1447812956 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_hil_state.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_hil_state.h @@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); #else mavlink_hil_state_t packet; packet.time_usec = time_usec; @@ -116,7 +116,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; @@ -170,7 +170,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ _mav_put_int16_t(buf, 52, yacc); _mav_put_int16_t(buf, 54, zacc); - memcpy(_MAV_PAYLOAD(msg), buf, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56); #else mavlink_hil_state_t packet; packet.time_usec = time_usec; @@ -190,7 +190,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ packet.yacc = yacc; packet.zacc = zacc; - memcpy(_MAV_PAYLOAD(msg), &packet, 56); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56); #endif msg->msgid = MAVLINK_MSG_ID_HIL_STATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned.h index d59ae0b1a8..fe0a791fc5 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_ned.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui _mav_put_float(buf, 20, vy); _mav_put_float(buf, 24, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_local_position_ned_t packet; packet.time_boot_ms = time_boot_ms; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i _mav_put_float(buf, 20, vy); _mav_put_float(buf, 24, vz); - memcpy(_MAV_PAYLOAD(msg), buf, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); #else mavlink_local_position_ned_t packet; packet.time_boot_ms = time_boot_ms; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i packet.vy = vy; packet.vz = vz; - memcpy(_MAV_PAYLOAD(msg), &packet, 28); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h new file mode 100644 index 0000000000..ac1941db09 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_ned_system_global_offset.h @@ -0,0 +1,276 @@ +// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING + +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89 + +typedef struct __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_89_LEN 28 + + + +#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) }, \ + } \ +} + + +/** + * @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[28]; + _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, 28); +#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, 28); +#endif + + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; + return mavlink_finalize_message(msg, system_id, component_id, 28, 231); +} + +/** + * @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 was 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[28]; + _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, 28); +#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, 28); +#endif + + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 231); +} + +/** + * @brief Encode a local_position_ned_system_global_offset struct into a 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 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 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[28]; + _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, 28, 231); +#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, 28, 231); +#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 + 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 + memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), 28); +#endif +} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_setpoint.h index 7a83b16c6f..9ab87d0daf 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_local_position_setpoint.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i _mav_put_float(buf, 12, yaw); _mav_put_uint8_t(buf, 16, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys _mav_put_float(buf, 12, yaw); _mav_put_uint8_t(buf, 16, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17); #else mavlink_local_position_setpoint_t packet; packet.x = x; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 17); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17); #endif msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_manual_control.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_manual_control.h index febb4535e2..93adce265b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_manual_control.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_manual_control.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ _mav_put_uint8_t(buf, 19, yaw_manual); _mav_put_uint8_t(buf, 20, thrust_manual); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_manual_control_t packet; packet.roll = roll; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ packet.yaw_manual = yaw_manual; packet.thrust_manual = thrust_manual; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u _mav_put_uint8_t(buf, 19, yaw_manual); _mav_put_uint8_t(buf, 20, thrust_manual); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_manual_control_t packet; packet.roll = roll; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u packet.yaw_manual = yaw_manual; packet.thrust_manual = thrust_manual; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_memory_vect.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_memory_vect.h index e59db361a7..a61c13019b 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_memory_vect.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_memory_vect.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c _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(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #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(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint _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(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #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(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_ack.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_ack.h index 1696e76586..92eca79d1c 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_ack.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_ack.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_mission_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, type); - memcpy(_MAV_PAYLOAD(msg), buf, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); #else mavlink_mission_ack_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.type = type; - memcpy(_MAV_PAYLOAD(msg), &packet, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_clear_all.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_clear_all.h index c421f57893..602852f7e3 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_clear_all.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_clear_all.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_clear_all_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_count.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_count.h index 967071d8c8..61d8b221c3 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_count.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_count.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_count_t packet; packet.count = count; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, ui _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_count_t packet; packet.count = count; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_current.h similarity index 94% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_current.h index 2ad9fbc601..99370f8353 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_current.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_current.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8 char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_current_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item.h index e2d894aeea..d2c66d4daa 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item.h @@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 35, current); _mav_put_uint8_t(buf, 36, autocontinue); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_mission_item_t packet; packet.param1 = param1; @@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t packet.current = current; packet.autocontinue = autocontinue; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; @@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin _mav_put_uint8_t(buf, 35, current); _mav_put_uint8_t(buf, 36, autocontinue); - memcpy(_MAV_PAYLOAD(msg), buf, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37); #else mavlink_mission_item_t packet; packet.param1 = param1; @@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin packet.current = current; packet.autocontinue = autocontinue; - memcpy(_MAV_PAYLOAD(msg), &packet, 37); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item_reached.h similarity index 95% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item_reached.h index 7d935cade2..171f9857e8 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_item_reached.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item_reached.h @@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_item_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; @@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system char buf[2]; _mav_put_uint16_t(buf, 0, seq); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_item_reached_t packet; packet.seq = seq; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request.h index 5fb55ddb67..cde0a0cfb9 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_request_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_request_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_list.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_list.h index c41d0fa0b0..1ada635b55 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_list.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_mission_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_partial_list.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_partial_list.h index 92e0ea745c..76fd43befa 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_request_partial_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_partial_list.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mission_request_partial_list_t packet; packet.start_index = start_index; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_ _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mission_request_partial_list_t packet; packet.start_index = start_index; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_ packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_set_current.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_set_current.h index 6fb6fd1cce..de0dbcd75d 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_set_current.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_set_current.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_set_current_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_ _mav_put_uint8_t(buf, 2, target_system); _mav_put_uint8_t(buf, 3, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); #else mavlink_mission_set_current_t packet; packet.seq = seq; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_write_partial_list.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_write_partial_list.h index 59f438de23..0e77569cfc 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_mission_write_partial_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_write_partial_list.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mission_write_partial_list_t packet; packet.start_index = start_index; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_mission_write_partial_list_t packet; packet.start_index = start_index; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_float.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_float.h index feabb8f31e..23a819e2c9 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_float.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_float.h @@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; @@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_int.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_int.h index 463b44d67e..3c67dff03f 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_named_value_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_int.h @@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8 _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; @@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_nav_controller_output.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_nav_controller_output.h index a8310c142b..028afdabc6 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_nav_controller_output.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_nav_controller_output.h @@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, _mav_put_int16_t(buf, 22, target_bearing); _mav_put_uint16_t(buf, 24, wp_dist); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, packet.target_bearing = target_bearing; packet.wp_dist = wp_dist; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; @@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste _mav_put_int16_t(buf, 22, target_bearing); _mav_put_uint16_t(buf, 24, wp_dist); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_nav_controller_output_t packet; packet.nav_roll = nav_roll; @@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste packet.target_bearing = target_bearing; packet.wp_dist = wp_dist; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_optical_flow.h similarity index 58% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_optical_flow.h index cebc1d9023..b277cab512 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_optical_flow.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_optical_flow.h @@ -5,27 +5,31 @@ typedef struct __mavlink_optical_flow_t { uint64_t time_usec; ///< Timestamp (UNIX) - float ground_distance; ///< Ground distance in meters + 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 in x-sensor direction int16_t flow_y; ///< Flow in pixels in y-sensor direction 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 18 -#define MAVLINK_MSG_ID_100_LEN 18 +#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26 +#define MAVLINK_MSG_ID_100_LEN 26 #define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \ "OPTICAL_FLOW", \ - 6, \ + 8, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ - { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, ground_distance) }, \ - { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_optical_flow_t, flow_x) }, \ - { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_optical_flow_t, flow_y) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_optical_flow_t, sensor_id) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_optical_flow_t, quality) }, \ + { "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) }, \ } \ } @@ -40,37 +44,43 @@ typedef struct __mavlink_optical_flow_t * @param sensor_id Sensor ID * @param flow_x Flow in pixels in x-sensor direction * @param flow_y Flow in pixels in y-sensor direction + * @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 + * @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, uint8_t quality, float ground_distance) + 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[18]; + char buf[26]; _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, ground_distance); - _mav_put_int16_t(buf, 12, flow_x); - _mav_put_int16_t(buf, 14, flow_y); - _mav_put_uint8_t(buf, 16, sensor_id); - _mav_put_uint8_t(buf, 17, quality); + _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message(msg, system_id, component_id, 18, 19); + return mavlink_finalize_message(msg, system_id, component_id, 26, 175); } /** @@ -83,38 +93,44 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t * @param sensor_id Sensor ID * @param flow_x Flow in pixels in x-sensor direction * @param flow_y Flow in pixels in y-sensor direction + * @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 + * @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,uint8_t quality,float ground_distance) + 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[18]; + char buf[26]; _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, ground_distance); - _mav_put_int16_t(buf, 12, flow_x); - _mav_put_int16_t(buf, 14, flow_y); - _mav_put_uint8_t(buf, 16, sensor_id); - _mav_put_uint8_t(buf, 17, quality); + _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(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #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(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 19); + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 175); } /** @@ -127,7 +143,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin */ 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->quality, optical_flow->ground_distance); + 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); } /** @@ -138,33 +154,39 @@ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_ * @param sensor_id Sensor ID * @param flow_x Flow in pixels in x-sensor direction * @param flow_y Flow in pixels in y-sensor direction + * @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 + * @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, uint8_t quality, float ground_distance) +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[18]; + char buf[26]; _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, ground_distance); - _mav_put_int16_t(buf, 12, flow_x); - _mav_put_int16_t(buf, 14, flow_y); - _mav_put_uint8_t(buf, 16, sensor_id); - _mav_put_uint8_t(buf, 17, quality); + _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, 18, 19); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 26, 175); #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, 18, 19); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 26, 175); #endif } @@ -190,7 +212,7 @@ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_mess */ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 16); + return _MAV_RETURN_uint8_t(msg, 24); } /** @@ -200,7 +222,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_messa */ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -210,7 +232,27 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_ */ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + 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); } /** @@ -220,17 +262,17 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_ */ static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 17); + return _MAV_RETURN_uint8_t(msg, 25); } /** * @brief Get field ground_distance from optical_flow message * - * @return Ground distance in meters + * @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, 8); + return _MAV_RETURN_float(msg, 16); } /** @@ -243,12 +285,14 @@ static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, { #if MAVLINK_NEED_BYTE_SWAP 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 - memcpy(optical_flow, _MAV_PAYLOAD(msg), 18); + memcpy(optical_flow, _MAV_PAYLOAD(msg), 26); #endif } diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_list.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_list.h index 7ebd92284f..125df80c85 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_list.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_list.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); #else mavlink_param_request_list_t packet; packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_read.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_read.h index 92fac8037c..61d00f62d1 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_request_read.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_read.h @@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui _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(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #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(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; @@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i _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(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #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(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_set.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_set.h index d65412d176..a7e895f18d 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_set.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_set.h @@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com _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(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); #else mavlink_param_set_t packet; packet.param_value = param_value; @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com packet.target_component = target_component; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; @@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ _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(msg), buf, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23); #else mavlink_param_set_t packet; packet.param_value = param_value; @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ packet.target_component = target_component; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD(msg), &packet, 23); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_SET; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_value.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_value.h index c972ebaa38..4e16a56318 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_param_value.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_value.h @@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c _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(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; @@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint _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(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_ping.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_ping.h index 8c4bf0cc8c..3ed1b9d7c4 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_ping.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_ping.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_ping_t packet; packet.time_usec = time_usec; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_PING; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com _mav_put_uint8_t(buf, 12, target_system); _mav_put_uint8_t(buf, 13, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_ping_t packet; packet.time_usec = time_usec; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_PING; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_imu.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_imu.h index a8c3988893..1c1d483886 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_imu.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_imu.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_raw_imu_t packet; packet.time_usec = time_usec; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 22, ymag); _mav_put_int16_t(buf, 24, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26); #else mavlink_raw_imu_t packet; packet.time_usec = time_usec; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 26); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26); #endif msg->msgid = MAVLINK_MSG_ID_RAW_IMU; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_pressure.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_pressure.h index 29e631f39c..f3e4e84046 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_raw_pressure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_raw_pressure.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_raw_pressure_t packet; packet.time_usec = time_usec; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin _mav_put_int16_t(buf, 12, press_diff2); _mav_put_int16_t(buf, 14, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16); #else mavlink_raw_pressure_t packet; packet.time_usec = time_usec; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin packet.press_diff2 = press_diff2; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16); #endif msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_override.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_override.h index 6eccf7ae8d..d719c7fca2 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_override.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_override.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_rc_channels_override_t packet; packet.chan1_raw = chan1_raw; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_rc_channels_override_t packet; packet.chan1_raw = chan1_raw; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_raw.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_raw.h index 1c25d1a3b3..a5b28021d5 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_raw.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_rc_channels_raw_t packet; packet.time_boot_ms = time_boot_ms; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_rc_channels_raw_t packet; packet.time_boot_ms = time_boot_ms; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_scaled.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_scaled.h index a7a4e5b97f..23c14c03d7 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_rc_channels_scaled.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_rc_channels_scaled.h @@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_rc_channels_scaled_t packet; packet.time_boot_ms = time_boot_ms; @@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; @@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i _mav_put_uint8_t(buf, 20, port); _mav_put_uint8_t(buf, 21, rssi); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_rc_channels_scaled_t packet; packet.time_boot_ms = time_boot_ms; @@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i packet.port = port; packet.rssi = rssi; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_request_data_stream.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_request_data_stream.h index 9889bfc085..d8653ad109 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_request_data_stream.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_request_data_stream.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u _mav_put_uint8_t(buf, 4, req_stream_id); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_request_data_stream_t packet; packet.req_message_rate = req_message_rate; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u packet.req_stream_id = req_stream_id; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ _mav_put_uint8_t(buf, 4, req_stream_id); _mav_put_uint8_t(buf, 5, start_stop); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_request_data_stream_t packet; packet.req_message_rate = req_message_rate; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ packet.req_stream_id = req_stream_id; packet.start_stop = start_stop; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h index 80a88cca2f..5751badc3e 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin _mav_put_float(buf, 12, yaw_speed); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha _mav_put_float(buf, 12, yaw_speed); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha packet.yaw_speed = yaw_speed; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h index b8b87028d5..a9f6ad0caa 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_roll_pitch_yaw_thrust_setpoint.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s _mav_put_float(buf, 12, yaw); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint _mav_put_float(buf, 12, yaw); _mav_put_float(buf, 16, thrust); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_roll_pitch_yaw_thrust_setpoint_t packet; packet.time_boot_ms = time_boot_ms; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint packet.yaw = yaw; packet.thrust = thrust; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_allowed_area.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_allowed_area.h index fee7734d01..aae6fd206a 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_allowed_area.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_allowed_area.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u _mav_put_float(buf, 20, p2z); _mav_put_uint8_t(buf, 24, frame); - memcpy(_MAV_PAYLOAD(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_safety_allowed_area_t packet; packet.p1x = p1x; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u packet.p2z = p2z; packet.frame = frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ _mav_put_float(buf, 20, p2z); _mav_put_uint8_t(buf, 24, frame); - memcpy(_MAV_PAYLOAD(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); #else mavlink_safety_allowed_area_t packet; packet.p1x = p1x; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ packet.p2z = p2z; packet.frame = frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_set_allowed_area.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_set_allowed_area.h index 35d9b3b254..8fb410c2d6 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_safety_set_allowed_area.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_safety_set_allowed_area.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i _mav_put_uint8_t(buf, 25, target_component); _mav_put_uint8_t(buf, 26, frame); - memcpy(_MAV_PAYLOAD(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); #else mavlink_safety_set_allowed_area_t packet; packet.p1x = p1x; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i packet.target_component = target_component; packet.frame = frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys _mav_put_uint8_t(buf, 25, target_component); _mav_put_uint8_t(buf, 26, frame); - memcpy(_MAV_PAYLOAD(msg), buf, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27); #else mavlink_safety_set_allowed_area_t packet; packet.p1x = p1x; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys packet.target_component = target_component; packet.frame = frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 27); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27); #endif msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_imu.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_imu.h index 145d959ade..8ff098f39f 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_imu.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_imu.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co _mav_put_int16_t(buf, 18, ymag); _mav_put_int16_t(buf, 20, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_scaled_imu_t packet; packet.time_boot_ms = time_boot_ms; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 _mav_put_int16_t(buf, 18, ymag); _mav_put_int16_t(buf, 20, zmag); - memcpy(_MAV_PAYLOAD(msg), buf, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22); #else mavlink_scaled_imu_t packet; packet.time_boot_ms = time_boot_ms; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 packet.ymag = ymag; packet.zmag = zmag; - memcpy(_MAV_PAYLOAD(msg), &packet, 22); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_pressure.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_pressure.h index 428a7af223..dac1e0b9a6 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_scaled_pressure.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_scaled_pressure.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 _mav_put_float(buf, 8, press_diff); _mav_put_int16_t(buf, 12, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_scaled_pressure_t packet; packet.time_boot_ms = time_boot_ms; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, _mav_put_float(buf, 8, press_diff); _mav_put_int16_t(buf, 12, temperature); - memcpy(_MAV_PAYLOAD(msg), buf, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); #else mavlink_scaled_pressure_t packet; packet.time_boot_ms = time_boot_ms; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, packet.press_diff = press_diff; packet.temperature = temperature; - memcpy(_MAV_PAYLOAD(msg), &packet, 14); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); #endif msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_servo_output_raw.h similarity index 98% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_servo_output_raw.h index dce71fd6e8..34a58cd763 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_servo_output_raw.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_servo_output_raw.h @@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint _mav_put_uint16_t(buf, 18, servo8_raw); _mav_put_uint8_t(buf, 20, port); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_servo_output_raw_t packet; packet.time_usec = time_usec; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint packet.servo8_raw = servo8_raw; packet.port = port; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; @@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, _mav_put_uint16_t(buf, 18, servo8_raw); _mav_put_uint8_t(buf, 20, port); - memcpy(_MAV_PAYLOAD(msg), buf, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21); #else mavlink_servo_output_raw_t packet; packet.time_usec = time_usec; @@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, packet.servo8_raw = servo8_raw; packet.port = port; - memcpy(_MAV_PAYLOAD(msg), &packet, 21); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21); #endif msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_global_position_setpoint_int.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_global_position_setpoint_int.h index ea34731c9e..5b706fb506 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_global_position_setpoint_int.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_global_position_setpoint_int.h @@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_set_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; @@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui _mav_put_int16_t(buf, 12, yaw); _mav_put_uint8_t(buf, 14, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); #else mavlink_set_global_position_setpoint_int_t packet; packet.latitude = latitude; @@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui packet.yaw = yaw; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 15); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); #endif msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_gps_global_origin.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_gps_global_origin.h index ee6f18af56..af404b1108 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_gps_global_origin.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_gps_global_origin.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, _mav_put_int32_t(buf, 8, altitude); _mav_put_uint8_t(buf, 12, target_system); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_set_gps_global_origin_t packet; packet.latitude = latitude; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, packet.altitude = altitude; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste _mav_put_int32_t(buf, 8, altitude); _mav_put_uint8_t(buf, 12, target_system); - memcpy(_MAV_PAYLOAD(msg), buf, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); #else mavlink_set_gps_global_origin_t packet; packet.latitude = latitude; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste packet.altitude = altitude; packet.target_system = target_system; - memcpy(_MAV_PAYLOAD(msg), &packet, 13); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); #endif msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_local_position_setpoint.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_local_position_setpoint.h index 4024c9ef13..233e07d65c 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_local_position_setpoint.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_local_position_setpoint.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst _mav_put_uint8_t(buf, 17, target_component); _mav_put_uint8_t(buf, 18, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); #else mavlink_set_local_position_setpoint_t packet; packet.x = x; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst packet.target_component = target_component; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); #endif msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t _mav_put_uint8_t(buf, 17, target_component); _mav_put_uint8_t(buf, 18, coordinate_frame); - memcpy(_MAV_PAYLOAD(msg), buf, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19); #else mavlink_set_local_position_setpoint_t packet; packet.x = x; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t packet.target_component = target_component; packet.coordinate_frame = coordinate_frame; - memcpy(_MAV_PAYLOAD(msg), &packet, 19); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19); #endif msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_mode.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_mode.h index b622de0ea9..fec21ab137 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_mode.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_mode.h @@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, base_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_set_mode_t packet; packet.custom_mode = custom_mode; packet.target_system = target_system; packet.base_mode = base_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; @@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t _mav_put_uint8_t(buf, 4, target_system); _mav_put_uint8_t(buf, 5, base_mode); - memcpy(_MAV_PAYLOAD(msg), buf, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); #else mavlink_set_mode_t packet; packet.custom_mode = custom_mode; packet.target_system = target_system; packet.base_mode = base_mode; - memcpy(_MAV_PAYLOAD(msg), &packet, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); #endif msg->msgid = MAVLINK_MSG_ID_SET_MODE; diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_motors_setpoint.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_motors_setpoint.h new file mode 100644 index 0000000000..40ff8998ec --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_motors_setpoint.h @@ -0,0 +1,232 @@ +// MESSAGE SET_QUAD_MOTORS_SETPOINT PACKING + +#define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT 60 + +typedef struct __mavlink_set_quad_motors_setpoint_t +{ + uint16_t motor_front_nw; ///< Front motor in + configuration, front left motor in x configuration + uint16_t motor_right_ne; ///< Right motor in + configuration, front right motor in x configuration + uint16_t motor_back_se; ///< Back motor in + configuration, back right motor in x configuration + uint16_t motor_left_sw; ///< Left motor in + configuration, back left motor in x configuration + uint8_t target_system; ///< System ID of the system that should set these motor commands +} mavlink_set_quad_motors_setpoint_t; + +#define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN 9 +#define MAVLINK_MSG_ID_60_LEN 9 + + + +#define MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT { \ + "SET_QUAD_MOTORS_SETPOINT", \ + 5, \ + { { "motor_front_nw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_set_quad_motors_setpoint_t, motor_front_nw) }, \ + { "motor_right_ne", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_set_quad_motors_setpoint_t, motor_right_ne) }, \ + { "motor_back_se", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_set_quad_motors_setpoint_t, motor_back_se) }, \ + { "motor_left_sw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_set_quad_motors_setpoint_t, motor_left_sw) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_set_quad_motors_setpoint_t, target_system) }, \ + } \ +} + + +/** + * @brief Pack a set_quad_motors_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 target_system System ID of the system that should set these motor commands + * @param motor_front_nw Front motor in + configuration, front left motor in x configuration + * @param motor_right_ne Right motor in + configuration, front right motor in x configuration + * @param motor_back_se Back motor in + configuration, back right motor in x configuration + * @param motor_left_sw Left motor in + configuration, back left motor in x configuration + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[9]; + _mav_put_uint16_t(buf, 0, motor_front_nw); + _mav_put_uint16_t(buf, 2, motor_right_ne); + _mav_put_uint16_t(buf, 4, motor_back_se); + _mav_put_uint16_t(buf, 6, motor_left_sw); + _mav_put_uint8_t(buf, 8, target_system); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); +#else + mavlink_set_quad_motors_setpoint_t packet; + packet.motor_front_nw = motor_front_nw; + packet.motor_right_ne = motor_right_ne; + packet.motor_back_se = motor_back_se; + packet.motor_left_sw = motor_left_sw; + packet.target_system = target_system; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; + return mavlink_finalize_message(msg, system_id, component_id, 9, 30); +} + +/** + * @brief Pack a set_quad_motors_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 was sent over + * @param msg The MAVLink message to compress the data into + * @param target_system System ID of the system that should set these motor commands + * @param motor_front_nw Front motor in + configuration, front left motor in x configuration + * @param motor_right_ne Right motor in + configuration, front right motor in x configuration + * @param motor_back_se Back motor in + configuration, back right motor in x configuration + * @param motor_left_sw Left motor in + configuration, back left motor in x configuration + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t target_system,uint16_t motor_front_nw,uint16_t motor_right_ne,uint16_t motor_back_se,uint16_t motor_left_sw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[9]; + _mav_put_uint16_t(buf, 0, motor_front_nw); + _mav_put_uint16_t(buf, 2, motor_right_ne); + _mav_put_uint16_t(buf, 4, motor_back_se); + _mav_put_uint16_t(buf, 6, motor_left_sw); + _mav_put_uint8_t(buf, 8, target_system); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); +#else + mavlink_set_quad_motors_setpoint_t packet; + packet.motor_front_nw = motor_front_nw; + packet.motor_right_ne = motor_right_ne; + packet.motor_back_se = motor_back_se; + packet.motor_left_sw = motor_left_sw; + packet.target_system = target_system; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 30); +} + +/** + * @brief Encode a set_quad_motors_setpoint struct into a 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 set_quad_motors_setpoint C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_motors_setpoint_t* set_quad_motors_setpoint) +{ + return mavlink_msg_set_quad_motors_setpoint_pack(system_id, component_id, msg, set_quad_motors_setpoint->target_system, set_quad_motors_setpoint->motor_front_nw, set_quad_motors_setpoint->motor_right_ne, set_quad_motors_setpoint->motor_back_se, set_quad_motors_setpoint->motor_left_sw); +} + +/** + * @brief Send a set_quad_motors_setpoint message + * @param chan MAVLink channel to send the message + * + * @param target_system System ID of the system that should set these motor commands + * @param motor_front_nw Front motor in + configuration, front left motor in x configuration + * @param motor_right_ne Right motor in + configuration, front right motor in x configuration + * @param motor_back_se Back motor in + configuration, back right motor in x configuration + * @param motor_left_sw Left motor in + configuration, back left motor in x configuration + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_set_quad_motors_setpoint_send(mavlink_channel_t chan, uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[9]; + _mav_put_uint16_t(buf, 0, motor_front_nw); + _mav_put_uint16_t(buf, 2, motor_right_ne); + _mav_put_uint16_t(buf, 4, motor_back_se); + _mav_put_uint16_t(buf, 6, motor_left_sw); + _mav_put_uint8_t(buf, 8, target_system); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, buf, 9, 30); +#else + mavlink_set_quad_motors_setpoint_t packet; + packet.motor_front_nw = motor_front_nw; + packet.motor_right_ne = motor_right_ne; + packet.motor_back_se = motor_back_se; + packet.motor_left_sw = motor_left_sw; + packet.target_system = target_system; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, (const char *)&packet, 9, 30); +#endif +} + +#endif + +// MESSAGE SET_QUAD_MOTORS_SETPOINT UNPACKING + + +/** + * @brief Get field target_system from set_quad_motors_setpoint message + * + * @return System ID of the system that should set these motor commands + */ +static inline uint8_t mavlink_msg_set_quad_motors_setpoint_get_target_system(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 8); +} + +/** + * @brief Get field motor_front_nw from set_quad_motors_setpoint message + * + * @return Front motor in + configuration, front left motor in x configuration + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_front_nw(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 0); +} + +/** + * @brief Get field motor_right_ne from set_quad_motors_setpoint message + * + * @return Right motor in + configuration, front right motor in x configuration + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_right_ne(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 2); +} + +/** + * @brief Get field motor_back_se from set_quad_motors_setpoint message + * + * @return Back motor in + configuration, back right motor in x configuration + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_back_se(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 4); +} + +/** + * @brief Get field motor_left_sw from set_quad_motors_setpoint message + * + * @return Left motor in + configuration, back left motor in x configuration + */ +static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_left_sw(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 6); +} + +/** + * @brief Decode a set_quad_motors_setpoint message into a struct + * + * @param msg The message to decode + * @param set_quad_motors_setpoint C-struct to decode the message contents into + */ +static inline void mavlink_msg_set_quad_motors_setpoint_decode(const mavlink_message_t* msg, mavlink_set_quad_motors_setpoint_t* set_quad_motors_setpoint) +{ +#if MAVLINK_NEED_BYTE_SWAP + set_quad_motors_setpoint->motor_front_nw = mavlink_msg_set_quad_motors_setpoint_get_motor_front_nw(msg); + set_quad_motors_setpoint->motor_right_ne = mavlink_msg_set_quad_motors_setpoint_get_motor_right_ne(msg); + set_quad_motors_setpoint->motor_back_se = mavlink_msg_set_quad_motors_setpoint_get_motor_back_se(msg); + set_quad_motors_setpoint->motor_left_sw = mavlink_msg_set_quad_motors_setpoint_get_motor_left_sw(msg); + set_quad_motors_setpoint->target_system = mavlink_msg_set_quad_motors_setpoint_get_target_system(msg); +#else + memcpy(set_quad_motors_setpoint, _MAV_PAYLOAD(msg), 9); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h new file mode 100644 index 0000000000..c3ea8de408 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust.h @@ -0,0 +1,236 @@ +// MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST PACKING + +#define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST 61 + +typedef struct __mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t +{ + int16_t roll[6]; ///< Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 + int16_t pitch[6]; ///< Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 + int16_t yaw[6]; ///< Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 + uint16_t thrust[6]; ///< Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 + uint8_t target_systems[6]; ///< System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs +} mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t; + +#define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 54 +#define MAVLINK_MSG_ID_61_LEN 54 + +#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 6 +#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 6 +#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 6 +#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_THRUST_LEN 6 +#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_TARGET_SYSTEMS_LEN 6 + +#define MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST { \ + "SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST", \ + 5, \ + { { "roll", NULL, MAVLINK_TYPE_INT16_T, 6, 0, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_INT16_T, 6, 12, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_INT16_T, 6, 24, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, yaw) }, \ + { "thrust", NULL, MAVLINK_TYPE_UINT16_T, 6, 36, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, thrust) }, \ + { "target_systems", NULL, MAVLINK_TYPE_UINT8_T, 6, 48, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, target_systems) }, \ + } \ +} + + +/** + * @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust 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_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs + * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const uint8_t *target_systems, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[54]; + + _mav_put_int16_t_array(buf, 0, roll, 6); + _mav_put_int16_t_array(buf, 12, pitch, 6); + _mav_put_int16_t_array(buf, 24, yaw, 6); + _mav_put_uint16_t_array(buf, 36, thrust, 6); + _mav_put_uint8_t_array(buf, 48, target_systems, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); +#else + mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; + + mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); + mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); + mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); + mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); + mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; + return mavlink_finalize_message(msg, system_id, component_id, 54, 200); +} + +/** + * @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param target_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs + * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const uint8_t *target_systems,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[54]; + + _mav_put_int16_t_array(buf, 0, roll, 6); + _mav_put_int16_t_array(buf, 12, pitch, 6); + _mav_put_int16_t_array(buf, 24, yaw, 6); + _mav_put_uint16_t_array(buf, 36, thrust, 6); + _mav_put_uint8_t_array(buf, 48, target_systems, 6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54); +#else + mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; + + mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); + mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); + mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); + mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); + mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 54, 200); +} + +/** + * @brief Encode a set_quad_swarm_roll_pitch_yaw_thrust struct into a 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 set_quad_swarm_roll_pitch_yaw_thrust C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust) +{ + return mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_quad_swarm_roll_pitch_yaw_thrust->target_systems, set_quad_swarm_roll_pitch_yaw_thrust->roll, set_quad_swarm_roll_pitch_yaw_thrust->pitch, set_quad_swarm_roll_pitch_yaw_thrust->yaw, set_quad_swarm_roll_pitch_yaw_thrust->thrust); +} + +/** + * @brief Send a set_quad_swarm_roll_pitch_yaw_thrust message + * @param chan MAVLink channel to send the message + * + * @param target_systems System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs + * @param roll Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param pitch Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param yaw Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 + * @param thrust Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, const uint8_t *target_systems, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[54]; + + _mav_put_int16_t_array(buf, 0, roll, 6); + _mav_put_int16_t_array(buf, 12, pitch, 6); + _mav_put_int16_t_array(buf, 24, yaw, 6); + _mav_put_uint16_t_array(buf, 36, thrust, 6); + _mav_put_uint8_t_array(buf, 48, target_systems, 6); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, 54, 200); +#else + mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet; + + mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*6); + mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*6); + mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*6); + mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*6); + mav_array_memcpy(packet.target_systems, target_systems, sizeof(uint8_t)*6); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 54, 200); +#endif +} + +#endif + +// MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST UNPACKING + + +/** + * @brief Get field target_systems from set_quad_swarm_roll_pitch_yaw_thrust message + * + * @return System IDs for 6 quadrotors: 0..5, the ID's are the MAVLink IDs + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_target_systems(const mavlink_message_t* msg, uint8_t *target_systems) +{ + return _MAV_RETURN_uint8_t_array(msg, target_systems, 6, 48); +} + +/** + * @brief Get field roll from set_quad_swarm_roll_pitch_yaw_thrust message + * + * @return Desired roll angle in radians, scaled to int16 for 6 quadrotors: 0..5 + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg, int16_t *roll) +{ + return _MAV_RETURN_int16_t_array(msg, roll, 6, 0); +} + +/** + * @brief Get field pitch from set_quad_swarm_roll_pitch_yaw_thrust message + * + * @return Desired pitch angle in radians, scaled to int16 for 6 quadrotors: 0..5 + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg, int16_t *pitch) +{ + return _MAV_RETURN_int16_t_array(msg, pitch, 6, 12); +} + +/** + * @brief Get field yaw from set_quad_swarm_roll_pitch_yaw_thrust message + * + * @return Desired yaw angle in radians, scaled to int16 for 6 quadrotors: 0..5 + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg, int16_t *yaw) +{ + return _MAV_RETURN_int16_t_array(msg, yaw, 6, 24); +} + +/** + * @brief Get field thrust from set_quad_swarm_roll_pitch_yaw_thrust message + * + * @return Collective thrust, scaled to uint16 for 6 quadrotors: 0..5 + */ +static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg, uint16_t *thrust) +{ + return _MAV_RETURN_uint16_t_array(msg, thrust, 6, 36); +} + +/** + * @brief Decode a set_quad_swarm_roll_pitch_yaw_thrust message into a struct + * + * @param msg The message to decode + * @param set_quad_swarm_roll_pitch_yaw_thrust C-struct to decode the message contents into + */ +static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(const mavlink_message_t* msg, mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(msg, set_quad_swarm_roll_pitch_yaw_thrust->roll); + mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(msg, set_quad_swarm_roll_pitch_yaw_thrust->pitch); + mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(msg, set_quad_swarm_roll_pitch_yaw_thrust->yaw); + mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(msg, set_quad_swarm_roll_pitch_yaw_thrust->thrust); + mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_target_systems(msg, set_quad_swarm_roll_pitch_yaw_thrust->target_systems); +#else + memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 54); +#endif +} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h index 0141f77520..b79a7e9f2f 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_speed_thrust.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.roll_speed = roll_speed; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_speed_thrust_t packet; packet.roll_speed = roll_speed; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h index 453cf7b9c8..8cd573a26c 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_roll_pitch_yaw_thrust.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.roll = roll; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s _mav_put_uint8_t(buf, 16, target_system); _mav_put_uint8_t(buf, 17, target_component); - memcpy(_MAV_PAYLOAD(msg), buf, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); #else mavlink_set_roll_pitch_yaw_thrust_t packet; packet.roll = roll; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s packet.target_system = target_system; packet.target_component = target_component; - memcpy(_MAV_PAYLOAD(msg), &packet, 18); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); #endif msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_state_correction.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_state_correction.h index 7dea690d29..0f4f1f5e22 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_state_correction.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_state_correction.h @@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; @@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, _mav_put_float(buf, 28, vyErr); _mav_put_float(buf, 32, vzErr); - memcpy(_MAV_PAYLOAD(msg), buf, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); #else mavlink_state_correction_t packet; packet.xErr = xErr; @@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id, packet.vyErr = vyErr; packet.vzErr = vzErr; - memcpy(_MAV_PAYLOAD(msg), &packet, 36); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); #endif msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_statustext.h similarity index 86% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_statustext.h index 1e1d38d2c7..7c65d448f4 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_statustext.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_statustext.h @@ -4,7 +4,7 @@ typedef struct __mavlink_statustext_t { - uint8_t severity; ///< Severity of status, 0 = info message, 255 = critical fault + 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; @@ -28,7 +28,7 @@ typedef struct __mavlink_statustext_t * @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, 0 = info message, 255 = critical fault + * @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) */ @@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co char buf[51]; _mav_put_uint8_t(buf, 0, severity); _mav_put_char_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(char)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; @@ -57,7 +57,7 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into - * @param severity Severity of status, 0 = info message, 255 = critical fault + * @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) */ @@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8 char buf[51]; _mav_put_uint8_t(buf, 0, severity); _mav_put_char_array(buf, 1, text, 50); - memcpy(_MAV_PAYLOAD(msg), buf, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); #else mavlink_statustext_t packet; packet.severity = severity; mav_array_memcpy(packet.text, text, sizeof(char)*50); - memcpy(_MAV_PAYLOAD(msg), &packet, 51); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); #endif msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; @@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t * @brief Send a statustext message * @param chan MAVLink channel to send the message * - * @param severity Severity of status, 0 = info message, 255 = critical fault + * @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 @@ -126,7 +126,7 @@ static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t s /** * @brief Get field severity from statustext message * - * @return Severity of status, 0 = info message, 255 = critical fault + * @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) { diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_sys_status.h similarity index 99% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_sys_status.h index adada471d1..ef09a652f8 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_sys_status.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_sys_status.h @@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co _mav_put_uint16_t(buf, 28, errors_count4); _mav_put_int8_t(buf, 30, battery_remaining); - memcpy(_MAV_PAYLOAD(msg), buf, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31); #else mavlink_sys_status_t packet; packet.onboard_control_sensors_present = onboard_control_sensors_present; @@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co packet.errors_count4 = errors_count4; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD(msg), &packet, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; @@ -149,7 +149,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 _mav_put_uint16_t(buf, 28, errors_count4); _mav_put_int8_t(buf, 30, battery_remaining); - memcpy(_MAV_PAYLOAD(msg), buf, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31); #else mavlink_sys_status_t packet; packet.onboard_control_sensors_present = onboard_control_sensors_present; @@ -166,7 +166,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 packet.errors_count4 = errors_count4; packet.battery_remaining = battery_remaining; - memcpy(_MAV_PAYLOAD(msg), &packet, 31); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31); #endif msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_system_time.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_system_time.h index a46db49c31..c24808d1a2 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_system_time.h @@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c _mav_put_uint64_t(buf, 0, time_unix_usec); _mav_put_uint32_t(buf, 8, time_boot_ms); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_system_time_t packet; packet.time_unix_usec = time_unix_usec; packet.time_boot_ms = time_boot_ms; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; @@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint _mav_put_uint64_t(buf, 0, time_unix_usec); _mav_put_uint32_t(buf, 8, time_boot_ms); - memcpy(_MAV_PAYLOAD(msg), buf, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); #else mavlink_system_time_t packet; packet.time_unix_usec = time_unix_usec; packet.time_boot_ms = time_boot_ms; - memcpy(_MAV_PAYLOAD(msg), &packet, 12); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vfr_hud.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vfr_hud.h index 3e4c09acdc..d7c1afe410 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vfr_hud.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vfr_hud.h @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo _mav_put_int16_t(buf, 16, heading); _mav_put_uint16_t(buf, 18, throttle); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo packet.heading = heading; packet.throttle = throttle; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; @@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t _mav_put_int16_t(buf, 16, heading); _mav_put_uint16_t(buf, 18, throttle); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vfr_hud_t packet; packet.airspeed = airspeed; @@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t packet.heading = heading; packet.throttle = throttle; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VFR_HUD; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vicon_position_estimate.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vicon_position_estimate.h index 93db6edef9..ecb565684d 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vicon_position_estimate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vicon_position_estimate.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_vicon_position_estimate_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_vicon_position_estimate_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_position_estimate.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_position_estimate.h index c99fc99ab1..041caf7a07 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_position_estimate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_position_estimate.h @@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_vision_position_estimate_t packet; packet.usec = usec; @@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; @@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy _mav_put_float(buf, 24, pitch); _mav_put_float(buf, 28, yaw); - memcpy(_MAV_PAYLOAD(msg), buf, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); #else mavlink_vision_position_estimate_t packet; packet.usec = usec; @@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy packet.pitch = pitch; packet.yaw = yaw; - memcpy(_MAV_PAYLOAD(msg), &packet, 32); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); #endif msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_speed_estimate.h similarity index 96% rename from libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_speed_estimate.h index 71d250c389..3e30b9247a 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_vision_speed_estimate.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_speed_estimate.h @@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vision_speed_estimate_t packet; packet.usec = usec; @@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; @@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste _mav_put_float(buf, 12, y); _mav_put_float(buf, 16, z); - memcpy(_MAV_PAYLOAD(msg), buf, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); #else mavlink_vision_speed_estimate_t packet; packet.usec = usec; @@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste packet.y = y; packet.z = z; - memcpy(_MAV_PAYLOAD(msg), &packet, 20); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); #endif msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; diff --git a/libraries/GCS_MAVLink/include_v1.0/common/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h similarity index 95% rename from libraries/GCS_MAVLink/include_v1.0/common/testsuite.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h index a5089f5997..5459a61a5a 100644 --- a/libraries/GCS_MAVLink/include_v1.0/common/testsuite.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h @@ -2526,6 +2526,108 @@ static void mavlink_test_roll_pitch_yaw_speed_thrust_setpoint(uint8_t system_id, MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); } +static void mavlink_test_set_quad_motors_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +{ + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_set_quad_motors_setpoint_t packet_in = { + 17235, + 17339, + 17443, + 17547, + 29, + }; + mavlink_set_quad_motors_setpoint_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.motor_front_nw = packet_in.motor_front_nw; + packet1.motor_right_ne = packet_in.motor_right_ne; + packet1.motor_back_se = packet_in.motor_back_se; + packet1.motor_left_sw = packet_in.motor_left_sw; + packet1.target_system = packet_in.target_system; + + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_set_quad_motors_setpoint_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_set_quad_motors_setpoint_pack(system_id, component_id, &msg , packet1.target_system , packet1.motor_front_nw , packet1.motor_right_ne , packet1.motor_back_se , packet1.motor_left_sw ); + mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_set_quad_motors_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.motor_front_nw , packet1.motor_right_ne , packet1.motor_back_se , packet1.motor_left_sw ); + mavlink_msg_set_quad_motors_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; imagic, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len); + memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len); return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len; } @@ -182,8 +200,6 @@ MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c) */ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status) { - static mavlink_message_t m_mavlink_message[MAVLINK_COMM_NUM_BUFFERS]; - /* default message crc function. You can override this per-system to put this data in a different memory segment @@ -195,7 +211,7 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa #endif #endif - mavlink_message_t* rxmsg = &m_mavlink_message[chan]; ///< The currently decoded message + mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); ///< The currently decoded message mavlink_status_t* status = mavlink_get_channel_status(chan); ///< The current decode status int bufferIndex = 0; @@ -209,6 +225,7 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa { status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; rxmsg->len = 0; + rxmsg->magic = c; mavlink_start_checksum(rxmsg); } break; @@ -269,7 +286,7 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa break; case MAVLINK_PARSE_STATE_GOT_MSGID: - _MAV_PAYLOAD(rxmsg)[status->packet_idx++] = (char)c; + _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c; mavlink_update_checksum(rxmsg, c); if (status->packet_idx == rxmsg->len) { @@ -296,6 +313,7 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa else { status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1; + _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx] = (char)c; } break; @@ -317,6 +335,7 @@ MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messa // Successfully got message status->msg_received = 1; 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; diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_protobuf_manager.hpp b/libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_protobuf_manager.hpp new file mode 100644 index 0000000000..fd3ddd026f --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_protobuf_manager.hpp @@ -0,0 +1,377 @@ +#ifndef MAVLINKPROTOBUFMANAGER_HPP +#define MAVLINKPROTOBUFMANAGER_HPP + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace mavlink +{ + +class ProtobufManager +{ +public: + ProtobufManager() + : mRegisteredTypeCount(0) + , mStreamID(0) + , mVerbose(false) + , kExtendedHeaderSize(MAVLINK_EXTENDED_HEADER_LEN) + , kExtendedPayloadMaxSize(MAVLINK_MAX_EXTENDED_PAYLOAD_LEN) + { + // register GLOverlay + { + std::tr1::shared_ptr msg(new px::GLOverlay); + registerType(msg); + } + + // register ObstacleList + { + std::tr1::shared_ptr msg(new px::ObstacleList); + registerType(msg); + } + + // register ObstacleMap + { + std::tr1::shared_ptr msg(new px::ObstacleMap); + registerType(msg); + } + + // register Path + { + std::tr1::shared_ptr msg(new px::Path); + registerType(msg); + } + + // register PointCloudXYZI + { + std::tr1::shared_ptr msg(new px::PointCloudXYZI); + registerType(msg); + } + + // register PointCloudXYZRGB + { + std::tr1::shared_ptr msg(new px::PointCloudXYZRGB); + registerType(msg); + } + + // register RGBDImage + { + std::tr1::shared_ptr msg(new px::RGBDImage); + registerType(msg); + } + + srand(time(NULL)); + mStreamID = rand() + 1; + } + + bool fragmentMessage(uint8_t system_id, uint8_t component_id, + uint8_t target_system, uint8_t target_component, + const google::protobuf::Message& protobuf_msg, + std::vector& fragments) const + { + TypeMap::const_iterator it = mTypeMap.find(protobuf_msg.GetTypeName()); + if (it == mTypeMap.end()) + { + std::cout << "# WARNING: Protobuf message with type " + << protobuf_msg.GetTypeName() << " is not registered." + << std::endl; + return false; + } + + uint8_t typecode = it->second; + + std::string data = protobuf_msg.SerializeAsString(); + + int fragmentCount = (protobuf_msg.ByteSize() + kExtendedPayloadMaxSize - 1) / kExtendedPayloadMaxSize; + unsigned int offset = 0; + + for (int i = 0; i < fragmentCount; ++i) + { + mavlink_extended_message_t fragment; + + // write extended header data + uint8_t* payload = reinterpret_cast(fragment.base_msg.payload64); + unsigned int length = 0; + uint8_t flags = 0; + + if (i < fragmentCount - 1) + { + length = kExtendedPayloadMaxSize; + flags |= 0x1; + } + else + { + length = protobuf_msg.ByteSize() - kExtendedPayloadMaxSize * (fragmentCount - 1); + } + + memcpy(payload, &target_system, 1); + memcpy(payload + 1, &target_component, 1); + memcpy(payload + 2, &typecode, 1); + memcpy(payload + 3, &length, 4); + memcpy(payload + 7, &mStreamID, 2); + memcpy(payload + 9, &offset, 4); + memcpy(payload + 13, &flags, 1); + + fragment.base_msg.msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE; + mavlink_finalize_message(&fragment.base_msg, system_id, component_id, kExtendedHeaderSize, 0); + + // write extended payload data + fragment.extended_payload_len = length; + memcpy(fragment.extended_payload, &data[offset], length); + + fragments.push_back(fragment); + offset += length; + } + + if (mVerbose) + { + std::cerr << "# INFO: Split extended message with size " + << protobuf_msg.ByteSize() << " into " + << fragmentCount << " fragments." << std::endl; + } + + return true; + } + + bool cacheFragment(mavlink_extended_message_t& msg) + { + if (!validFragment(msg)) + { + if (mVerbose) + { + std::cerr << "# WARNING: Message is not a valid fragment. " + << "Dropping message..." << std::endl; + } + return false; + } + + // read extended header + uint8_t* payload = reinterpret_cast(msg.base_msg.payload64); + uint8_t typecode = 0; + unsigned int length = 0; + unsigned short streamID = 0; + unsigned int offset = 0; + uint8_t flags = 0; + + memcpy(&typecode, payload + 2, 1); + memcpy(&length, payload + 3, 4); + memcpy(&streamID, payload + 7, 2); + memcpy(&offset, payload + 9, 4); + memcpy(&flags, payload + 13, 1); + + if (typecode >= mTypeMap.size()) + { + std::cout << "# WARNING: Protobuf message with type code " + << static_cast(typecode) << " is not registered." << std::endl; + return false; + } + + bool reassemble = false; + + FragmentQueue::iterator it = mFragmentQueue.find(streamID); + if (it == mFragmentQueue.end()) + { + if (offset == 0) + { + mFragmentQueue[streamID].push_back(msg); + + if ((flags & 0x1) != 0x1) + { + reassemble = true; + } + + if (mVerbose) + { + std::cerr << "# INFO: Added fragment to new queue." + << std::endl; + } + } + else + { + if (mVerbose) + { + std::cerr << "# WARNING: Message is not a valid fragment. " + << "Dropping message..." << std::endl; + } + } + } + else + { + std::deque& queue = it->second; + + if (queue.empty()) + { + if (offset == 0) + { + queue.push_back(msg); + + if ((flags & 0x1) != 0x1) + { + reassemble = true; + } + } + else + { + if (mVerbose) + { + std::cerr << "# WARNING: Message is not a valid fragment. " + << "Dropping message..." << std::endl; + } + } + } + else + { + if (fragmentDataSize(queue.back()) + fragmentOffset(queue.back()) != offset) + { + if (mVerbose) + { + std::cerr << "# WARNING: Previous fragment(s) have been lost. " + << "Dropping message and clearing queue..." << std::endl; + } + queue.clear(); + } + else + { + queue.push_back(msg); + + if ((flags & 0x1) != 0x1) + { + reassemble = true; + } + } + } + } + + if (reassemble) + { + std::deque& queue = mFragmentQueue[streamID]; + + std::string data; + for (size_t i = 0; i < queue.size(); ++i) + { + mavlink_extended_message_t& mavlink_msg = queue.at(i); + + data.append(reinterpret_cast(&mavlink_msg.extended_payload[0]), + static_cast(mavlink_msg.extended_payload_len)); + } + + mMessages.at(typecode)->ParseFromString(data); + + mMessageAvailable.at(typecode) = true; + + queue.clear(); + + if (mVerbose) + { + std::cerr << "# INFO: Reassembled fragments for message with typename " + << mMessages.at(typecode)->GetTypeName() << " and size " + << mMessages.at(typecode)->ByteSize() + << "." << std::endl; + } + } + + return true; + } + + bool getMessage(std::tr1::shared_ptr& msg) + { + for (size_t i = 0; i < mMessageAvailable.size(); ++i) + { + if (mMessageAvailable.at(i)) + { + msg = mMessages.at(i); + mMessageAvailable.at(i) = false; + + return true; + } + } + + return false; + } + +private: + void registerType(const std::tr1::shared_ptr& msg) + { + mTypeMap[msg->GetTypeName()] = mRegisteredTypeCount; + ++mRegisteredTypeCount; + mMessages.push_back(msg); + mMessageAvailable.push_back(false); + } + + bool validFragment(const mavlink_extended_message_t& msg) const + { + if (msg.base_msg.magic != MAVLINK_STX || + msg.base_msg.len != kExtendedHeaderSize || + msg.base_msg.msgid != MAVLINK_MSG_ID_EXTENDED_MESSAGE) + { + return false; + } + + uint16_t checksum; + checksum = crc_calculate(reinterpret_cast(&msg.base_msg.len), MAVLINK_CORE_HEADER_LEN); + crc_accumulate_buffer(&checksum, reinterpret_cast(&msg.base_msg.payload64), kExtendedHeaderSize); +#if MAVLINK_CRC_EXTRA + static const uint8_t mavlink_message_crcs[256] = MAVLINK_MESSAGE_CRCS; + crc_accumulate(mavlink_message_crcs[msg.base_msg.msgid], &checksum); +#endif + + if (mavlink_ck_a(&(msg.base_msg)) != (uint8_t)(checksum & 0xFF) && + mavlink_ck_b(&(msg.base_msg)) != (uint8_t)(checksum >> 8)) + { + return false; + } + + return true; + } + + unsigned int fragmentDataSize(const mavlink_extended_message_t& msg) const + { + const uint8_t* payload = reinterpret_cast(msg.base_msg.payload64); + + return *(reinterpret_cast(payload + 3)); + } + + unsigned int fragmentOffset(const mavlink_extended_message_t& msg) const + { + const uint8_t* payload = reinterpret_cast(msg.base_msg.payload64); + + return *(reinterpret_cast(payload + 9)); + } + + int mRegisteredTypeCount; + unsigned short mStreamID; + bool mVerbose; + + typedef std::map TypeMap; + TypeMap mTypeMap; + std::vector< std::tr1::shared_ptr > mMessages; + std::vector mMessageAvailable; + + typedef std::map > FragmentQueue; + FragmentQueue mFragmentQueue; + + const int kExtendedHeaderSize; + /** + * Extended header structure + * ========================= + * byte 0 - target_system + * byte 1 - target_component + * byte 2 - extended message id (type code) + * bytes 3-6 - extended payload size in bytes + * byte 7-8 - stream ID + * byte 9-12 - fragment offset + * byte 13 - fragment flags (bit 0 - 1=more fragments, 0=last fragment) + */ + + const int kExtendedPayloadMaxSize; +}; + +} + +#endif diff --git a/libraries/GCS_MAVLink/include_v1.0/mavlink_types.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_types.h similarity index 69% rename from libraries/GCS_MAVLink/include_v1.0/mavlink_types.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_types.h index 03faf594fe..16e32ae635 100644 --- a/libraries/GCS_MAVLink/include_v1.0/mavlink_types.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_types.h @@ -3,54 +3,6 @@ #include -enum MAV_ACTION -{ - MAV_ACTION_HOLD = 0, - MAV_ACTION_MOTORS_START = 1, - MAV_ACTION_LAUNCH = 2, - MAV_ACTION_RETURN = 3, - MAV_ACTION_EMCY_LAND = 4, - MAV_ACTION_EMCY_KILL = 5, - MAV_ACTION_CONFIRM_KILL = 6, - MAV_ACTION_CONTINUE = 7, - MAV_ACTION_MOTORS_STOP = 8, - MAV_ACTION_HALT = 9, - MAV_ACTION_SHUTDOWN = 10, - MAV_ACTION_REBOOT = 11, - MAV_ACTION_SET_MANUAL = 12, - MAV_ACTION_SET_AUTO = 13, - MAV_ACTION_STORAGE_READ = 14, - MAV_ACTION_STORAGE_WRITE = 15, - MAV_ACTION_CALIBRATE_RC = 16, - MAV_ACTION_CALIBRATE_GYRO = 17, - MAV_ACTION_CALIBRATE_MAG = 18, - MAV_ACTION_CALIBRATE_ACC = 19, - MAV_ACTION_CALIBRATE_PRESSURE = 20, - MAV_ACTION_REC_START = 21, - MAV_ACTION_REC_PAUSE = 22, - MAV_ACTION_REC_STOP = 23, - MAV_ACTION_TAKEOFF = 24, - MAV_ACTION_NAVIGATE = 25, - MAV_ACTION_LAND = 26, - MAV_ACTION_LOITER = 27, - MAV_ACTION_SET_ORIGIN = 28, - MAV_ACTION_RELAY_ON = 29, - MAV_ACTION_RELAY_OFF = 30, - MAV_ACTION_GET_IMAGE = 31, - MAV_ACTION_VIDEO_START = 32, - MAV_ACTION_VIDEO_STOP = 33, - MAV_ACTION_RESET_MAP = 34, - MAV_ACTION_RESET_PLAN = 35, - MAV_ACTION_DELAY_BEFORE_COMMAND = 36, - MAV_ACTION_ASCEND_AT_RATE = 37, - MAV_ACTION_CHANGE_MODE = 38, - MAV_ACTION_LOITER_MAX_TURNS = 39, - MAV_ACTION_LOITER_MAX_TIME = 40, - MAV_ACTION_START_HILSIM = 41, - MAV_ACTION_STOP_HILSIM = 42, - MAV_ACTION_NB ///< Number of MAV actions -}; - #ifndef MAVLINK_MAX_PAYLOAD_LEN // it is possible to override this, but be careful! #define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length @@ -63,11 +15,23 @@ enum MAV_ACTION #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 + +#define MAVLINK_MAX_EXTENDED_PACKET_LEN 65507 +#if (MAVLINK_MAX_EXTENDED_PACKET_LEN > __WCHAR_MAX__) +#define MAVLINK_MAX_EXTENDED_PACKET_LEN __WCHAR_MAX__ +#endif + +#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES) + typedef struct param_union { union { float param_float; int32_t param_int32; uint32_t param_uint32; + uint8_t param_uint8; + uint8_t bytes[4]; }; uint8_t type; } mavlink_param_union_t; @@ -92,6 +56,14 @@ typedef struct __mavlink_message { uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8]; } mavlink_message_t; + +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, @@ -109,12 +81,12 @@ typedef enum { #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 array_length; // if non-zero, field is an array - unsigned wire_offset; // offset of each field in the payload - unsigned structure_offset; // offset in a C structure + 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 @@ -125,11 +97,12 @@ typedef struct __mavlink_message_info { mavlink_field_info_t fields[MAVLINK_MAX_FIELDS]; // field information } mavlink_message_info_t; -#define _MAV_PAYLOAD(msg) ((char *)(&(msg)->payload64[0])) +#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(msg)) -#define mavlink_ck_b(msg) *((msg->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD(msg)) +#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, diff --git a/libraries/GCS_MAVLink/include_v1.0/protocol.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/protocol.h similarity index 97% rename from libraries/GCS_MAVLink/include_v1.0/protocol.h rename to libraries/GCS_MAVLink/include/mavlink/v1.0/protocol.h index 05195c3691..7b3e3c0bd2 100644 --- a/libraries/GCS_MAVLink/include_v1.0/protocol.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/protocol.h @@ -155,7 +155,7 @@ static inline void byte_copy_8(char *dst, const char *src) /* like memcpy(), but if src is NULL, do a memset to zero - */ +*/ static void mav_array_memcpy(void *dest, const void *src, size_t n) { if (src == NULL) { @@ -171,6 +171,7 @@ static void mav_array_memcpy(void *dest, const void *src, size_t n) 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); + } /* @@ -179,6 +180,7 @@ static inline void _mav_put_char_array(char *buf, uint8_t wire_offset, const cha 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); + } /* @@ -187,6 +189,7 @@ static inline void _mav_put_uint8_t_array(char *buf, uint8_t wire_offset, const 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 @@ -206,7 +209,7 @@ static inline void _mav_put_ ## TYPE ##_array(char *buf, uint8_t wire_offset, co #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)); \ + mav_array_memcpy(&buf[wire_offset], b, array_length*sizeof(TYPE)); \ } #endif @@ -219,9 +222,9 @@ _MAV_PUT_ARRAY(int64_t, i64) _MAV_PUT_ARRAY(float, f) _MAV_PUT_ARRAY(double, d) -#define _MAV_RETURN_char(msg, wire_offset) _MAV_PAYLOAD(msg)[wire_offset] -#define _MAV_RETURN_int8_t(msg, wire_offset) (int8_t)_MAV_PAYLOAD(msg)[wire_offset] -#define _MAV_RETURN_uint8_t(msg, wire_offset) (uint8_t)_MAV_PAYLOAD(msg)[wire_offset] +#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) \ diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink.h new file mode 100644 index 0000000000..c0a0a89673 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink.h @@ -0,0 +1,27 @@ +/** @file + * @brief MAVLink comm protocol built from sensesoar.xml + * @see http://pixhawk.ethz.ch/software/mavlink + */ +#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 + +#include "version.h" +#include "sensesoar.h" + +#endif // MAVLINK_H diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_ack.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_ack.h new file mode 100644 index 0000000000..6dcab9fa82 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_ack.h @@ -0,0 +1,166 @@ +// MESSAGE CMD_AIRSPEED_ACK PACKING + +#define MAVLINK_MSG_ID_CMD_AIRSPEED_ACK 194 + +typedef struct __mavlink_cmd_airspeed_ack_t +{ + float spCmd; ///< commanded airspeed + uint8_t ack; ///< 0:ack, 1:nack +} mavlink_cmd_airspeed_ack_t; + +#define MAVLINK_MSG_ID_CMD_AIRSPEED_ACK_LEN 5 +#define MAVLINK_MSG_ID_194_LEN 5 + + + +#define MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_ACK { \ + "CMD_AIRSPEED_ACK", \ + 2, \ + { { "spCmd", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_cmd_airspeed_ack_t, spCmd) }, \ + { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_cmd_airspeed_ack_t, ack) }, \ + } \ +} + + +/** + * @brief Pack a cmd_airspeed_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 spCmd commanded airspeed + * @param ack 0:ack, 1:nack + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_cmd_airspeed_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + float spCmd, uint8_t ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, ack); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); +#else + mavlink_cmd_airspeed_ack_t packet; + packet.spCmd = spCmd; + packet.ack = ack; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); +#endif + + msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_ACK; + return mavlink_finalize_message(msg, system_id, component_id, 5, 243); +} + +/** + * @brief Pack a cmd_airspeed_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 was sent over + * @param msg The MAVLink message to compress the data into + * @param spCmd commanded airspeed + * @param ack 0:ack, 1:nack + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_cmd_airspeed_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + float spCmd,uint8_t ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, ack); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); +#else + mavlink_cmd_airspeed_ack_t packet; + packet.spCmd = spCmd; + packet.ack = ack; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); +#endif + + msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_ACK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5, 243); +} + +/** + * @brief Encode a cmd_airspeed_ack struct into a 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 cmd_airspeed_ack C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_cmd_airspeed_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cmd_airspeed_ack_t* cmd_airspeed_ack) +{ + return mavlink_msg_cmd_airspeed_ack_pack(system_id, component_id, msg, cmd_airspeed_ack->spCmd, cmd_airspeed_ack->ack); +} + +/** + * @brief Send a cmd_airspeed_ack message + * @param chan MAVLink channel to send the message + * + * @param spCmd commanded airspeed + * @param ack 0:ack, 1:nack + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_cmd_airspeed_ack_send(mavlink_channel_t chan, float spCmd, uint8_t ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, ack); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_ACK, buf, 5, 243); +#else + mavlink_cmd_airspeed_ack_t packet; + packet.spCmd = spCmd; + packet.ack = ack; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_ACK, (const char *)&packet, 5, 243); +#endif +} + +#endif + +// MESSAGE CMD_AIRSPEED_ACK UNPACKING + + +/** + * @brief Get field spCmd from cmd_airspeed_ack message + * + * @return commanded airspeed + */ +static inline float mavlink_msg_cmd_airspeed_ack_get_spCmd(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Get field ack from cmd_airspeed_ack message + * + * @return 0:ack, 1:nack + */ +static inline uint8_t mavlink_msg_cmd_airspeed_ack_get_ack(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Decode a cmd_airspeed_ack message into a struct + * + * @param msg The message to decode + * @param cmd_airspeed_ack C-struct to decode the message contents into + */ +static inline void mavlink_msg_cmd_airspeed_ack_decode(const mavlink_message_t* msg, mavlink_cmd_airspeed_ack_t* cmd_airspeed_ack) +{ +#if MAVLINK_NEED_BYTE_SWAP + cmd_airspeed_ack->spCmd = mavlink_msg_cmd_airspeed_ack_get_spCmd(msg); + cmd_airspeed_ack->ack = mavlink_msg_cmd_airspeed_ack_get_ack(msg); +#else + memcpy(cmd_airspeed_ack, _MAV_PAYLOAD(msg), 5); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_chng.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_chng.h new file mode 100644 index 0000000000..d5b21b8d79 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_cmd_airspeed_chng.h @@ -0,0 +1,166 @@ +// MESSAGE CMD_AIRSPEED_CHNG PACKING + +#define MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG 192 + +typedef struct __mavlink_cmd_airspeed_chng_t +{ + float spCmd; ///< commanded airspeed + uint8_t target; ///< Target ID +} mavlink_cmd_airspeed_chng_t; + +#define MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG_LEN 5 +#define MAVLINK_MSG_ID_192_LEN 5 + + + +#define MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_CHNG { \ + "CMD_AIRSPEED_CHNG", \ + 2, \ + { { "spCmd", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_cmd_airspeed_chng_t, spCmd) }, \ + { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_cmd_airspeed_chng_t, target) }, \ + } \ +} + + +/** + * @brief Pack a cmd_airspeed_chng 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 Target ID + * @param spCmd commanded airspeed + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_cmd_airspeed_chng_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t target, float spCmd) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, target); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); +#else + mavlink_cmd_airspeed_chng_t packet; + packet.spCmd = spCmd; + packet.target = target; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); +#endif + + msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG; + return mavlink_finalize_message(msg, system_id, component_id, 5, 209); +} + +/** + * @brief Pack a cmd_airspeed_chng 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param target Target ID + * @param spCmd commanded airspeed + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_cmd_airspeed_chng_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t target,float spCmd) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, target); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5); +#else + mavlink_cmd_airspeed_chng_t packet; + packet.spCmd = spCmd; + packet.target = target; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5); +#endif + + msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5, 209); +} + +/** + * @brief Encode a cmd_airspeed_chng struct into a 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 cmd_airspeed_chng C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_cmd_airspeed_chng_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cmd_airspeed_chng_t* cmd_airspeed_chng) +{ + return mavlink_msg_cmd_airspeed_chng_pack(system_id, component_id, msg, cmd_airspeed_chng->target, cmd_airspeed_chng->spCmd); +} + +/** + * @brief Send a cmd_airspeed_chng message + * @param chan MAVLink channel to send the message + * + * @param target Target ID + * @param spCmd commanded airspeed + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_cmd_airspeed_chng_send(mavlink_channel_t chan, uint8_t target, float spCmd) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[5]; + _mav_put_float(buf, 0, spCmd); + _mav_put_uint8_t(buf, 4, target); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG, buf, 5, 209); +#else + mavlink_cmd_airspeed_chng_t packet; + packet.spCmd = spCmd; + packet.target = target; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG, (const char *)&packet, 5, 209); +#endif +} + +#endif + +// MESSAGE CMD_AIRSPEED_CHNG UNPACKING + + +/** + * @brief Get field target from cmd_airspeed_chng message + * + * @return Target ID + */ +static inline uint8_t mavlink_msg_cmd_airspeed_chng_get_target(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Get field spCmd from cmd_airspeed_chng message + * + * @return commanded airspeed + */ +static inline float mavlink_msg_cmd_airspeed_chng_get_spCmd(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Decode a cmd_airspeed_chng message into a struct + * + * @param msg The message to decode + * @param cmd_airspeed_chng C-struct to decode the message contents into + */ +static inline void mavlink_msg_cmd_airspeed_chng_decode(const mavlink_message_t* msg, mavlink_cmd_airspeed_chng_t* cmd_airspeed_chng) +{ +#if MAVLINK_NEED_BYTE_SWAP + cmd_airspeed_chng->spCmd = mavlink_msg_cmd_airspeed_chng_get_spCmd(msg); + cmd_airspeed_chng->target = mavlink_msg_cmd_airspeed_chng_get_target(msg); +#else + memcpy(cmd_airspeed_chng, _MAV_PAYLOAD(msg), 5); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_filt_rot_vel.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_filt_rot_vel.h new file mode 100644 index 0000000000..f5fef06f04 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_filt_rot_vel.h @@ -0,0 +1,144 @@ +// MESSAGE FILT_ROT_VEL PACKING + +#define MAVLINK_MSG_ID_FILT_ROT_VEL 184 + +typedef struct __mavlink_filt_rot_vel_t +{ + float rotVel[3]; ///< rotational velocity +} mavlink_filt_rot_vel_t; + +#define MAVLINK_MSG_ID_FILT_ROT_VEL_LEN 12 +#define MAVLINK_MSG_ID_184_LEN 12 + +#define MAVLINK_MSG_FILT_ROT_VEL_FIELD_ROTVEL_LEN 3 + +#define MAVLINK_MESSAGE_INFO_FILT_ROT_VEL { \ + "FILT_ROT_VEL", \ + 1, \ + { { "rotVel", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_filt_rot_vel_t, rotVel) }, \ + } \ +} + + +/** + * @brief Pack a filt_rot_vel 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 rotVel rotational velocity + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_filt_rot_vel_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const float *rotVel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, rotVel, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_filt_rot_vel_t packet; + + mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_FILT_ROT_VEL; + return mavlink_finalize_message(msg, system_id, component_id, 12, 79); +} + +/** + * @brief Pack a filt_rot_vel 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param rotVel rotational velocity + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_filt_rot_vel_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const float *rotVel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, rotVel, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_filt_rot_vel_t packet; + + mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_FILT_ROT_VEL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 79); +} + +/** + * @brief Encode a filt_rot_vel struct into a 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 filt_rot_vel C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_filt_rot_vel_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_filt_rot_vel_t* filt_rot_vel) +{ + return mavlink_msg_filt_rot_vel_pack(system_id, component_id, msg, filt_rot_vel->rotVel); +} + +/** + * @brief Send a filt_rot_vel message + * @param chan MAVLink channel to send the message + * + * @param rotVel rotational velocity + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_filt_rot_vel_send(mavlink_channel_t chan, const float *rotVel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, rotVel, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILT_ROT_VEL, buf, 12, 79); +#else + mavlink_filt_rot_vel_t packet; + + mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILT_ROT_VEL, (const char *)&packet, 12, 79); +#endif +} + +#endif + +// MESSAGE FILT_ROT_VEL UNPACKING + + +/** + * @brief Get field rotVel from filt_rot_vel message + * + * @return rotational velocity + */ +static inline uint16_t mavlink_msg_filt_rot_vel_get_rotVel(const mavlink_message_t* msg, float *rotVel) +{ + return _MAV_RETURN_float_array(msg, rotVel, 3, 0); +} + +/** + * @brief Decode a filt_rot_vel message into a struct + * + * @param msg The message to decode + * @param filt_rot_vel C-struct to decode the message contents into + */ +static inline void mavlink_msg_filt_rot_vel_decode(const mavlink_message_t* msg, mavlink_filt_rot_vel_t* filt_rot_vel) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_filt_rot_vel_get_rotVel(msg, filt_rot_vel->rotVel); +#else + memcpy(filt_rot_vel, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_llc_out.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_llc_out.h new file mode 100644 index 0000000000..5ee3d5a19f --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_llc_out.h @@ -0,0 +1,167 @@ +// MESSAGE LLC_OUT PACKING + +#define MAVLINK_MSG_ID_LLC_OUT 186 + +typedef struct __mavlink_llc_out_t +{ + int16_t servoOut[4]; ///< Servo signal + int16_t MotorOut[2]; ///< motor signal +} mavlink_llc_out_t; + +#define MAVLINK_MSG_ID_LLC_OUT_LEN 12 +#define MAVLINK_MSG_ID_186_LEN 12 + +#define MAVLINK_MSG_LLC_OUT_FIELD_SERVOOUT_LEN 4 +#define MAVLINK_MSG_LLC_OUT_FIELD_MOTOROUT_LEN 2 + +#define MAVLINK_MESSAGE_INFO_LLC_OUT { \ + "LLC_OUT", \ + 2, \ + { { "servoOut", NULL, MAVLINK_TYPE_INT16_T, 4, 0, offsetof(mavlink_llc_out_t, servoOut) }, \ + { "MotorOut", NULL, MAVLINK_TYPE_INT16_T, 2, 8, offsetof(mavlink_llc_out_t, MotorOut) }, \ + } \ +} + + +/** + * @brief Pack a llc_out 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 servoOut Servo signal + * @param MotorOut motor signal + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_llc_out_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const int16_t *servoOut, const int16_t *MotorOut) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_int16_t_array(buf, 0, servoOut, 4); + _mav_put_int16_t_array(buf, 8, MotorOut, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_llc_out_t packet; + + mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4); + mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_LLC_OUT; + return mavlink_finalize_message(msg, system_id, component_id, 12, 5); +} + +/** + * @brief Pack a llc_out 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param servoOut Servo signal + * @param MotorOut motor signal + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_llc_out_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const int16_t *servoOut,const int16_t *MotorOut) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_int16_t_array(buf, 0, servoOut, 4); + _mav_put_int16_t_array(buf, 8, MotorOut, 2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_llc_out_t packet; + + mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4); + mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_LLC_OUT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 5); +} + +/** + * @brief Encode a llc_out struct into a 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 llc_out C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_llc_out_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_llc_out_t* llc_out) +{ + return mavlink_msg_llc_out_pack(system_id, component_id, msg, llc_out->servoOut, llc_out->MotorOut); +} + +/** + * @brief Send a llc_out message + * @param chan MAVLink channel to send the message + * + * @param servoOut Servo signal + * @param MotorOut motor signal + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_llc_out_send(mavlink_channel_t chan, const int16_t *servoOut, const int16_t *MotorOut) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_int16_t_array(buf, 0, servoOut, 4); + _mav_put_int16_t_array(buf, 8, MotorOut, 2); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LLC_OUT, buf, 12, 5); +#else + mavlink_llc_out_t packet; + + mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4); + mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LLC_OUT, (const char *)&packet, 12, 5); +#endif +} + +#endif + +// MESSAGE LLC_OUT UNPACKING + + +/** + * @brief Get field servoOut from llc_out message + * + * @return Servo signal + */ +static inline uint16_t mavlink_msg_llc_out_get_servoOut(const mavlink_message_t* msg, int16_t *servoOut) +{ + return _MAV_RETURN_int16_t_array(msg, servoOut, 4, 0); +} + +/** + * @brief Get field MotorOut from llc_out message + * + * @return motor signal + */ +static inline uint16_t mavlink_msg_llc_out_get_MotorOut(const mavlink_message_t* msg, int16_t *MotorOut) +{ + return _MAV_RETURN_int16_t_array(msg, MotorOut, 2, 8); +} + +/** + * @brief Decode a llc_out message into a struct + * + * @param msg The message to decode + * @param llc_out C-struct to decode the message contents into + */ +static inline void mavlink_msg_llc_out_decode(const mavlink_message_t* msg, mavlink_llc_out_t* llc_out) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_llc_out_get_servoOut(msg, llc_out->servoOut); + mavlink_msg_llc_out_get_MotorOut(msg, llc_out->MotorOut); +#else + memcpy(llc_out, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_temp.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_temp.h new file mode 100644 index 0000000000..60cf018454 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_temp.h @@ -0,0 +1,144 @@ +// MESSAGE OBS_AIR_TEMP PACKING + +#define MAVLINK_MSG_ID_OBS_AIR_TEMP 183 + +typedef struct __mavlink_obs_air_temp_t +{ + float airT; ///< Air Temperatur +} mavlink_obs_air_temp_t; + +#define MAVLINK_MSG_ID_OBS_AIR_TEMP_LEN 4 +#define MAVLINK_MSG_ID_183_LEN 4 + + + +#define MAVLINK_MESSAGE_INFO_OBS_AIR_TEMP { \ + "OBS_AIR_TEMP", \ + 1, \ + { { "airT", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_air_temp_t, airT) }, \ + } \ +} + + +/** + * @brief Pack a obs_air_temp 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 airT Air Temperatur + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_air_temp_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + float airT) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, airT); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_obs_air_temp_t packet; + packet.airT = airT; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_AIR_TEMP; + return mavlink_finalize_message(msg, system_id, component_id, 4, 248); +} + +/** + * @brief Pack a obs_air_temp 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param airT Air Temperatur + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_air_temp_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + float airT) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, airT); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_obs_air_temp_t packet; + packet.airT = airT; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_AIR_TEMP; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 248); +} + +/** + * @brief Encode a obs_air_temp struct into a 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 obs_air_temp C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_air_temp_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_air_temp_t* obs_air_temp) +{ + return mavlink_msg_obs_air_temp_pack(system_id, component_id, msg, obs_air_temp->airT); +} + +/** + * @brief Send a obs_air_temp message + * @param chan MAVLink channel to send the message + * + * @param airT Air Temperatur + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_air_temp_send(mavlink_channel_t chan, float airT) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, airT); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_TEMP, buf, 4, 248); +#else + mavlink_obs_air_temp_t packet; + packet.airT = airT; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_TEMP, (const char *)&packet, 4, 248); +#endif +} + +#endif + +// MESSAGE OBS_AIR_TEMP UNPACKING + + +/** + * @brief Get field airT from obs_air_temp message + * + * @return Air Temperatur + */ +static inline float mavlink_msg_obs_air_temp_get_airT(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Decode a obs_air_temp message into a struct + * + * @param msg The message to decode + * @param obs_air_temp C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_air_temp_decode(const mavlink_message_t* msg, mavlink_obs_air_temp_t* obs_air_temp) +{ +#if MAVLINK_NEED_BYTE_SWAP + obs_air_temp->airT = mavlink_msg_obs_air_temp_get_airT(msg); +#else + memcpy(obs_air_temp, _MAV_PAYLOAD(msg), 4); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_velocity.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_velocity.h new file mode 100644 index 0000000000..ef56c5c617 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_air_velocity.h @@ -0,0 +1,188 @@ +// MESSAGE OBS_AIR_VELOCITY PACKING + +#define MAVLINK_MSG_ID_OBS_AIR_VELOCITY 178 + +typedef struct __mavlink_obs_air_velocity_t +{ + float magnitude; ///< Air speed + float aoa; ///< angle of attack + float slip; ///< slip angle +} mavlink_obs_air_velocity_t; + +#define MAVLINK_MSG_ID_OBS_AIR_VELOCITY_LEN 12 +#define MAVLINK_MSG_ID_178_LEN 12 + + + +#define MAVLINK_MESSAGE_INFO_OBS_AIR_VELOCITY { \ + "OBS_AIR_VELOCITY", \ + 3, \ + { { "magnitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_air_velocity_t, magnitude) }, \ + { "aoa", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_obs_air_velocity_t, aoa) }, \ + { "slip", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_obs_air_velocity_t, slip) }, \ + } \ +} + + +/** + * @brief Pack a obs_air_velocity 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 magnitude Air speed + * @param aoa angle of attack + * @param slip slip angle + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_air_velocity_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + float magnitude, float aoa, float slip) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_float(buf, 0, magnitude); + _mav_put_float(buf, 4, aoa); + _mav_put_float(buf, 8, slip); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_air_velocity_t packet; + packet.magnitude = magnitude; + packet.aoa = aoa; + packet.slip = slip; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_AIR_VELOCITY; + return mavlink_finalize_message(msg, system_id, component_id, 12, 32); +} + +/** + * @brief Pack a obs_air_velocity 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param magnitude Air speed + * @param aoa angle of attack + * @param slip slip angle + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_air_velocity_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + float magnitude,float aoa,float slip) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_float(buf, 0, magnitude); + _mav_put_float(buf, 4, aoa); + _mav_put_float(buf, 8, slip); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_air_velocity_t packet; + packet.magnitude = magnitude; + packet.aoa = aoa; + packet.slip = slip; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_AIR_VELOCITY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 32); +} + +/** + * @brief Encode a obs_air_velocity struct into a 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 obs_air_velocity C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_air_velocity_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_air_velocity_t* obs_air_velocity) +{ + return mavlink_msg_obs_air_velocity_pack(system_id, component_id, msg, obs_air_velocity->magnitude, obs_air_velocity->aoa, obs_air_velocity->slip); +} + +/** + * @brief Send a obs_air_velocity message + * @param chan MAVLink channel to send the message + * + * @param magnitude Air speed + * @param aoa angle of attack + * @param slip slip angle + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_air_velocity_send(mavlink_channel_t chan, float magnitude, float aoa, float slip) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_float(buf, 0, magnitude); + _mav_put_float(buf, 4, aoa); + _mav_put_float(buf, 8, slip); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_VELOCITY, buf, 12, 32); +#else + mavlink_obs_air_velocity_t packet; + packet.magnitude = magnitude; + packet.aoa = aoa; + packet.slip = slip; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_VELOCITY, (const char *)&packet, 12, 32); +#endif +} + +#endif + +// MESSAGE OBS_AIR_VELOCITY UNPACKING + + +/** + * @brief Get field magnitude from obs_air_velocity message + * + * @return Air speed + */ +static inline float mavlink_msg_obs_air_velocity_get_magnitude(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Get field aoa from obs_air_velocity message + * + * @return angle of attack + */ +static inline float mavlink_msg_obs_air_velocity_get_aoa(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 4); +} + +/** + * @brief Get field slip from obs_air_velocity message + * + * @return slip angle + */ +static inline float mavlink_msg_obs_air_velocity_get_slip(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 8); +} + +/** + * @brief Decode a obs_air_velocity message into a struct + * + * @param msg The message to decode + * @param obs_air_velocity C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_air_velocity_decode(const mavlink_message_t* msg, mavlink_obs_air_velocity_t* obs_air_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP + obs_air_velocity->magnitude = mavlink_msg_obs_air_velocity_get_magnitude(msg); + obs_air_velocity->aoa = mavlink_msg_obs_air_velocity_get_aoa(msg); + obs_air_velocity->slip = mavlink_msg_obs_air_velocity_get_slip(msg); +#else + memcpy(obs_air_velocity, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_attitude.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_attitude.h new file mode 100644 index 0000000000..7a3e6d0ba4 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_attitude.h @@ -0,0 +1,144 @@ +// MESSAGE OBS_ATTITUDE PACKING + +#define MAVLINK_MSG_ID_OBS_ATTITUDE 174 + +typedef struct __mavlink_obs_attitude_t +{ + double quat[4]; ///< Quaternion re;im +} mavlink_obs_attitude_t; + +#define MAVLINK_MSG_ID_OBS_ATTITUDE_LEN 32 +#define MAVLINK_MSG_ID_174_LEN 32 + +#define MAVLINK_MSG_OBS_ATTITUDE_FIELD_QUAT_LEN 4 + +#define MAVLINK_MESSAGE_INFO_OBS_ATTITUDE { \ + "OBS_ATTITUDE", \ + 1, \ + { { "quat", NULL, MAVLINK_TYPE_DOUBLE, 4, 0, offsetof(mavlink_obs_attitude_t, quat) }, \ + } \ +} + + +/** + * @brief Pack a obs_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 quat Quaternion re;im + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const double *quat) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[32]; + + _mav_put_double_array(buf, 0, quat, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); +#else + mavlink_obs_attitude_t packet; + + mav_array_memcpy(packet.quat, quat, sizeof(double)*4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_ATTITUDE; + return mavlink_finalize_message(msg, system_id, component_id, 32, 146); +} + +/** + * @brief Pack a obs_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 was sent over + * @param msg The MAVLink message to compress the data into + * @param quat Quaternion re;im + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const double *quat) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[32]; + + _mav_put_double_array(buf, 0, quat, 4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); +#else + mavlink_obs_attitude_t packet; + + mav_array_memcpy(packet.quat, quat, sizeof(double)*4); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_ATTITUDE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 146); +} + +/** + * @brief Encode a obs_attitude struct into a 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 obs_attitude C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_attitude_t* obs_attitude) +{ + return mavlink_msg_obs_attitude_pack(system_id, component_id, msg, obs_attitude->quat); +} + +/** + * @brief Send a obs_attitude message + * @param chan MAVLink channel to send the message + * + * @param quat Quaternion re;im + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_attitude_send(mavlink_channel_t chan, const double *quat) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[32]; + + _mav_put_double_array(buf, 0, quat, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_ATTITUDE, buf, 32, 146); +#else + mavlink_obs_attitude_t packet; + + mav_array_memcpy(packet.quat, quat, sizeof(double)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_ATTITUDE, (const char *)&packet, 32, 146); +#endif +} + +#endif + +// MESSAGE OBS_ATTITUDE UNPACKING + + +/** + * @brief Get field quat from obs_attitude message + * + * @return Quaternion re;im + */ +static inline uint16_t mavlink_msg_obs_attitude_get_quat(const mavlink_message_t* msg, double *quat) +{ + return _MAV_RETURN_double_array(msg, quat, 4, 0); +} + +/** + * @brief Decode a obs_attitude message into a struct + * + * @param msg The message to decode + * @param obs_attitude C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_attitude_decode(const mavlink_message_t* msg, mavlink_obs_attitude_t* obs_attitude) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_obs_attitude_get_quat(msg, obs_attitude->quat); +#else + memcpy(obs_attitude, _MAV_PAYLOAD(msg), 32); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_bias.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_bias.h new file mode 100644 index 0000000000..565ab0cd86 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_bias.h @@ -0,0 +1,167 @@ +// MESSAGE OBS_BIAS PACKING + +#define MAVLINK_MSG_ID_OBS_BIAS 180 + +typedef struct __mavlink_obs_bias_t +{ + float accBias[3]; ///< accelerometer bias + float gyroBias[3]; ///< gyroscope bias +} mavlink_obs_bias_t; + +#define MAVLINK_MSG_ID_OBS_BIAS_LEN 24 +#define MAVLINK_MSG_ID_180_LEN 24 + +#define MAVLINK_MSG_OBS_BIAS_FIELD_ACCBIAS_LEN 3 +#define MAVLINK_MSG_OBS_BIAS_FIELD_GYROBIAS_LEN 3 + +#define MAVLINK_MESSAGE_INFO_OBS_BIAS { \ + "OBS_BIAS", \ + 2, \ + { { "accBias", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_bias_t, accBias) }, \ + { "gyroBias", NULL, MAVLINK_TYPE_FLOAT, 3, 12, offsetof(mavlink_obs_bias_t, gyroBias) }, \ + } \ +} + + +/** + * @brief Pack a obs_bias 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 accBias accelerometer bias + * @param gyroBias gyroscope bias + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_bias_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const float *accBias, const float *gyroBias) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[24]; + + _mav_put_float_array(buf, 0, accBias, 3); + _mav_put_float_array(buf, 12, gyroBias, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); +#else + mavlink_obs_bias_t packet; + + mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3); + mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_BIAS; + return mavlink_finalize_message(msg, system_id, component_id, 24, 159); +} + +/** + * @brief Pack a obs_bias 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param accBias accelerometer bias + * @param gyroBias gyroscope bias + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_bias_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const float *accBias,const float *gyroBias) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[24]; + + _mav_put_float_array(buf, 0, accBias, 3); + _mav_put_float_array(buf, 12, gyroBias, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24); +#else + mavlink_obs_bias_t packet; + + mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3); + mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_BIAS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24, 159); +} + +/** + * @brief Encode a obs_bias struct into a 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 obs_bias C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_bias_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_bias_t* obs_bias) +{ + return mavlink_msg_obs_bias_pack(system_id, component_id, msg, obs_bias->accBias, obs_bias->gyroBias); +} + +/** + * @brief Send a obs_bias message + * @param chan MAVLink channel to send the message + * + * @param accBias accelerometer bias + * @param gyroBias gyroscope bias + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_bias_send(mavlink_channel_t chan, const float *accBias, const float *gyroBias) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[24]; + + _mav_put_float_array(buf, 0, accBias, 3); + _mav_put_float_array(buf, 12, gyroBias, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_BIAS, buf, 24, 159); +#else + mavlink_obs_bias_t packet; + + mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3); + mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_BIAS, (const char *)&packet, 24, 159); +#endif +} + +#endif + +// MESSAGE OBS_BIAS UNPACKING + + +/** + * @brief Get field accBias from obs_bias message + * + * @return accelerometer bias + */ +static inline uint16_t mavlink_msg_obs_bias_get_accBias(const mavlink_message_t* msg, float *accBias) +{ + return _MAV_RETURN_float_array(msg, accBias, 3, 0); +} + +/** + * @brief Get field gyroBias from obs_bias message + * + * @return gyroscope bias + */ +static inline uint16_t mavlink_msg_obs_bias_get_gyroBias(const mavlink_message_t* msg, float *gyroBias) +{ + return _MAV_RETURN_float_array(msg, gyroBias, 3, 12); +} + +/** + * @brief Decode a obs_bias message into a struct + * + * @param msg The message to decode + * @param obs_bias C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_bias_decode(const mavlink_message_t* msg, mavlink_obs_bias_t* obs_bias) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_obs_bias_get_accBias(msg, obs_bias->accBias); + mavlink_msg_obs_bias_get_gyroBias(msg, obs_bias->gyroBias); +#else + memcpy(obs_bias, _MAV_PAYLOAD(msg), 24); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_position.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_position.h new file mode 100644 index 0000000000..e886c8c24f --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_position.h @@ -0,0 +1,188 @@ +// MESSAGE OBS_POSITION PACKING + +#define MAVLINK_MSG_ID_OBS_POSITION 170 + +typedef struct __mavlink_obs_position_t +{ + int32_t lon; ///< Longitude expressed in 1E7 + int32_t lat; ///< Latitude expressed in 1E7 + int32_t alt; ///< Altitude expressed in milimeters +} mavlink_obs_position_t; + +#define MAVLINK_MSG_ID_OBS_POSITION_LEN 12 +#define MAVLINK_MSG_ID_170_LEN 12 + + + +#define MAVLINK_MESSAGE_INFO_OBS_POSITION { \ + "OBS_POSITION", \ + 3, \ + { { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_obs_position_t, lon) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_obs_position_t, lat) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_obs_position_t, alt) }, \ + } \ +} + + +/** + * @brief Pack a obs_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 lon Longitude expressed in 1E7 + * @param lat Latitude expressed in 1E7 + * @param alt Altitude expressed in milimeters + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + int32_t lon, int32_t lat, int32_t alt) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_int32_t(buf, 0, lon); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, alt); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_position_t packet; + packet.lon = lon; + packet.lat = lat; + packet.alt = alt; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_POSITION; + return mavlink_finalize_message(msg, system_id, component_id, 12, 15); +} + +/** + * @brief Pack a obs_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 was sent over + * @param msg The MAVLink message to compress the data into + * @param lon Longitude expressed in 1E7 + * @param lat Latitude expressed in 1E7 + * @param alt Altitude expressed in milimeters + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + int32_t lon,int32_t lat,int32_t alt) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_int32_t(buf, 0, lon); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, alt); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_position_t packet; + packet.lon = lon; + packet.lat = lat; + packet.alt = alt; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_POSITION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 15); +} + +/** + * @brief Encode a obs_position struct into a 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 obs_position C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_position_t* obs_position) +{ + return mavlink_msg_obs_position_pack(system_id, component_id, msg, obs_position->lon, obs_position->lat, obs_position->alt); +} + +/** + * @brief Send a obs_position message + * @param chan MAVLink channel to send the message + * + * @param lon Longitude expressed in 1E7 + * @param lat Latitude expressed in 1E7 + * @param alt Altitude expressed in milimeters + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_position_send(mavlink_channel_t chan, int32_t lon, int32_t lat, int32_t alt) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + _mav_put_int32_t(buf, 0, lon); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, alt); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_POSITION, buf, 12, 15); +#else + mavlink_obs_position_t packet; + packet.lon = lon; + packet.lat = lat; + packet.alt = alt; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_POSITION, (const char *)&packet, 12, 15); +#endif +} + +#endif + +// MESSAGE OBS_POSITION UNPACKING + + +/** + * @brief Get field lon from obs_position message + * + * @return Longitude expressed in 1E7 + */ +static inline int32_t mavlink_msg_obs_position_get_lon(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int32_t(msg, 0); +} + +/** + * @brief Get field lat from obs_position message + * + * @return Latitude expressed in 1E7 + */ +static inline int32_t mavlink_msg_obs_position_get_lat(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int32_t(msg, 4); +} + +/** + * @brief Get field alt from obs_position message + * + * @return Altitude expressed in milimeters + */ +static inline int32_t mavlink_msg_obs_position_get_alt(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int32_t(msg, 8); +} + +/** + * @brief Decode a obs_position message into a struct + * + * @param msg The message to decode + * @param obs_position C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_position_decode(const mavlink_message_t* msg, mavlink_obs_position_t* obs_position) +{ +#if MAVLINK_NEED_BYTE_SWAP + obs_position->lon = mavlink_msg_obs_position_get_lon(msg); + obs_position->lat = mavlink_msg_obs_position_get_lat(msg); + obs_position->alt = mavlink_msg_obs_position_get_alt(msg); +#else + memcpy(obs_position, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_qff.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_qff.h new file mode 100644 index 0000000000..4ab10ca07c --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_qff.h @@ -0,0 +1,144 @@ +// MESSAGE OBS_QFF PACKING + +#define MAVLINK_MSG_ID_OBS_QFF 182 + +typedef struct __mavlink_obs_qff_t +{ + float qff; ///< Wind +} mavlink_obs_qff_t; + +#define MAVLINK_MSG_ID_OBS_QFF_LEN 4 +#define MAVLINK_MSG_ID_182_LEN 4 + + + +#define MAVLINK_MESSAGE_INFO_OBS_QFF { \ + "OBS_QFF", \ + 1, \ + { { "qff", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_qff_t, qff) }, \ + } \ +} + + +/** + * @brief Pack a obs_qff 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 qff Wind + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_qff_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + float qff) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, qff); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_obs_qff_t packet; + packet.qff = qff; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_QFF; + return mavlink_finalize_message(msg, system_id, component_id, 4, 24); +} + +/** + * @brief Pack a obs_qff 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param qff Wind + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_qff_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + float qff) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, qff); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_obs_qff_t packet; + packet.qff = qff; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_QFF; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 24); +} + +/** + * @brief Encode a obs_qff struct into a 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 obs_qff C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_qff_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_qff_t* obs_qff) +{ + return mavlink_msg_obs_qff_pack(system_id, component_id, msg, obs_qff->qff); +} + +/** + * @brief Send a obs_qff message + * @param chan MAVLink channel to send the message + * + * @param qff Wind + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_qff_send(mavlink_channel_t chan, float qff) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_float(buf, 0, qff); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_QFF, buf, 4, 24); +#else + mavlink_obs_qff_t packet; + packet.qff = qff; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_QFF, (const char *)&packet, 4, 24); +#endif +} + +#endif + +// MESSAGE OBS_QFF UNPACKING + + +/** + * @brief Get field qff from obs_qff message + * + * @return Wind + */ +static inline float mavlink_msg_obs_qff_get_qff(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Decode a obs_qff message into a struct + * + * @param msg The message to decode + * @param obs_qff C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_qff_decode(const mavlink_message_t* msg, mavlink_obs_qff_t* obs_qff) +{ +#if MAVLINK_NEED_BYTE_SWAP + obs_qff->qff = mavlink_msg_obs_qff_get_qff(msg); +#else + memcpy(obs_qff, _MAV_PAYLOAD(msg), 4); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_velocity.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_velocity.h new file mode 100644 index 0000000000..e5ace9f85e --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_velocity.h @@ -0,0 +1,144 @@ +// MESSAGE OBS_VELOCITY PACKING + +#define MAVLINK_MSG_ID_OBS_VELOCITY 172 + +typedef struct __mavlink_obs_velocity_t +{ + float vel[3]; ///< Velocity +} mavlink_obs_velocity_t; + +#define MAVLINK_MSG_ID_OBS_VELOCITY_LEN 12 +#define MAVLINK_MSG_ID_172_LEN 12 + +#define MAVLINK_MSG_OBS_VELOCITY_FIELD_VEL_LEN 3 + +#define MAVLINK_MESSAGE_INFO_OBS_VELOCITY { \ + "OBS_VELOCITY", \ + 1, \ + { { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_velocity_t, vel) }, \ + } \ +} + + +/** + * @brief Pack a obs_velocity 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 vel Velocity + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_velocity_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const float *vel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, vel, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_velocity_t packet; + + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_VELOCITY; + return mavlink_finalize_message(msg, system_id, component_id, 12, 108); +} + +/** + * @brief Pack a obs_velocity 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param vel Velocity + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_velocity_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const float *vel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, vel, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_velocity_t packet; + + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_VELOCITY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 108); +} + +/** + * @brief Encode a obs_velocity struct into a 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 obs_velocity C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_velocity_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_velocity_t* obs_velocity) +{ + return mavlink_msg_obs_velocity_pack(system_id, component_id, msg, obs_velocity->vel); +} + +/** + * @brief Send a obs_velocity message + * @param chan MAVLink channel to send the message + * + * @param vel Velocity + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_velocity_send(mavlink_channel_t chan, const float *vel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, vel, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_VELOCITY, buf, 12, 108); +#else + mavlink_obs_velocity_t packet; + + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_VELOCITY, (const char *)&packet, 12, 108); +#endif +} + +#endif + +// MESSAGE OBS_VELOCITY UNPACKING + + +/** + * @brief Get field vel from obs_velocity message + * + * @return Velocity + */ +static inline uint16_t mavlink_msg_obs_velocity_get_vel(const mavlink_message_t* msg, float *vel) +{ + return _MAV_RETURN_float_array(msg, vel, 3, 0); +} + +/** + * @brief Decode a obs_velocity message into a struct + * + * @param msg The message to decode + * @param obs_velocity C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_velocity_decode(const mavlink_message_t* msg, mavlink_obs_velocity_t* obs_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_obs_velocity_get_vel(msg, obs_velocity->vel); +#else + memcpy(obs_velocity, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_wind.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_wind.h new file mode 100644 index 0000000000..6011a1caad --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_obs_wind.h @@ -0,0 +1,144 @@ +// MESSAGE OBS_WIND PACKING + +#define MAVLINK_MSG_ID_OBS_WIND 176 + +typedef struct __mavlink_obs_wind_t +{ + float wind[3]; ///< Wind +} mavlink_obs_wind_t; + +#define MAVLINK_MSG_ID_OBS_WIND_LEN 12 +#define MAVLINK_MSG_ID_176_LEN 12 + +#define MAVLINK_MSG_OBS_WIND_FIELD_WIND_LEN 3 + +#define MAVLINK_MESSAGE_INFO_OBS_WIND { \ + "OBS_WIND", \ + 1, \ + { { "wind", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_wind_t, wind) }, \ + } \ +} + + +/** + * @brief Pack a obs_wind 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 wind Wind + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + const float *wind) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, wind, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_wind_t packet; + + mav_array_memcpy(packet.wind, wind, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_WIND; + return mavlink_finalize_message(msg, system_id, component_id, 12, 16); +} + +/** + * @brief Pack a obs_wind 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param wind Wind + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_obs_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + const float *wind) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, wind, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); +#else + mavlink_obs_wind_t packet; + + mav_array_memcpy(packet.wind, wind, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); +#endif + + msg->msgid = MAVLINK_MSG_ID_OBS_WIND; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 16); +} + +/** + * @brief Encode a obs_wind struct into a 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 obs_wind C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_obs_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_wind_t* obs_wind) +{ + return mavlink_msg_obs_wind_pack(system_id, component_id, msg, obs_wind->wind); +} + +/** + * @brief Send a obs_wind message + * @param chan MAVLink channel to send the message + * + * @param wind Wind + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_obs_wind_send(mavlink_channel_t chan, const float *wind) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[12]; + + _mav_put_float_array(buf, 0, wind, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_WIND, buf, 12, 16); +#else + mavlink_obs_wind_t packet; + + mav_array_memcpy(packet.wind, wind, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_WIND, (const char *)&packet, 12, 16); +#endif +} + +#endif + +// MESSAGE OBS_WIND UNPACKING + + +/** + * @brief Get field wind from obs_wind message + * + * @return Wind + */ +static inline uint16_t mavlink_msg_obs_wind_get_wind(const mavlink_message_t* msg, float *wind) +{ + return _MAV_RETURN_float_array(msg, wind, 3, 0); +} + +/** + * @brief Decode a obs_wind message into a struct + * + * @param msg The message to decode + * @param obs_wind C-struct to decode the message contents into + */ +static inline void mavlink_msg_obs_wind_decode(const mavlink_message_t* msg, mavlink_obs_wind_t* obs_wind) +{ +#if MAVLINK_NEED_BYTE_SWAP + mavlink_msg_obs_wind_get_wind(msg, obs_wind->wind); +#else + memcpy(obs_wind, _MAV_PAYLOAD(msg), 12); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_pm_elec.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_pm_elec.h new file mode 100644 index 0000000000..d194dae9bc --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_pm_elec.h @@ -0,0 +1,182 @@ +// MESSAGE PM_ELEC PACKING + +#define MAVLINK_MSG_ID_PM_ELEC 188 + +typedef struct __mavlink_pm_elec_t +{ + float PwCons; ///< current power consumption + float BatStat; ///< battery status + float PwGen[3]; ///< Power generation from each module +} mavlink_pm_elec_t; + +#define MAVLINK_MSG_ID_PM_ELEC_LEN 20 +#define MAVLINK_MSG_ID_188_LEN 20 + +#define MAVLINK_MSG_PM_ELEC_FIELD_PWGEN_LEN 3 + +#define MAVLINK_MESSAGE_INFO_PM_ELEC { \ + "PM_ELEC", \ + 3, \ + { { "PwCons", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_pm_elec_t, PwCons) }, \ + { "BatStat", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_pm_elec_t, BatStat) }, \ + { "PwGen", NULL, MAVLINK_TYPE_FLOAT, 3, 8, offsetof(mavlink_pm_elec_t, PwGen) }, \ + } \ +} + + +/** + * @brief Pack a pm_elec 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 PwCons current power consumption + * @param BatStat battery status + * @param PwGen Power generation from each module + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_pm_elec_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + float PwCons, float BatStat, const float *PwGen) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[20]; + _mav_put_float(buf, 0, PwCons); + _mav_put_float(buf, 4, BatStat); + _mav_put_float_array(buf, 8, PwGen, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); +#else + mavlink_pm_elec_t packet; + packet.PwCons = PwCons; + packet.BatStat = BatStat; + mav_array_memcpy(packet.PwGen, PwGen, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); +#endif + + msg->msgid = MAVLINK_MSG_ID_PM_ELEC; + return mavlink_finalize_message(msg, system_id, component_id, 20, 170); +} + +/** + * @brief Pack a pm_elec 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param PwCons current power consumption + * @param BatStat battery status + * @param PwGen Power generation from each module + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_pm_elec_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + float PwCons,float BatStat,const float *PwGen) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[20]; + _mav_put_float(buf, 0, PwCons); + _mav_put_float(buf, 4, BatStat); + _mav_put_float_array(buf, 8, PwGen, 3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); +#else + mavlink_pm_elec_t packet; + packet.PwCons = PwCons; + packet.BatStat = BatStat; + mav_array_memcpy(packet.PwGen, PwGen, sizeof(float)*3); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); +#endif + + msg->msgid = MAVLINK_MSG_ID_PM_ELEC; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 170); +} + +/** + * @brief Encode a pm_elec struct into a 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 pm_elec C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_pm_elec_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pm_elec_t* pm_elec) +{ + return mavlink_msg_pm_elec_pack(system_id, component_id, msg, pm_elec->PwCons, pm_elec->BatStat, pm_elec->PwGen); +} + +/** + * @brief Send a pm_elec message + * @param chan MAVLink channel to send the message + * + * @param PwCons current power consumption + * @param BatStat battery status + * @param PwGen Power generation from each module + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_pm_elec_send(mavlink_channel_t chan, float PwCons, float BatStat, const float *PwGen) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[20]; + _mav_put_float(buf, 0, PwCons); + _mav_put_float(buf, 4, BatStat); + _mav_put_float_array(buf, 8, PwGen, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PM_ELEC, buf, 20, 170); +#else + mavlink_pm_elec_t packet; + packet.PwCons = PwCons; + packet.BatStat = BatStat; + mav_array_memcpy(packet.PwGen, PwGen, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PM_ELEC, (const char *)&packet, 20, 170); +#endif +} + +#endif + +// MESSAGE PM_ELEC UNPACKING + + +/** + * @brief Get field PwCons from pm_elec message + * + * @return current power consumption + */ +static inline float mavlink_msg_pm_elec_get_PwCons(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Get field BatStat from pm_elec message + * + * @return battery status + */ +static inline float mavlink_msg_pm_elec_get_BatStat(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 4); +} + +/** + * @brief Get field PwGen from pm_elec message + * + * @return Power generation from each module + */ +static inline uint16_t mavlink_msg_pm_elec_get_PwGen(const mavlink_message_t* msg, float *PwGen) +{ + return _MAV_RETURN_float_array(msg, PwGen, 3, 8); +} + +/** + * @brief Decode a pm_elec message into a struct + * + * @param msg The message to decode + * @param pm_elec C-struct to decode the message contents into + */ +static inline void mavlink_msg_pm_elec_decode(const mavlink_message_t* msg, mavlink_pm_elec_t* pm_elec) +{ +#if MAVLINK_NEED_BYTE_SWAP + pm_elec->PwCons = mavlink_msg_pm_elec_get_PwCons(msg); + pm_elec->BatStat = mavlink_msg_pm_elec_get_BatStat(msg); + mavlink_msg_pm_elec_get_PwGen(msg, pm_elec->PwGen); +#else + memcpy(pm_elec, _MAV_PAYLOAD(msg), 20); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_sys_stat.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_sys_stat.h new file mode 100644 index 0000000000..597fdf911f --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/mavlink_msg_sys_stat.h @@ -0,0 +1,210 @@ +// MESSAGE SYS_Stat PACKING + +#define MAVLINK_MSG_ID_SYS_Stat 190 + +typedef struct __mavlink_sys_stat_t +{ + uint8_t gps; ///< gps status + uint8_t act; ///< actuator status + uint8_t mod; ///< module status + uint8_t commRssi; ///< module status +} mavlink_sys_stat_t; + +#define MAVLINK_MSG_ID_SYS_Stat_LEN 4 +#define MAVLINK_MSG_ID_190_LEN 4 + + + +#define MAVLINK_MESSAGE_INFO_SYS_Stat { \ + "SYS_Stat", \ + 4, \ + { { "gps", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_sys_stat_t, gps) }, \ + { "act", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_sys_stat_t, act) }, \ + { "mod", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_sys_stat_t, mod) }, \ + { "commRssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_sys_stat_t, commRssi) }, \ + } \ +} + + +/** + * @brief Pack a sys_stat 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 gps gps status + * @param act actuator status + * @param mod module status + * @param commRssi module status + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_sys_stat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t gps, uint8_t act, uint8_t mod, uint8_t commRssi) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_uint8_t(buf, 0, gps); + _mav_put_uint8_t(buf, 1, act); + _mav_put_uint8_t(buf, 2, mod); + _mav_put_uint8_t(buf, 3, commRssi); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_sys_stat_t packet; + packet.gps = gps; + packet.act = act; + packet.mod = mod; + packet.commRssi = commRssi; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_SYS_Stat; + return mavlink_finalize_message(msg, system_id, component_id, 4, 157); +} + +/** + * @brief Pack a sys_stat 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 was sent over + * @param msg The MAVLink message to compress the data into + * @param gps gps status + * @param act actuator status + * @param mod module status + * @param commRssi module status + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_sys_stat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t gps,uint8_t act,uint8_t mod,uint8_t commRssi) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_uint8_t(buf, 0, gps); + _mav_put_uint8_t(buf, 1, act); + _mav_put_uint8_t(buf, 2, mod); + _mav_put_uint8_t(buf, 3, commRssi); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); +#else + mavlink_sys_stat_t packet; + packet.gps = gps; + packet.act = act; + packet.mod = mod; + packet.commRssi = commRssi; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); +#endif + + msg->msgid = MAVLINK_MSG_ID_SYS_Stat; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 157); +} + +/** + * @brief Encode a sys_stat struct into a 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 sys_stat C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_sys_stat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sys_stat_t* sys_stat) +{ + return mavlink_msg_sys_stat_pack(system_id, component_id, msg, sys_stat->gps, sys_stat->act, sys_stat->mod, sys_stat->commRssi); +} + +/** + * @brief Send a sys_stat message + * @param chan MAVLink channel to send the message + * + * @param gps gps status + * @param act actuator status + * @param mod module status + * @param commRssi module status + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_sys_stat_send(mavlink_channel_t chan, uint8_t gps, uint8_t act, uint8_t mod, uint8_t commRssi) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[4]; + _mav_put_uint8_t(buf, 0, gps); + _mav_put_uint8_t(buf, 1, act); + _mav_put_uint8_t(buf, 2, mod); + _mav_put_uint8_t(buf, 3, commRssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_Stat, buf, 4, 157); +#else + mavlink_sys_stat_t packet; + packet.gps = gps; + packet.act = act; + packet.mod = mod; + packet.commRssi = commRssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_Stat, (const char *)&packet, 4, 157); +#endif +} + +#endif + +// MESSAGE SYS_Stat UNPACKING + + +/** + * @brief Get field gps from sys_stat message + * + * @return gps status + */ +static inline uint8_t mavlink_msg_sys_stat_get_gps(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field act from sys_stat message + * + * @return actuator status + */ +static inline uint8_t mavlink_msg_sys_stat_get_act(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 1); +} + +/** + * @brief Get field mod from sys_stat message + * + * @return module status + */ +static inline uint8_t mavlink_msg_sys_stat_get_mod(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 2); +} + +/** + * @brief Get field commRssi from sys_stat message + * + * @return module status + */ +static inline uint8_t mavlink_msg_sys_stat_get_commRssi(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 3); +} + +/** + * @brief Decode a sys_stat message into a struct + * + * @param msg The message to decode + * @param sys_stat C-struct to decode the message contents into + */ +static inline void mavlink_msg_sys_stat_decode(const mavlink_message_t* msg, mavlink_sys_stat_t* sys_stat) +{ +#if MAVLINK_NEED_BYTE_SWAP + sys_stat->gps = mavlink_msg_sys_stat_get_gps(msg); + sys_stat->act = mavlink_msg_sys_stat_get_act(msg); + sys_stat->mod = mavlink_msg_sys_stat_get_mod(msg); + sys_stat->commRssi = mavlink_msg_sys_stat_get_commRssi(msg); +#else + memcpy(sys_stat, _MAV_PAYLOAD(msg), 4); +#endif +} diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/sensesoar.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/sensesoar.h new file mode 100644 index 0000000000..5a6022d59f --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/sensesoar.h @@ -0,0 +1,77 @@ +/** @file + * @brief MAVLink comm protocol generated from sensesoar.xml + * @see http://qgroundcontrol.org/mavlink/ + */ +#ifndef SENSESOAR_H +#define SENSESOAR_H + +#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, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 54, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 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, 12, 0, 12, 0, 32, 0, 12, 0, 12, 0, 24, 0, 4, 4, 12, 0, 12, 0, 20, 0, 4, 0, 5, 0, 5, 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, 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, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 200, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 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, 15, 0, 108, 0, 146, 0, 16, 0, 32, 0, 159, 0, 24, 248, 79, 0, 5, 0, 170, 0, 157, 0, 209, 0, 243, 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, 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_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT, MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, 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}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VFR_HUD, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, 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}}}, {"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_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, {"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_OBS_POSITION, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_VELOCITY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_ATTITUDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_WIND, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_AIR_VELOCITY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_BIAS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OBS_QFF, MAVLINK_MESSAGE_INFO_OBS_AIR_TEMP, MAVLINK_MESSAGE_INFO_FILT_ROT_VEL, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LLC_OUT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PM_ELEC, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SYS_Stat, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_CHNG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_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}}}, {"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_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_SENSESOAR + +#include "../common/common.h" + +// MAVLINK VERSION + +#ifndef MAVLINK_VERSION +#define MAVLINK_VERSION 2 +#endif + +#if (MAVLINK_VERSION == 0) +#undef MAVLINK_VERSION +#define MAVLINK_VERSION 2 +#endif + +// ENUM DEFINITIONS + + +/** @brief Different flight modes */ +#ifndef HAVE_ENUM_SENSESOAR_MODE +#define HAVE_ENUM_SENSESOAR_MODE +enum SENSESOAR_MODE +{ + SENSESOAR_MODE_GLIDING=1, /* | */ + SENSESOAR_MODE_AUTONOMOUS=2, /* | */ + SENSESOAR_MODE_MANUAL=3, /* | */ + SENSESOAR_MODE_ENUM_END=4, /* | */ +}; +#endif + +// MESSAGE DEFINITIONS +#include "./mavlink_msg_obs_position.h" +#include "./mavlink_msg_obs_velocity.h" +#include "./mavlink_msg_obs_attitude.h" +#include "./mavlink_msg_obs_wind.h" +#include "./mavlink_msg_obs_air_velocity.h" +#include "./mavlink_msg_obs_bias.h" +#include "./mavlink_msg_obs_qff.h" +#include "./mavlink_msg_obs_air_temp.h" +#include "./mavlink_msg_filt_rot_vel.h" +#include "./mavlink_msg_llc_out.h" +#include "./mavlink_msg_pm_elec.h" +#include "./mavlink_msg_sys_stat.h" +#include "./mavlink_msg_cmd_airspeed_chng.h" +#include "./mavlink_msg_cmd_airspeed_ack.h" + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // SENSESOAR_H diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/testsuite.h new file mode 100644 index 0000000000..4c8f73c5b7 --- /dev/null +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/sensesoar/testsuite.h @@ -0,0 +1,676 @@ +/** @file + * @brief MAVLink comm protocol testsuite generated from sensesoar.xml + * @see http://qgroundcontrol.org/mavlink/ + */ +#ifndef SENSESOAR_TESTSUITE_H +#define SENSESOAR_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_sensesoar(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); + mavlink_test_sensesoar(system_id, component_id, last_msg); +} +#endif + +#include "../common/testsuite.h" + + +static void mavlink_test_obs_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +{ + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_obs_position_t packet_in = { + 963497464, + 963497672, + 963497880, + }; + mavlink_obs_position_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.lon = packet_in.lon; + packet1.lat = packet_in.lat; + packet1.alt = packet_in.alt; + + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_obs_position_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_obs_position_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_obs_position_pack(system_id, component_id, &msg , packet1.lon , packet1.lat , packet1.alt ); + mavlink_msg_obs_position_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_obs_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lon , packet1.lat , packet1.alt ); + mavlink_msg_obs_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; imsgid = MAVLINK_MSG_ID_DCM; - return mavlink_finalize_message(msg, system_id, component_id, 28, 205); -} - -/** - * @brief Pack a dcm 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param omegaIx X gyro drift estimate rad/s - * @param omegaIy Y gyro drift estimate rad/s - * @param omegaIz Z gyro drift estimate rad/s - * @param accel_weight average accel_weight - * @param renorm_val average renormalisation value - * @param error_rp average error_roll_pitch value - * @param error_yaw average error_yaw value - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_float(buf, 0, omegaIx); - _mav_put_float(buf, 4, omegaIy); - _mav_put_float(buf, 8, omegaIz); - _mav_put_float(buf, 12, accel_weight); - _mav_put_float(buf, 16, renorm_val); - _mav_put_float(buf, 20, error_rp); - _mav_put_float(buf, 24, error_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 28); -#else - mavlink_dcm_t packet; - packet.omegaIx = omegaIx; - packet.omegaIy = omegaIy; - packet.omegaIz = omegaIz; - packet.accel_weight = accel_weight; - packet.renorm_val = renorm_val; - packet.error_rp = error_rp; - packet.error_yaw = error_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 28); -#endif - - msg->msgid = MAVLINK_MSG_ID_DCM; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 205); -} - -/** - * @brief Encode a dcm struct into a 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 dcm C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_dcm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_dcm_t* dcm) -{ - return mavlink_msg_dcm_pack(system_id, component_id, msg, dcm->omegaIx, dcm->omegaIy, dcm->omegaIz, dcm->accel_weight, dcm->renorm_val, dcm->error_rp, dcm->error_yaw); -} - -/** - * @brief Send a dcm message - * @param chan MAVLink channel to send the message - * - * @param omegaIx X gyro drift estimate rad/s - * @param omegaIy Y gyro drift estimate rad/s - * @param omegaIz Z gyro drift estimate rad/s - * @param accel_weight average accel_weight - * @param renorm_val average renormalisation value - * @param error_rp average error_roll_pitch value - * @param error_yaw average error_yaw value - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[28]; - _mav_put_float(buf, 0, omegaIx); - _mav_put_float(buf, 4, omegaIy); - _mav_put_float(buf, 8, omegaIz); - _mav_put_float(buf, 12, accel_weight); - _mav_put_float(buf, 16, renorm_val); - _mav_put_float(buf, 20, error_rp); - _mav_put_float(buf, 24, error_yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DCM, buf, 28, 205); -#else - mavlink_dcm_t packet; - packet.omegaIx = omegaIx; - packet.omegaIy = omegaIy; - packet.omegaIz = omegaIz; - packet.accel_weight = accel_weight; - packet.renorm_val = renorm_val; - packet.error_rp = error_rp; - packet.error_yaw = error_yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DCM, (const char *)&packet, 28, 205); -#endif -} - -#endif - -// MESSAGE DCM UNPACKING - - -/** - * @brief Get field omegaIx from dcm message - * - * @return X gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field omegaIy from dcm message - * - * @return Y gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field omegaIz from dcm message - * - * @return Z gyro drift estimate rad/s - */ -static inline float mavlink_msg_dcm_get_omegaIz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field accel_weight from dcm message - * - * @return average accel_weight - */ -static inline float mavlink_msg_dcm_get_accel_weight(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field renorm_val from dcm message - * - * @return average renormalisation value - */ -static inline float mavlink_msg_dcm_get_renorm_val(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field error_rp from dcm message - * - * @return average error_roll_pitch value - */ -static inline float mavlink_msg_dcm_get_error_rp(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field error_yaw from dcm message - * - * @return average error_yaw value - */ -static inline float mavlink_msg_dcm_get_error_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Decode a dcm message into a struct - * - * @param msg The message to decode - * @param dcm C-struct to decode the message contents into - */ -static inline void mavlink_msg_dcm_decode(const mavlink_message_t* msg, mavlink_dcm_t* dcm) -{ -#if MAVLINK_NEED_BYTE_SWAP - dcm->omegaIx = mavlink_msg_dcm_get_omegaIx(msg); - dcm->omegaIy = mavlink_msg_dcm_get_omegaIy(msg); - dcm->omegaIz = mavlink_msg_dcm_get_omegaIz(msg); - dcm->accel_weight = mavlink_msg_dcm_get_accel_weight(msg); - dcm->renorm_val = mavlink_msg_dcm_get_renorm_val(msg); - dcm->error_rp = mavlink_msg_dcm_get_error_rp(msg); - dcm->error_yaw = mavlink_msg_dcm_get_error_yaw(msg); -#else - memcpy(dcm, _MAV_PAYLOAD(msg), 28); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_fetch_point.h b/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_fetch_point.h deleted file mode 100644 index 2710ff4a9a..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_fetch_point.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE FENCED_FETCH_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT 161 - -typedef struct __mavlink_fenced_fetch_point_t -{ - uint8_t idx; ///< point index (first point is 1, 0 is for return point) -} mavlink_fenced_fetch_point_t; - -#define MAVLINK_MSG_ID_FENCED_FETCH_POINT_LEN 1 -#define MAVLINK_MSG_ID_161_LEN 1 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_FETCH_POINT { \ - "FENCED_FETCH_POINT", \ - 1, \ - { { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fenced_fetch_point_t, idx) }, \ - } \ -} - - -/** - * @brief Pack a fenced_fetch_point 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 idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 1, 33); -} - -/** - * @brief Pack a fenced_fetch_point 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - memcpy(_MAV_PAYLOAD(msg), buf, 1); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - memcpy(_MAV_PAYLOAD(msg), &packet, 1); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_FETCH_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 1, 33); -} - -/** - * @brief Encode a fenced_fetch_point struct into a 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 fenced_fetch_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ - return mavlink_msg_fenced_fetch_point_pack(system_id, component_id, msg, fenced_fetch_point->idx); -} - -/** - * @brief Send a fenced_fetch_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_fetch_point_send(mavlink_channel_t chan, uint8_t idx) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[1]; - _mav_put_uint8_t(buf, 0, idx); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, buf, 1, 33); -#else - mavlink_fenced_fetch_point_t packet; - packet.idx = idx; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_FETCH_POINT, (const char *)&packet, 1, 33); -#endif -} - -#endif - -// MESSAGE FENCED_FETCH_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_fetch_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_fetch_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Decode a fenced_fetch_point message into a struct - * - * @param msg The message to decode - * @param fenced_fetch_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_fetch_point_decode(const mavlink_message_t* msg, mavlink_fenced_fetch_point_t* fenced_fetch_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_fetch_point->idx = mavlink_msg_fenced_fetch_point_get_idx(msg); -#else - memcpy(fenced_fetch_point, _MAV_PAYLOAD(msg), 1); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_point.h b/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_point.h deleted file mode 100644 index 46cf41fe00..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/ardupilotmega/mavlink_msg_fenced_point.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE FENCED_POINT PACKING - -#define MAVLINK_MSG_ID_FENCED_POINT 160 - -typedef struct __mavlink_fenced_point_t -{ - float lat; ///< Latitude of point - float lng; ///< Longitude of point - uint8_t idx; ///< point index (first point is 1, 0 is for return point) - uint8_t count; ///< total number of points (for sanity checking) -} mavlink_fenced_point_t; - -#define MAVLINK_MSG_ID_FENCED_POINT_LEN 10 -#define MAVLINK_MSG_ID_160_LEN 10 - - - -#define MAVLINK_MESSAGE_INFO_FENCED_POINT { \ - "FENCED_POINT", \ - 4, \ - { { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_fenced_point_t, lat) }, \ - { "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fenced_point_t, lng) }, \ - { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fenced_point_t, idx) }, \ - { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fenced_point_t, count) }, \ - } \ -} - - -/** - * @brief Pack a fenced_point 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 idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_float(buf, 0, lat); - _mav_put_float(buf, 4, lng); - _mav_put_uint8_t(buf, 8, idx); - _mav_put_uint8_t(buf, 9, count); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.lat = lat; - packet.lng = lng; - packet.idx = idx; - packet.count = count; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message(msg, system_id, component_id, 10, 225); -} - -/** - * @brief Pack a fenced_point 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_fenced_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t idx,uint8_t count,float lat,float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_float(buf, 0, lat); - _mav_put_float(buf, 4, lng); - _mav_put_uint8_t(buf, 8, idx); - _mav_put_uint8_t(buf, 9, count); - - memcpy(_MAV_PAYLOAD(msg), buf, 10); -#else - mavlink_fenced_point_t packet; - packet.lat = lat; - packet.lng = lng; - packet.idx = idx; - packet.count = count; - - memcpy(_MAV_PAYLOAD(msg), &packet, 10); -#endif - - msg->msgid = MAVLINK_MSG_ID_FENCED_POINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 10, 225); -} - -/** - * @brief Encode a fenced_point struct into a 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 fenced_point C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_fenced_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fenced_point_t* fenced_point) -{ - return mavlink_msg_fenced_point_pack(system_id, component_id, msg, fenced_point->idx, fenced_point->count, fenced_point->lat, fenced_point->lng); -} - -/** - * @brief Send a fenced_point message - * @param chan MAVLink channel to send the message - * - * @param idx point index (first point is 1, 0 is for return point) - * @param count total number of points (for sanity checking) - * @param lat Latitude of point - * @param lng Longitude of point - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_fenced_point_send(mavlink_channel_t chan, uint8_t idx, uint8_t count, float lat, float lng) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[10]; - _mav_put_float(buf, 0, lat); - _mav_put_float(buf, 4, lng); - _mav_put_uint8_t(buf, 8, idx); - _mav_put_uint8_t(buf, 9, count); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, buf, 10, 225); -#else - mavlink_fenced_point_t packet; - packet.lat = lat; - packet.lng = lng; - packet.idx = idx; - packet.count = count; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCED_POINT, (const char *)&packet, 10, 225); -#endif -} - -#endif - -// MESSAGE FENCED_POINT UNPACKING - - -/** - * @brief Get field idx from fenced_point message - * - * @return point index (first point is 1, 0 is for return point) - */ -static inline uint8_t mavlink_msg_fenced_point_get_idx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 8); -} - -/** - * @brief Get field count from fenced_point message - * - * @return total number of points (for sanity checking) - */ -static inline uint8_t mavlink_msg_fenced_point_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 9); -} - -/** - * @brief Get field lat from fenced_point message - * - * @return Latitude of point - */ -static inline float mavlink_msg_fenced_point_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field lng from fenced_point message - * - * @return Longitude of point - */ -static inline float mavlink_msg_fenced_point_get_lng(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Decode a fenced_point message into a struct - * - * @param msg The message to decode - * @param fenced_point C-struct to decode the message contents into - */ -static inline void mavlink_msg_fenced_point_decode(const mavlink_message_t* msg, mavlink_fenced_point_t* fenced_point) -{ -#if MAVLINK_NEED_BYTE_SWAP - fenced_point->lat = mavlink_msg_fenced_point_get_lat(msg); - fenced_point->lng = mavlink_msg_fenced_point_get_lng(msg); - fenced_point->idx = mavlink_msg_fenced_point_get_idx(msg); - fenced_point->count = mavlink_msg_fenced_point_get_count(msg); -#else - memcpy(fenced_point, _MAV_PAYLOAD(msg), 10); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/common.h b/libraries/GCS_MAVLink/include_v1.0/common/common.h deleted file mode 100644 index e4b681c56c..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/common.h +++ /dev/null @@ -1,429 +0,0 @@ -/** @file - * @brief MAVLink comm protocol generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef COMMON_H -#define COMMON_H - -#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, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 32, 32, 20, 32, 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, 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, 36, 30, 18, 18, 51, 9, 3} -#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, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 102, 158, 208, 56, 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, 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, 204, 49, 170, 44, 83, 46, 247} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, {NULL}, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, 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, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE} -#endif - -#include "../protocol.h" - -#define MAVLINK_ENABLED_COMMON - - - -// MAVLINK VERSION - -#ifndef MAVLINK_VERSION -#define MAVLINK_VERSION 3 -#endif - -#if (MAVLINK_VERSION == 0) -#undef MAVLINK_VERSION -#define MAVLINK_VERSION 3 -#endif - -// ENUM DEFINITIONS - - -/** @brief Micro air vehicle / autopilot classes. This identifies the individual model. */ -#ifndef HAVE_ENUM_MAV_AUTOPILOT -#define HAVE_ENUM_MAV_AUTOPILOT -enum MAV_AUTOPILOT -{ - MAV_AUTOPILOT_GENERIC=0, /* Generic autopilot, full support for everything | */ - MAV_AUTOPILOT_PIXHAWK=1, /* PIXHAWK autopilot, http://pixhawk.ethz.ch | */ - 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_ENUM_END=12, /* | */ -}; -#endif - -/** @brief These flags encode the MAV mode. */ -#ifndef HAVE_ENUM_MAV_MODE_FLAG -#define HAVE_ENUM_MAV_MODE_FLAG -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, /* | */ -}; -#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 -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, /* | */ -}; -#endif - -/** @brief Override command, pauses current mission execution and moves immediately to a position */ -#ifndef HAVE_ENUM_MAV_GOTO -#define HAVE_ENUM_MAV_GOTO -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, /* | */ -}; -#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 -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, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAV_STATE -#define HAVE_ENUM_MAV_STATE -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, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAV_TYPE -#define HAVE_ENUM_MAV_TYPE -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_ENUM_END=17, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAV_COMPONENT -#define HAVE_ENUM_MAV_COMPONENT -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_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, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAV_FRAME -#define HAVE_ENUM_MAV_FRAME -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_ENUM_END=5, /* | */ -}; -#endif - -/** @brief */ -#ifndef HAVE_ENUM_MAVLINK_DATA_STREAM_TYPE -#define HAVE_ENUM_MAVLINK_DATA_STREAM_TYPE -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, /* | */ -}; -#endif - -/** @brief Data stream IDs. 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 -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, /* | */ -}; -#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 -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, /* | */ -}; -#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 -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, /* | */ -}; -#endif - -/** @brief type of a mavlink parameter */ -#ifndef HAVE_ENUM_MAV_VAR -#define HAVE_ENUM_MAV_VAR -enum MAV_VAR -{ - MAV_VAR_FLOAT=0, /* 32 bit float | */ - MAV_VAR_UINT8=1, /* 8 bit unsigned integer | */ - MAV_VAR_INT8=2, /* 8 bit signed integer | */ - MAV_VAR_UINT16=3, /* 16 bit unsigned integer | */ - MAV_VAR_INT16=4, /* 16 bit signed integer | */ - MAV_VAR_UINT32=5, /* 32 bit unsigned integer | */ - MAV_VAR_INT32=6, /* 32 bit signed integer | */ - MAV_VAR_ENUM_END=7, /* | */ -}; -#endif - -/** @brief result from a mavlink command */ -#ifndef HAVE_ENUM_MAV_RESULT -#define HAVE_ENUM_MAV_RESULT -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, /* | */ -}; -#endif - -/** @brief result in a mavlink mission ack */ -#ifndef HAVE_ENUM_MAV_MISSION_RESULT -#define HAVE_ENUM_MAV_MISSION_RESULT -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, /* | */ -}; -#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_set_local_position_setpoint.h" -#include "./mavlink_msg_local_position_setpoint.h" -#include "./mavlink_msg_global_position_setpoint_int.h" -#include "./mavlink_msg_set_global_position_setpoint_int.h" -#include "./mavlink_msg_safety_set_allowed_area.h" -#include "./mavlink_msg_safety_allowed_area.h" -#include "./mavlink_msg_set_roll_pitch_yaw_thrust.h" -#include "./mavlink_msg_set_roll_pitch_yaw_speed_thrust.h" -#include "./mavlink_msg_roll_pitch_yaw_thrust_setpoint.h" -#include "./mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint.h" -#include "./mavlink_msg_nav_controller_output.h" -#include "./mavlink_msg_state_correction.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_vfr_hud.h" -#include "./mavlink_msg_command_long.h" -#include "./mavlink_msg_command_ack.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_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" -#include "./mavlink_msg_extended_message.h" - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // COMMON_H diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action.h deleted file mode 100644 index b34fbb3423..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE ACTION PACKING - -#define MAVLINK_MSG_ID_ACTION 10 - -typedef struct __mavlink_action_t -{ - uint8_t target; ///< The system executing the action - uint8_t target_component; ///< The component executing the action - uint8_t action; ///< The action id -} mavlink_action_t; - -#define MAVLINK_MSG_ID_ACTION_LEN 3 -#define MAVLINK_MSG_ID_10_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_ACTION { \ - "ACTION", \ - 3, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_action_t, target) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_action_t, target_component) }, \ - { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_action_t, action) }, \ - } \ -} - - -/** - * @brief Pack a action 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 executing the action - * @param target_component The component executing the action - * @param action The action id - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint8_t target_component, uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION; - return mavlink_finalize_message(msg, system_id, component_id, 3, 60); -} - -/** - * @brief Pack a action 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system executing the action - * @param target_component The component executing the action - * @param action The action id - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint8_t target_component,uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 60); -} - -/** - * @brief Encode a action struct into a 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 action C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_action_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_action_t* action) -{ - return mavlink_msg_action_pack(system_id, component_id, msg, action->target, action->target_component, action->action); -} - -/** - * @brief Send a action message - * @param chan MAVLink channel to send the message - * - * @param target The system executing the action - * @param target_component The component executing the action - * @param action The action id - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_action_send(mavlink_channel_t chan, uint8_t target, uint8_t target_component, uint8_t action) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, action); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, buf, 3, 60); -#else - mavlink_action_t packet; - packet.target = target; - packet.target_component = target_component; - packet.action = action; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, (const char *)&packet, 3, 60); -#endif -} - -#endif - -// MESSAGE ACTION UNPACKING - - -/** - * @brief Get field target from action message - * - * @return The system executing the action - */ -static inline uint8_t mavlink_msg_action_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from action message - * - * @return The component executing the action - */ -static inline uint8_t mavlink_msg_action_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field action from action message - * - * @return The action id - */ -static inline uint8_t mavlink_msg_action_get_action(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a action message into a struct - * - * @param msg The message to decode - * @param action C-struct to decode the message contents into - */ -static inline void mavlink_msg_action_decode(const mavlink_message_t* msg, mavlink_action_t* action) -{ -#if MAVLINK_NEED_BYTE_SWAP - action->target = mavlink_msg_action_get_target(msg); - action->target_component = mavlink_msg_action_get_target_component(msg); - action->action = mavlink_msg_action_get_action(msg); -#else - memcpy(action, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action_ack.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action_ack.h deleted file mode 100644 index f5da3cb064..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_action_ack.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE ACTION_ACK PACKING - -#define MAVLINK_MSG_ID_ACTION_ACK 9 - -typedef struct __mavlink_action_ack_t -{ - uint8_t action; ///< The action id - uint8_t result; ///< 0: Action DENIED, 1: Action executed -} mavlink_action_ack_t; - -#define MAVLINK_MSG_ID_ACTION_ACK_LEN 2 -#define MAVLINK_MSG_ID_9_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_ACTION_ACK { \ - "ACTION_ACK", \ - 2, \ - { { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_action_ack_t, action) }, \ - { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_action_ack_t, result) }, \ - } \ -} - - -/** - * @brief Pack a action_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 action The action id - * @param result 0: Action DENIED, 1: Action executed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t action, uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 2, 219); -} - -/** - * @brief Pack a action_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param action The action id - * @param result 0: Action DENIED, 1: Action executed - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_action_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t action,uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_ACTION_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 219); -} - -/** - * @brief Encode a action_ack struct into a 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 action_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_action_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_action_ack_t* action_ack) -{ - return mavlink_msg_action_ack_pack(system_id, component_id, msg, action_ack->action, action_ack->result); -} - -/** - * @brief Send a action_ack message - * @param chan MAVLink channel to send the message - * - * @param action The action id - * @param result 0: Action DENIED, 1: Action executed - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_action_ack_send(mavlink_channel_t chan, uint8_t action, uint8_t result) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, action); - _mav_put_uint8_t(buf, 1, result); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION_ACK, buf, 2, 219); -#else - mavlink_action_ack_t packet; - packet.action = action; - packet.result = result; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION_ACK, (const char *)&packet, 2, 219); -#endif -} - -#endif - -// MESSAGE ACTION_ACK UNPACKING - - -/** - * @brief Get field action from action_ack message - * - * @return The action id - */ -static inline uint8_t mavlink_msg_action_ack_get_action(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field result from action_ack message - * - * @return 0: Action DENIED, 1: Action executed - */ -static inline uint8_t mavlink_msg_action_ack_get_result(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a action_ack message into a struct - * - * @param msg The message to decode - * @param action_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_action_ack_decode(const mavlink_message_t* msg, mavlink_action_ack_t* action_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - action_ack->action = mavlink_msg_action_ack_get_action(msg); - action_ack->result = mavlink_msg_action_ack_get_result(msg); -#else - memcpy(action_ack, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_boot.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_boot.h deleted file mode 100644 index 679a0a3464..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_boot.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE BOOT PACKING - -#define MAVLINK_MSG_ID_BOOT 1 - -typedef struct __mavlink_boot_t -{ - uint32_t version; ///< The onboard software version -} mavlink_boot_t; - -#define MAVLINK_MSG_ID_BOOT_LEN 4 -#define MAVLINK_MSG_ID_1_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_BOOT { \ - "BOOT", \ - 1, \ - { { "version", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_boot_t, version) }, \ - } \ -} - - -/** - * @brief Pack a boot 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 version The onboard software version - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_boot_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_boot_t packet; - packet.version = version; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_BOOT; - return mavlink_finalize_message(msg, system_id, component_id, 4, 39); -} - -/** - * @brief Pack a boot 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param version The onboard software version - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_boot_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - memcpy(_MAV_PAYLOAD(msg), buf, 4); -#else - mavlink_boot_t packet; - packet.version = version; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_BOOT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 39); -} - -/** - * @brief Encode a boot struct into a 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 boot C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_boot_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_boot_t* boot) -{ - return mavlink_msg_boot_pack(system_id, component_id, msg, boot->version); -} - -/** - * @brief Send a boot message - * @param chan MAVLink channel to send the message - * - * @param version The onboard software version - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_boot_send(mavlink_channel_t chan, uint32_t version) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[4]; - _mav_put_uint32_t(buf, 0, version); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, buf, 4, 39); -#else - mavlink_boot_t packet; - packet.version = version; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, (const char *)&packet, 4, 39); -#endif -} - -#endif - -// MESSAGE BOOT UNPACKING - - -/** - * @brief Get field version from boot message - * - * @return The onboard software version - */ -static inline uint32_t mavlink_msg_boot_get_version(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Decode a boot message into a struct - * - * @param msg The message to decode - * @param boot C-struct to decode the message contents into - */ -static inline void mavlink_msg_boot_decode(const mavlink_message_t* msg, mavlink_boot_t* boot) -{ -#if MAVLINK_NEED_BYTE_SWAP - boot->version = mavlink_msg_boot_get_version(msg); -#else - memcpy(boot, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command.h deleted file mode 100644 index 5e477801fa..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_command.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE COMMAND PACKING - -#define MAVLINK_MSG_ID_COMMAND 75 - -typedef struct __mavlink_command_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. - 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 command; ///< Command ID, as defined by MAV_CMD enum. - uint8_t confirmation; ///< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) -} mavlink_command_t; - -#define MAVLINK_MSG_ID_COMMAND_LEN 20 -#define MAVLINK_MSG_ID_75_LEN 20 - - - -#define MAVLINK_MESSAGE_INFO_COMMAND { \ - "COMMAND", \ - 8, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_t, param1) }, \ - { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_t, param2) }, \ - { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_t, param3) }, \ - { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_t, param4) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_command_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_command_t, target_component) }, \ - { "command", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_command_t, command) }, \ - { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_command_t, confirmation) }, \ - } \ -} - - -/** - * @brief Pack a command 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. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _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_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - _mav_put_uint8_t(buf, 18, command); - _mav_put_uint8_t(buf, 19, confirmation); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_command_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND; - return mavlink_finalize_message(msg, system_id, component_id, 20, 133); -} - -/** - * @brief Pack a command 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 was 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. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_command_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 command,uint8_t confirmation,float param1,float param2,float param3,float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _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_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - _mav_put_uint8_t(buf, 18, command); - _mav_put_uint8_t(buf, 19, confirmation); - - memcpy(_MAV_PAYLOAD(msg), buf, 20); -#else - mavlink_command_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - - memcpy(_MAV_PAYLOAD(msg), &packet, 20); -#endif - - msg->msgid = MAVLINK_MSG_ID_COMMAND; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 133); -} - -/** - * @brief Encode a command struct into a 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 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_t* command) -{ - return mavlink_msg_command_pack(system_id, component_id, msg, command->target_system, command->target_component, command->command, command->confirmation, command->param1, command->param2, command->param3, command->param4); -} - -/** - * @brief Send a command 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. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_command_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[20]; - _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_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - _mav_put_uint8_t(buf, 18, command); - _mav_put_uint8_t(buf, 19, confirmation); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND, buf, 20, 133); -#else - mavlink_command_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.target_system = target_system; - packet.target_component = target_component; - packet.command = command; - packet.confirmation = confirmation; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND, (const char *)&packet, 20, 133); -#endif -} - -#endif - -// MESSAGE COMMAND UNPACKING - - -/** - * @brief Get field target_system from command message - * - * @return System which should execute the command - */ -static inline uint8_t mavlink_msg_command_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 16); -} - -/** - * @brief Get field target_component from command message - * - * @return Component which should execute the command, 0 for all components - */ -static inline uint8_t mavlink_msg_command_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 17); -} - -/** - * @brief Get field command from command message - * - * @return Command ID, as defined by MAV_CMD enum. - */ -static inline uint8_t mavlink_msg_command_get_command(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 18); -} - -/** - * @brief Get field confirmation from command message - * - * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - */ -static inline uint8_t mavlink_msg_command_get_confirmation(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 19); -} - -/** - * @brief Get field param1 from command message - * - * @return Parameter 1, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field param2 from command message - * - * @return Parameter 2, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field param3 from command message - * - * @return Parameter 3, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param3(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field param4 from command message - * - * @return Parameter 4, as defined by MAV_CMD enum. - */ -static inline float mavlink_msg_command_get_param4(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Decode a command message into a struct - * - * @param msg The message to decode - * @param command C-struct to decode the message contents into - */ -static inline void mavlink_msg_command_decode(const mavlink_message_t* msg, mavlink_command_t* command) -{ -#if MAVLINK_NEED_BYTE_SWAP - command->param1 = mavlink_msg_command_get_param1(msg); - command->param2 = mavlink_msg_command_get_param2(msg); - command->param3 = mavlink_msg_command_get_param3(msg); - command->param4 = mavlink_msg_command_get_param4(msg); - command->target_system = mavlink_msg_command_get_target_system(msg); - command->target_component = mavlink_msg_command_get_target_component(msg); - command->command = mavlink_msg_command_get_command(msg); - command->confirmation = mavlink_msg_command_get_confirmation(msg); -#else - memcpy(command, _MAV_PAYLOAD(msg), 20); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_control_status.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_control_status.h deleted file mode 100644 index 1723a6b801..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_control_status.h +++ /dev/null @@ -1,298 +0,0 @@ -// MESSAGE CONTROL_STATUS PACKING - -#define MAVLINK_MSG_ID_CONTROL_STATUS 52 - -typedef struct __mavlink_control_status_t -{ - uint8_t position_fix; ///< Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - uint8_t vision_fix; ///< Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - uint8_t gps_fix; ///< GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - uint8_t ahrs_health; ///< Attitude estimation health: 0: poor, 255: excellent - uint8_t control_att; ///< 0: Attitude control disabled, 1: enabled - uint8_t control_pos_xy; ///< 0: X, Y position control disabled, 1: enabled - uint8_t control_pos_z; ///< 0: Z position control disabled, 1: enabled - uint8_t control_pos_yaw; ///< 0: Yaw angle control disabled, 1: enabled -} mavlink_control_status_t; - -#define MAVLINK_MSG_ID_CONTROL_STATUS_LEN 8 -#define MAVLINK_MSG_ID_52_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_CONTROL_STATUS { \ - "CONTROL_STATUS", \ - 8, \ - { { "position_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_control_status_t, position_fix) }, \ - { "vision_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_control_status_t, vision_fix) }, \ - { "gps_fix", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_control_status_t, gps_fix) }, \ - { "ahrs_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_control_status_t, ahrs_health) }, \ - { "control_att", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_control_status_t, control_att) }, \ - { "control_pos_xy", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_control_status_t, control_pos_xy) }, \ - { "control_pos_z", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_control_status_t, control_pos_z) }, \ - { "control_pos_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_control_status_t, control_pos_yaw) }, \ - } \ -} - - -/** - * @brief Pack a control_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 position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_control_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t position_fix, uint8_t vision_fix, uint8_t gps_fix, uint8_t ahrs_health, uint8_t control_att, uint8_t control_pos_xy, uint8_t control_pos_z, uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; - return mavlink_finalize_message(msg, system_id, component_id, 8, 157); -} - -/** - * @brief Pack a control_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_control_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t position_fix,uint8_t vision_fix,uint8_t gps_fix,uint8_t ahrs_health,uint8_t control_att,uint8_t control_pos_xy,uint8_t control_pos_z,uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_CONTROL_STATUS; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 157); -} - -/** - * @brief Encode a control_status struct into a 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 control_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_control_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_status_t* control_status) -{ - return mavlink_msg_control_status_pack(system_id, component_id, msg, control_status->position_fix, control_status->vision_fix, control_status->gps_fix, control_status->ahrs_health, control_status->control_att, control_status->control_pos_xy, control_status->control_pos_z, control_status->control_pos_yaw); -} - -/** - * @brief Send a control_status message - * @param chan MAVLink channel to send the message - * - * @param position_fix Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - * @param vision_fix Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - * @param gps_fix GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - * @param ahrs_health Attitude estimation health: 0: poor, 255: excellent - * @param control_att 0: Attitude control disabled, 1: enabled - * @param control_pos_xy 0: X, Y position control disabled, 1: enabled - * @param control_pos_z 0: Z position control disabled, 1: enabled - * @param control_pos_yaw 0: Yaw angle control disabled, 1: enabled - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_control_status_send(mavlink_channel_t chan, uint8_t position_fix, uint8_t vision_fix, uint8_t gps_fix, uint8_t ahrs_health, uint8_t control_att, uint8_t control_pos_xy, uint8_t control_pos_z, uint8_t control_pos_yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint8_t(buf, 0, position_fix); - _mav_put_uint8_t(buf, 1, vision_fix); - _mav_put_uint8_t(buf, 2, gps_fix); - _mav_put_uint8_t(buf, 3, ahrs_health); - _mav_put_uint8_t(buf, 4, control_att); - _mav_put_uint8_t(buf, 5, control_pos_xy); - _mav_put_uint8_t(buf, 6, control_pos_z); - _mav_put_uint8_t(buf, 7, control_pos_yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_STATUS, buf, 8, 157); -#else - mavlink_control_status_t packet; - packet.position_fix = position_fix; - packet.vision_fix = vision_fix; - packet.gps_fix = gps_fix; - packet.ahrs_health = ahrs_health; - packet.control_att = control_att; - packet.control_pos_xy = control_pos_xy; - packet.control_pos_z = control_pos_z; - packet.control_pos_yaw = control_pos_yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_STATUS, (const char *)&packet, 8, 157); -#endif -} - -#endif - -// MESSAGE CONTROL_STATUS UNPACKING - - -/** - * @brief Get field position_fix from control_status message - * - * @return Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - */ -static inline uint8_t mavlink_msg_control_status_get_position_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field vision_fix from control_status message - * - * @return Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - */ -static inline uint8_t mavlink_msg_control_status_get_vision_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field gps_fix from control_status message - * - * @return GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - */ -static inline uint8_t mavlink_msg_control_status_get_gps_fix(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field ahrs_health from control_status message - * - * @return Attitude estimation health: 0: poor, 255: excellent - */ -static inline uint8_t mavlink_msg_control_status_get_ahrs_health(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field control_att from control_status message - * - * @return 0: Attitude control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_att(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field control_pos_xy from control_status message - * - * @return 0: X, Y position control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_xy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 5); -} - -/** - * @brief Get field control_pos_z from control_status message - * - * @return 0: Z position control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 6); -} - -/** - * @brief Get field control_pos_yaw from control_status message - * - * @return 0: Yaw angle control disabled, 1: enabled - */ -static inline uint8_t mavlink_msg_control_status_get_control_pos_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 7); -} - -/** - * @brief Decode a control_status message into a struct - * - * @param msg The message to decode - * @param control_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_control_status_decode(const mavlink_message_t* msg, mavlink_control_status_t* control_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - control_status->position_fix = mavlink_msg_control_status_get_position_fix(msg); - control_status->vision_fix = mavlink_msg_control_status_get_vision_fix(msg); - control_status->gps_fix = mavlink_msg_control_status_get_gps_fix(msg); - control_status->ahrs_health = mavlink_msg_control_status_get_ahrs_health(msg); - control_status->control_att = mavlink_msg_control_status_get_control_att(msg); - control_status->control_pos_xy = mavlink_msg_control_status_get_control_pos_xy(msg); - control_status->control_pos_z = mavlink_msg_control_status_get_control_pos_z(msg); - control_status->control_pos_yaw = mavlink_msg_control_status_get_control_pos_yaw(msg); -#else - memcpy(control_status, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_extended_message.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_extended_message.h deleted file mode 100644 index 2c42739be7..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_extended_message.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE EXTENDED_MESSAGE PACKING - -#define MAVLINK_MSG_ID_EXTENDED_MESSAGE 255 - -typedef struct __mavlink_extended_message_t -{ - 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 protocol_flags; ///< Retransmission / ACK flags -} mavlink_extended_message_t; - -#define MAVLINK_MSG_ID_EXTENDED_MESSAGE_LEN 3 -#define MAVLINK_MSG_ID_255_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE { \ - "EXTENDED_MESSAGE", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_message_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_message_t, target_component) }, \ - { "protocol_flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_extended_message_t, protocol_flags) }, \ - } \ -} - - -/** - * @brief Pack a extended_message 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 protocol_flags Retransmission / ACK flags - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_extended_message_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t protocol_flags) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, protocol_flags); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_extended_message_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.protocol_flags = protocol_flags; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE; - return mavlink_finalize_message(msg, system_id, component_id, 3, 247); -} - -/** - * @brief Pack a extended_message 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 was 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 protocol_flags Retransmission / ACK flags - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_extended_message_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 protocol_flags) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, protocol_flags); - - memcpy(_MAV_PAYLOAD(msg), buf, 3); -#else - mavlink_extended_message_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.protocol_flags = protocol_flags; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 247); -} - -/** - * @brief Encode a extended_message struct into a 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 extended_message C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_extended_message_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_extended_message_t* extended_message) -{ - return mavlink_msg_extended_message_pack(system_id, component_id, msg, extended_message->target_system, extended_message->target_component, extended_message->protocol_flags); -} - -/** - * @brief Send a extended_message 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 protocol_flags Retransmission / ACK flags - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_extended_message_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t protocol_flags) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[3]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, protocol_flags); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_MESSAGE, buf, 3, 247); -#else - mavlink_extended_message_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.protocol_flags = protocol_flags; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_MESSAGE, (const char *)&packet, 3, 247); -#endif -} - -#endif - -// MESSAGE EXTENDED_MESSAGE UNPACKING - - -/** - * @brief Get field target_system from extended_message message - * - * @return System which should execute the command - */ -static inline uint8_t mavlink_msg_extended_message_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from extended_message message - * - * @return Component which should execute the command, 0 for all components - */ -static inline uint8_t mavlink_msg_extended_message_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field protocol_flags from extended_message message - * - * @return Retransmission / ACK flags - */ -static inline uint8_t mavlink_msg_extended_message_get_protocol_flags(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a extended_message message into a struct - * - * @param msg The message to decode - * @param extended_message C-struct to decode the message contents into - */ -static inline void mavlink_msg_extended_message_decode(const mavlink_message_t* msg, mavlink_extended_message_t* extended_message) -{ -#if MAVLINK_NEED_BYTE_SWAP - extended_message->target_system = mavlink_msg_extended_message_get_target_system(msg); - extended_message->target_component = mavlink_msg_extended_message_get_target_component(msg); - extended_message->protocol_flags = mavlink_msg_extended_message_get_protocol_flags(msg); -#else - memcpy(extended_message, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position.h deleted file mode 100644 index 6e902393da..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_global_position.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE GLOBAL_POSITION PACKING - -#define MAVLINK_MSG_ID_GLOBAL_POSITION 33 - -typedef struct __mavlink_global_position_t -{ - uint64_t usec; ///< Timestamp (microseconds since unix epoch) - float lat; ///< Latitude, in degrees - float lon; ///< Longitude, in degrees - float alt; ///< Absolute altitude, in meters - float vx; ///< X Speed (in Latitude direction, positive: going north) - float vy; ///< Y Speed (in Longitude direction, positive: going east) - float vz; ///< Z Speed (in Altitude direction, positive: going up) -} mavlink_global_position_t; - -#define MAVLINK_MSG_ID_GLOBAL_POSITION_LEN 32 -#define MAVLINK_MSG_ID_33_LEN 32 - - - -#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION { \ - "GLOBAL_POSITION", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_t, usec) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_position_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_position_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_position_t, alt) }, \ - { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_position_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_t, vz) }, \ - } \ -} - - -/** - * @brief Pack a global_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 usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; - return mavlink_finalize_message(msg, system_id, component_id, 32, 147); -} - -/** - * @brief Pack a global_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_global_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float lat,float lon,float alt,float vx,float vy,float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 147); -} - -/** - * @brief Encode a global_position struct into a 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 global_position C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_global_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_t* global_position) -{ - return mavlink_msg_global_position_pack(system_id, component_id, msg, global_position->usec, global_position->lat, global_position->lon, global_position->alt, global_position->vx, global_position->vy, global_position->vz); -} - -/** - * @brief Send a global_position message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since unix epoch) - * @param lat Latitude, in degrees - * @param lon Longitude, in degrees - * @param alt Absolute altitude, in meters - * @param vx X Speed (in Latitude direction, positive: going north) - * @param vy Y Speed (in Longitude direction, positive: going east) - * @param vz Z Speed (in Altitude direction, positive: going up) - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_global_position_send(mavlink_channel_t chan, uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, buf, 32, 147); -#else - mavlink_global_position_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, (const char *)&packet, 32, 147); -#endif -} - -#endif - -// MESSAGE GLOBAL_POSITION UNPACKING - - -/** - * @brief Get field usec from global_position message - * - * @return Timestamp (microseconds since unix epoch) - */ -static inline uint64_t mavlink_msg_global_position_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field lat from global_position message - * - * @return Latitude, in degrees - */ -static inline float mavlink_msg_global_position_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field lon from global_position message - * - * @return Longitude, in degrees - */ -static inline float mavlink_msg_global_position_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field alt from global_position message - * - * @return Absolute altitude, in meters - */ -static inline float mavlink_msg_global_position_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field vx from global_position message - * - * @return X Speed (in Latitude direction, positive: going north) - */ -static inline float mavlink_msg_global_position_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field vy from global_position message - * - * @return Y Speed (in Longitude direction, positive: going east) - */ -static inline float mavlink_msg_global_position_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field vz from global_position message - * - * @return Z Speed (in Altitude direction, positive: going up) - */ -static inline float mavlink_msg_global_position_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Decode a global_position message into a struct - * - * @param msg The message to decode - * @param global_position C-struct to decode the message contents into - */ -static inline void mavlink_msg_global_position_decode(const mavlink_message_t* msg, mavlink_global_position_t* global_position) -{ -#if MAVLINK_NEED_BYTE_SWAP - global_position->usec = mavlink_msg_global_position_get_usec(msg); - global_position->lat = mavlink_msg_global_position_get_lat(msg); - global_position->lon = mavlink_msg_global_position_get_lon(msg); - global_position->alt = mavlink_msg_global_position_get_alt(msg); - global_position->vx = mavlink_msg_global_position_get_vx(msg); - global_position->vy = mavlink_msg_global_position_get_vy(msg); - global_position->vz = mavlink_msg_global_position_get_vz(msg); -#else - memcpy(global_position, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_local_origin_set.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_local_origin_set.h deleted file mode 100644 index 344c76aaa9..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_local_origin_set.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE GPS_LOCAL_ORIGIN_SET PACKING - -#define MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET 49 - -typedef struct __mavlink_gps_local_origin_set_t -{ - int32_t latitude; ///< Latitude (WGS84), expressed as * 1E7 - int32_t longitude; ///< Longitude (WGS84), expressed as * 1E7 - int32_t altitude; ///< Altitude(WGS84), expressed as * 1000 -} mavlink_gps_local_origin_set_t; - -#define MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET_LEN 12 -#define MAVLINK_MSG_ID_49_LEN 12 - - - -#define MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET { \ - "GPS_LOCAL_ORIGIN_SET", \ - 3, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_local_origin_set_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_local_origin_set_t, longitude) }, \ - { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_local_origin_set_t, altitude) }, \ - } \ -} - - -/** - * @brief Pack a gps_local_origin_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 latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_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[12]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; - return mavlink_finalize_message(msg, system_id, component_id, 12, 14); -} - -/** - * @brief Pack a gps_local_origin_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_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[12]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - - memcpy(_MAV_PAYLOAD(msg), buf, 12); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - memcpy(_MAV_PAYLOAD(msg), &packet, 12); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 14); -} - -/** - * @brief Encode a gps_local_origin_set struct into a 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 gps_local_origin_set C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_local_origin_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_local_origin_set_t* gps_local_origin_set) -{ - return mavlink_msg_gps_local_origin_set_pack(system_id, component_id, msg, gps_local_origin_set->latitude, gps_local_origin_set->longitude, gps_local_origin_set->altitude); -} - -/** - * @brief Send a gps_local_origin_set message - * @param chan MAVLink channel to send the message - * - * @param latitude Latitude (WGS84), expressed as * 1E7 - * @param longitude Longitude (WGS84), expressed as * 1E7 - * @param altitude Altitude(WGS84), expressed as * 1000 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_local_origin_set_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[12]; - _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_LOCAL_ORIGIN_SET, buf, 12, 14); -#else - mavlink_gps_local_origin_set_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET, (const char *)&packet, 12, 14); -#endif -} - -#endif - -// MESSAGE GPS_LOCAL_ORIGIN_SET UNPACKING - - -/** - * @brief Get field latitude from gps_local_origin_set message - * - * @return Latitude (WGS84), expressed as * 1E7 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_latitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 0); -} - -/** - * @brief Get field longitude from gps_local_origin_set message - * - * @return Longitude (WGS84), expressed as * 1E7 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_longitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 4); -} - -/** - * @brief Get field altitude from gps_local_origin_set message - * - * @return Altitude(WGS84), expressed as * 1000 - */ -static inline int32_t mavlink_msg_gps_local_origin_set_get_altitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 8); -} - -/** - * @brief Decode a gps_local_origin_set message into a struct - * - * @param msg The message to decode - * @param gps_local_origin_set C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_local_origin_set_decode(const mavlink_message_t* msg, mavlink_gps_local_origin_set_t* gps_local_origin_set) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_local_origin_set->latitude = mavlink_msg_gps_local_origin_set_get_latitude(msg); - gps_local_origin_set->longitude = mavlink_msg_gps_local_origin_set_get_longitude(msg); - gps_local_origin_set->altitude = mavlink_msg_gps_local_origin_set_get_altitude(msg); -#else - memcpy(gps_local_origin_set, _MAV_PAYLOAD(msg), 12); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw.h deleted file mode 100644 index 17f6294526..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_raw.h +++ /dev/null @@ -1,320 +0,0 @@ -// MESSAGE GPS_RAW PACKING - -#define MAVLINK_MSG_ID_GPS_RAW 32 - -typedef struct __mavlink_gps_raw_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot) - float lat; ///< Latitude in degrees - float lon; ///< Longitude in degrees - float alt; ///< Altitude in meters - float eph; ///< GPS HDOP - float epv; ///< GPS VDOP - float v; ///< GPS ground speed - float hdg; ///< Compass heading in degrees, 0..360 degrees - 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. -} mavlink_gps_raw_t; - -#define MAVLINK_MSG_ID_GPS_RAW_LEN 37 -#define MAVLINK_MSG_ID_32_LEN 37 - - - -#define MAVLINK_MESSAGE_INFO_GPS_RAW { \ - "GPS_RAW", \ - 9, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_t, usec) }, \ - { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gps_raw_t, lat) }, \ - { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gps_raw_t, lon) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gps_raw_t, alt) }, \ - { "eph", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_raw_t, eph) }, \ - { "epv", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_raw_t, epv) }, \ - { "v", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_raw_t, v) }, \ - { "hdg", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_raw_t, hdg) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_gps_raw_t, fix_type) }, \ - } \ -} - - -/** - * @brief Pack a gps_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 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 in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, uint8_t fix_type, float lat, float lon, float alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, eph); - _mav_put_float(buf, 24, epv); - _mav_put_float(buf, 28, v); - _mav_put_float(buf, 32, hdg); - _mav_put_uint8_t(buf, 36, fix_type); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - packet.fix_type = fix_type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW; - return mavlink_finalize_message(msg, system_id, component_id, 37, 220); -} - -/** - * @brief Pack a gps_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param 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 in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,uint8_t fix_type,float lat,float lon,float alt,float eph,float epv,float v,float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, eph); - _mav_put_float(buf, 24, epv); - _mav_put_float(buf, 28, v); - _mav_put_float(buf, 32, hdg); - _mav_put_uint8_t(buf, 36, fix_type); - - memcpy(_MAV_PAYLOAD(msg), buf, 37); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - packet.fix_type = fix_type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 37); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_RAW; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 37, 220); -} - -/** - * @brief Encode a gps_raw struct into a 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 gps_raw C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_t* gps_raw) -{ - return mavlink_msg_gps_raw_pack(system_id, component_id, msg, gps_raw->usec, gps_raw->fix_type, gps_raw->lat, gps_raw->lon, gps_raw->alt, gps_raw->eph, gps_raw->epv, gps_raw->v, gps_raw->hdg); -} - -/** - * @brief Send a gps_raw message - * @param chan MAVLink channel to send the message - * - * @param 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 in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param eph GPS HDOP - * @param epv GPS VDOP - * @param v GPS ground speed - * @param hdg Compass heading in degrees, 0..360 degrees - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_raw_send(mavlink_channel_t chan, uint64_t usec, uint8_t fix_type, float lat, float lon, float alt, float eph, float epv, float v, float hdg) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[37]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, lat); - _mav_put_float(buf, 12, lon); - _mav_put_float(buf, 16, alt); - _mav_put_float(buf, 20, eph); - _mav_put_float(buf, 24, epv); - _mav_put_float(buf, 28, v); - _mav_put_float(buf, 32, hdg); - _mav_put_uint8_t(buf, 36, fix_type); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW, buf, 37, 220); -#else - mavlink_gps_raw_t packet; - packet.usec = usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.v = v; - packet.hdg = hdg; - packet.fix_type = fix_type; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW, (const char *)&packet, 37, 220); -#endif -} - -#endif - -// MESSAGE GPS_RAW UNPACKING - - -/** - * @brief Get field usec from gps_raw message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_gps_raw_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field fix_type from gps_raw 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_gps_raw_get_fix_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 36); -} - -/** - * @brief Get field lat from gps_raw message - * - * @return Latitude in degrees - */ -static inline float mavlink_msg_gps_raw_get_lat(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field lon from gps_raw message - * - * @return Longitude in degrees - */ -static inline float mavlink_msg_gps_raw_get_lon(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field alt from gps_raw message - * - * @return Altitude in meters - */ -static inline float mavlink_msg_gps_raw_get_alt(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field eph from gps_raw message - * - * @return GPS HDOP - */ -static inline float mavlink_msg_gps_raw_get_eph(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field epv from gps_raw message - * - * @return GPS VDOP - */ -static inline float mavlink_msg_gps_raw_get_epv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field v from gps_raw message - * - * @return GPS ground speed - */ -static inline float mavlink_msg_gps_raw_get_v(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Get field hdg from gps_raw message - * - * @return Compass heading in degrees, 0..360 degrees - */ -static inline float mavlink_msg_gps_raw_get_hdg(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 32); -} - -/** - * @brief Decode a gps_raw message into a struct - * - * @param msg The message to decode - * @param gps_raw C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_raw_decode(const mavlink_message_t* msg, mavlink_gps_raw_t* gps_raw) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_raw->usec = mavlink_msg_gps_raw_get_usec(msg); - gps_raw->lat = mavlink_msg_gps_raw_get_lat(msg); - gps_raw->lon = mavlink_msg_gps_raw_get_lon(msg); - gps_raw->alt = mavlink_msg_gps_raw_get_alt(msg); - gps_raw->eph = mavlink_msg_gps_raw_get_eph(msg); - gps_raw->epv = mavlink_msg_gps_raw_get_epv(msg); - gps_raw->v = mavlink_msg_gps_raw_get_v(msg); - gps_raw->hdg = mavlink_msg_gps_raw_get_hdg(msg); - gps_raw->fix_type = mavlink_msg_gps_raw_get_fix_type(msg); -#else - memcpy(gps_raw, _MAV_PAYLOAD(msg), 37); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_set_global_origin.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_set_global_origin.h deleted file mode 100644 index 97ce149078..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_gps_set_global_origin.h +++ /dev/null @@ -1,232 +0,0 @@ -// MESSAGE GPS_SET_GLOBAL_ORIGIN PACKING - -#define MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN 48 - -typedef struct __mavlink_gps_set_global_origin_t -{ - int32_t latitude; ///< global position * 1E7 - int32_t longitude; ///< global position * 1E7 - int32_t altitude; ///< global position * 1000 - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_gps_set_global_origin_t; - -#define MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN_LEN 14 -#define MAVLINK_MSG_ID_48_LEN 14 - - - -#define MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN { \ - "GPS_SET_GLOBAL_ORIGIN", \ - 5, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_set_global_origin_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_set_global_origin_t, longitude) }, \ - { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_set_global_origin_t, altitude) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_gps_set_global_origin_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_gps_set_global_origin_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a gps_set_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 target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _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_put_uint8_t(buf, 13, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_gps_set_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; - return mavlink_finalize_message(msg, system_id, component_id, 14, 170); -} - -/** - * @brief Pack a gps_set_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_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,int32_t latitude,int32_t longitude,int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _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_put_uint8_t(buf, 13, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 14); -#else - mavlink_gps_set_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 14); -#endif - - msg->msgid = MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14, 170); -} - -/** - * @brief Encode a gps_set_global_origin struct into a 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 gps_set_global_origin C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_gps_set_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_set_global_origin_t* gps_set_global_origin) -{ - return mavlink_msg_gps_set_global_origin_pack(system_id, component_id, msg, gps_set_global_origin->target_system, gps_set_global_origin->target_component, gps_set_global_origin->latitude, gps_set_global_origin->longitude, gps_set_global_origin->altitude); -} - -/** - * @brief Send a gps_set_global_origin message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param latitude global position * 1E7 - * @param longitude global position * 1E7 - * @param altitude global position * 1000 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_gps_set_global_origin_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t latitude, int32_t longitude, int32_t altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[14]; - _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_put_uint8_t(buf, 13, target_component); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN, buf, 14, 170); -#else - mavlink_gps_set_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_SET_GLOBAL_ORIGIN, (const char *)&packet, 14, 170); -#endif -} - -#endif - -// MESSAGE GPS_SET_GLOBAL_ORIGIN UNPACKING - - -/** - * @brief Get field target_system from gps_set_global_origin message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_gps_set_global_origin_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 12); -} - -/** - * @brief Get field target_component from gps_set_global_origin message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_gps_set_global_origin_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 13); -} - -/** - * @brief Get field latitude from gps_set_global_origin message - * - * @return global position * 1E7 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_latitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 0); -} - -/** - * @brief Get field longitude from gps_set_global_origin message - * - * @return global position * 1E7 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_longitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 4); -} - -/** - * @brief Get field altitude from gps_set_global_origin message - * - * @return global position * 1000 - */ -static inline int32_t mavlink_msg_gps_set_global_origin_get_altitude(const mavlink_message_t* msg) -{ - return _MAV_RETURN_int32_t(msg, 8); -} - -/** - * @brief Decode a gps_set_global_origin message into a struct - * - * @param msg The message to decode - * @param gps_set_global_origin C-struct to decode the message contents into - */ -static inline void mavlink_msg_gps_set_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_set_global_origin_t* gps_set_global_origin) -{ -#if MAVLINK_NEED_BYTE_SWAP - gps_set_global_origin->latitude = mavlink_msg_gps_set_global_origin_get_latitude(msg); - gps_set_global_origin->longitude = mavlink_msg_gps_set_global_origin_get_longitude(msg); - gps_set_global_origin->altitude = mavlink_msg_gps_set_global_origin_get_altitude(msg); - gps_set_global_origin->target_system = mavlink_msg_gps_set_global_origin_get_target_system(msg); - gps_set_global_origin->target_component = mavlink_msg_gps_set_global_origin_get_target_component(msg); -#else - memcpy(gps_set_global_origin, _MAV_PAYLOAD(msg), 14); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position.h deleted file mode 100644 index e0a90edae9..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position.h +++ /dev/null @@ -1,276 +0,0 @@ -// MESSAGE LOCAL_POSITION PACKING - -#define MAVLINK_MSG_ID_LOCAL_POSITION 31 - -typedef struct __mavlink_local_position_t -{ - uint64_t usec; ///< Timestamp (microseconds since UNIX epoch or microseconds 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_t; - -#define MAVLINK_MSG_ID_LOCAL_POSITION_LEN 32 -#define MAVLINK_MSG_ID_31_LEN 32 - - - -#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION { \ - "LOCAL_POSITION", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_t, usec) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_t, z) }, \ - { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_t, vx) }, \ - { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_t, vy) }, \ - { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_t, vz) }, \ - } \ -} - - -/** - * @brief Pack a local_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 usec Timestamp (microseconds since UNIX epoch or microseconds 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_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _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, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_local_position_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; - return mavlink_finalize_message(msg, system_id, component_id, 32, 126); -} - -/** - * @brief Pack a local_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds since UNIX epoch or microseconds 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_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 vx,float vy,float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _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, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - memcpy(_MAV_PAYLOAD(msg), buf, 32); -#else - mavlink_local_position_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - - memcpy(_MAV_PAYLOAD(msg), &packet, 32); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 126); -} - -/** - * @brief Encode a local_position struct into a 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 local_position C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_local_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_t* local_position) -{ - return mavlink_msg_local_position_pack(system_id, component_id, msg, local_position->usec, local_position->x, local_position->y, local_position->z, local_position->vx, local_position->vy, local_position->vz); -} - -/** - * @brief Send a local_position message - * @param chan MAVLink channel to send the message - * - * @param usec Timestamp (microseconds since UNIX epoch or microseconds 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_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float vx, float vy, float vz) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[32]; - _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, vx); - _mav_put_float(buf, 24, vy); - _mav_put_float(buf, 28, vz); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION, buf, 32, 126); -#else - mavlink_local_position_t packet; - packet.usec = usec; - 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, (const char *)&packet, 32, 126); -#endif -} - -#endif - -// MESSAGE LOCAL_POSITION UNPACKING - - -/** - * @brief Get field usec from local_position message - * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ -static inline uint64_t mavlink_msg_local_position_get_usec(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field x from local_position message - * - * @return X Position - */ -static inline float mavlink_msg_local_position_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field y from local_position message - * - * @return Y Position - */ -static inline float mavlink_msg_local_position_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field z from local_position message - * - * @return Z Position - */ -static inline float mavlink_msg_local_position_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field vx from local_position message - * - * @return X Speed - */ -static inline float mavlink_msg_local_position_get_vx(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field vy from local_position message - * - * @return Y Speed - */ -static inline float mavlink_msg_local_position_get_vy(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Get field vz from local_position message - * - * @return Z Speed - */ -static inline float mavlink_msg_local_position_get_vz(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 28); -} - -/** - * @brief Decode a local_position message into a struct - * - * @param msg The message to decode - * @param local_position C-struct to decode the message contents into - */ -static inline void mavlink_msg_local_position_decode(const mavlink_message_t* msg, mavlink_local_position_t* local_position) -{ -#if MAVLINK_NEED_BYTE_SWAP - local_position->usec = mavlink_msg_local_position_get_usec(msg); - local_position->x = mavlink_msg_local_position_get_x(msg); - local_position->y = mavlink_msg_local_position_get_y(msg); - local_position->z = mavlink_msg_local_position_get_z(msg); - local_position->vx = mavlink_msg_local_position_get_vx(msg); - local_position->vy = mavlink_msg_local_position_get_vy(msg); - local_position->vz = mavlink_msg_local_position_get_vz(msg); -#else - memcpy(local_position, _MAV_PAYLOAD(msg), 32); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint_set.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint_set.h deleted file mode 100644 index a3183eb690..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_local_position_setpoint_set.h +++ /dev/null @@ -1,254 +0,0 @@ -// MESSAGE LOCAL_POSITION_SETPOINT_SET PACKING - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET 50 - -typedef struct __mavlink_local_position_setpoint_set_t -{ - float x; ///< x position - float y; ///< y position - float z; ///< z position - float yaw; ///< Desired yaw angle - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_local_position_setpoint_set_t; - -#define MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET_LEN 18 -#define MAVLINK_MSG_ID_50_LEN 18 - - - -#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET { \ - "LOCAL_POSITION_SETPOINT_SET", \ - 6, \ - { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_local_position_setpoint_set_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_setpoint_set_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_setpoint_set_t, z) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_setpoint_set_t, yaw) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_local_position_setpoint_set_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_local_position_setpoint_set_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a local_position_setpoint_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 x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_local_position_setpoint_set_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; - return mavlink_finalize_message(msg, system_id, component_id, 18, 73); -} - -/** - * @brief Pack a local_position_setpoint_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_local_position_setpoint_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,float x,float y,float z,float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 18); -#else - mavlink_local_position_setpoint_set_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 18); -#endif - - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 73); -} - -/** - * @brief Encode a local_position_setpoint_set struct into a 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 local_position_setpoint_set C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_local_position_setpoint_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_setpoint_set_t* local_position_setpoint_set) -{ - return mavlink_msg_local_position_setpoint_set_pack(system_id, component_id, msg, local_position_setpoint_set->target_system, local_position_setpoint_set->target_component, local_position_setpoint_set->x, local_position_setpoint_set->y, local_position_setpoint_set->z, local_position_setpoint_set->yaw); -} - -/** - * @brief Send a local_position_setpoint_set message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param x x position - * @param y y position - * @param z z position - * @param yaw Desired yaw angle - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_local_position_setpoint_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[18]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - _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_LOCAL_POSITION_SETPOINT_SET, buf, 18, 73); -#else - mavlink_local_position_setpoint_set_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET, (const char *)&packet, 18, 73); -#endif -} - -#endif - -// MESSAGE LOCAL_POSITION_SETPOINT_SET UNPACKING - - -/** - * @brief Get field target_system from local_position_setpoint_set message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_local_position_setpoint_set_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 16); -} - -/** - * @brief Get field target_component from local_position_setpoint_set message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_local_position_setpoint_set_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 17); -} - -/** - * @brief Get field x from local_position_setpoint_set message - * - * @return x position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field y from local_position_setpoint_set message - * - * @return y position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field z from local_position_setpoint_set message - * - * @return z position - */ -static inline float mavlink_msg_local_position_setpoint_set_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field yaw from local_position_setpoint_set message - * - * @return Desired yaw angle - */ -static inline float mavlink_msg_local_position_setpoint_set_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Decode a local_position_setpoint_set message into a struct - * - * @param msg The message to decode - * @param local_position_setpoint_set C-struct to decode the message contents into - */ -static inline void mavlink_msg_local_position_setpoint_set_decode(const mavlink_message_t* msg, mavlink_local_position_setpoint_set_t* local_position_setpoint_set) -{ -#if MAVLINK_NEED_BYTE_SWAP - local_position_setpoint_set->x = mavlink_msg_local_position_setpoint_set_get_x(msg); - local_position_setpoint_set->y = mavlink_msg_local_position_setpoint_set_get_y(msg); - local_position_setpoint_set->z = mavlink_msg_local_position_setpoint_set_get_z(msg); - local_position_setpoint_set->yaw = mavlink_msg_local_position_setpoint_set_get_yaw(msg); - local_position_setpoint_set->target_system = mavlink_msg_local_position_setpoint_set_get_target_system(msg); - local_position_setpoint_set->target_component = mavlink_msg_local_position_setpoint_set_get_target_component(msg); -#else - memcpy(local_position_setpoint_set, _MAV_PAYLOAD(msg), 18); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_object_detection_event.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_object_detection_event.h deleted file mode 100644 index 3ee70ee871..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_object_detection_event.h +++ /dev/null @@ -1,270 +0,0 @@ -// MESSAGE OBJECT_DETECTION_EVENT PACKING - -#define MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT 140 - -typedef struct __mavlink_object_detection_event_t -{ - uint32_t time; ///< Timestamp in milliseconds since system boot - float bearing; ///< Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - float distance; ///< Ground distance in meters - uint16_t object_id; ///< Object ID - uint8_t type; ///< Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - char name[20]; ///< Name of the object as defined by the detector - uint8_t quality; ///< Detection quality / confidence. 0: bad, 255: maximum confidence -} mavlink_object_detection_event_t; - -#define MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT_LEN 36 -#define MAVLINK_MSG_ID_140_LEN 36 - -#define MAVLINK_MSG_OBJECT_DETECTION_EVENT_FIELD_NAME_LEN 20 - -#define MAVLINK_MESSAGE_INFO_OBJECT_DETECTION_EVENT { \ - "OBJECT_DETECTION_EVENT", \ - 7, \ - { { "time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_object_detection_event_t, time) }, \ - { "bearing", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_object_detection_event_t, bearing) }, \ - { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_object_detection_event_t, distance) }, \ - { "object_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_object_detection_event_t, object_id) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_object_detection_event_t, type) }, \ - { "name", NULL, MAVLINK_TYPE_CHAR, 20, 15, offsetof(mavlink_object_detection_event_t, name) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_object_detection_event_t, quality) }, \ - } \ -} - - -/** - * @brief Pack a object_detection_event 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 Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_object_detection_event_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time, uint16_t object_id, uint8_t type, const char *name, uint8_t quality, float bearing, float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_float(buf, 4, bearing); - _mav_put_float(buf, 8, distance); - _mav_put_uint16_t(buf, 12, object_id); - _mav_put_uint8_t(buf, 14, type); - _mav_put_uint8_t(buf, 35, quality); - _mav_put_char_array(buf, 15, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.bearing = bearing; - packet.distance = distance; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; - return mavlink_finalize_message(msg, system_id, component_id, 36, 179); -} - -/** - * @brief Pack a object_detection_event 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param time Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_object_detection_event_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time,uint16_t object_id,uint8_t type,const char *name,uint8_t quality,float bearing,float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_float(buf, 4, bearing); - _mav_put_float(buf, 8, distance); - _mav_put_uint16_t(buf, 12, object_id); - _mav_put_uint8_t(buf, 14, type); - _mav_put_uint8_t(buf, 35, quality); - _mav_put_char_array(buf, 15, name, 20); - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.bearing = bearing; - packet.distance = distance; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36, 179); -} - -/** - * @brief Encode a object_detection_event struct into a 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 object_detection_event C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_object_detection_event_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_object_detection_event_t* object_detection_event) -{ - return mavlink_msg_object_detection_event_pack(system_id, component_id, msg, object_detection_event->time, object_detection_event->object_id, object_detection_event->type, object_detection_event->name, object_detection_event->quality, object_detection_event->bearing, object_detection_event->distance); -} - -/** - * @brief Send a object_detection_event message - * @param chan MAVLink channel to send the message - * - * @param time Timestamp in milliseconds since system boot - * @param object_id Object ID - * @param type Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - * @param name Name of the object as defined by the detector - * @param quality Detection quality / confidence. 0: bad, 255: maximum confidence - * @param bearing Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - * @param distance Ground distance in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_object_detection_event_send(mavlink_channel_t chan, uint32_t time, uint16_t object_id, uint8_t type, const char *name, uint8_t quality, float bearing, float distance) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[36]; - _mav_put_uint32_t(buf, 0, time); - _mav_put_float(buf, 4, bearing); - _mav_put_float(buf, 8, distance); - _mav_put_uint16_t(buf, 12, object_id); - _mav_put_uint8_t(buf, 14, type); - _mav_put_uint8_t(buf, 35, quality); - _mav_put_char_array(buf, 15, name, 20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT, buf, 36, 179); -#else - mavlink_object_detection_event_t packet; - packet.time = time; - packet.bearing = bearing; - packet.distance = distance; - packet.object_id = object_id; - packet.type = type; - packet.quality = quality; - mav_array_memcpy(packet.name, name, sizeof(char)*20); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT, (const char *)&packet, 36, 179); -#endif -} - -#endif - -// MESSAGE OBJECT_DETECTION_EVENT UNPACKING - - -/** - * @brief Get field time from object_detection_event message - * - * @return Timestamp in milliseconds since system boot - */ -static inline uint32_t mavlink_msg_object_detection_event_get_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field object_id from object_detection_event message - * - * @return Object ID - */ -static inline uint16_t mavlink_msg_object_detection_event_get_object_id(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field type from object_detection_event message - * - * @return Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - */ -static inline uint8_t mavlink_msg_object_detection_event_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 14); -} - -/** - * @brief Get field name from object_detection_event message - * - * @return Name of the object as defined by the detector - */ -static inline uint16_t mavlink_msg_object_detection_event_get_name(const mavlink_message_t* msg, char *name) -{ - return _MAV_RETURN_char_array(msg, name, 20, 15); -} - -/** - * @brief Get field quality from object_detection_event message - * - * @return Detection quality / confidence. 0: bad, 255: maximum confidence - */ -static inline uint8_t mavlink_msg_object_detection_event_get_quality(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 35); -} - -/** - * @brief Get field bearing from object_detection_event message - * - * @return Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - */ -static inline float mavlink_msg_object_detection_event_get_bearing(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field distance from object_detection_event message - * - * @return Ground distance in meters - */ -static inline float mavlink_msg_object_detection_event_get_distance(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Decode a object_detection_event message into a struct - * - * @param msg The message to decode - * @param object_detection_event C-struct to decode the message contents into - */ -static inline void mavlink_msg_object_detection_event_decode(const mavlink_message_t* msg, mavlink_object_detection_event_t* object_detection_event) -{ -#if MAVLINK_NEED_BYTE_SWAP - object_detection_event->time = mavlink_msg_object_detection_event_get_time(msg); - object_detection_event->bearing = mavlink_msg_object_detection_event_get_bearing(msg); - object_detection_event->distance = mavlink_msg_object_detection_event_get_distance(msg); - object_detection_event->object_id = mavlink_msg_object_detection_event_get_object_id(msg); - object_detection_event->type = mavlink_msg_object_detection_event_get_type(msg); - mavlink_msg_object_detection_event_get_name(msg, object_detection_event->name); - object_detection_event->quality = mavlink_msg_object_detection_event_get_quality(msg); -#else - memcpy(object_detection_event, _MAV_PAYLOAD(msg), 36); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_position_target.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_position_target.h deleted file mode 100644 index 44c0e6931b..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_position_target.h +++ /dev/null @@ -1,210 +0,0 @@ -// MESSAGE POSITION_TARGET PACKING - -#define MAVLINK_MSG_ID_POSITION_TARGET 63 - -typedef struct __mavlink_position_target_t -{ - float x; ///< x position - float y; ///< y position - float z; ///< z position - float yaw; ///< yaw orientation in radians, 0 = NORTH -} mavlink_position_target_t; - -#define MAVLINK_MSG_ID_POSITION_TARGET_LEN 16 -#define MAVLINK_MSG_ID_63_LEN 16 - - - -#define MAVLINK_MESSAGE_INFO_POSITION_TARGET { \ - "POSITION_TARGET", \ - 4, \ - { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_target_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_t, z) }, \ - { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_t, yaw) }, \ - } \ -} - - -/** - * @brief Pack a position_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 x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_position_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; - return mavlink_finalize_message(msg, system_id, component_id, 16, 126); -} - -/** - * @brief Pack a position_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_position_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float x,float y,float z,float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - memcpy(_MAV_PAYLOAD(msg), buf, 16); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - memcpy(_MAV_PAYLOAD(msg), &packet, 16); -#endif - - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 126); -} - -/** - * @brief Encode a position_target struct into a 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 position_target C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_position_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_t* position_target) -{ - return mavlink_msg_position_target_pack(system_id, component_id, msg, position_target->x, position_target->y, position_target->z, position_target->yaw); -} - -/** - * @brief Send a position_target message - * @param chan MAVLink channel to send the message - * - * @param x x position - * @param y y position - * @param z z position - * @param yaw yaw orientation in radians, 0 = NORTH - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_position_target_send(mavlink_channel_t chan, float x, float y, float z, float yaw) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[16]; - _mav_put_float(buf, 0, x); - _mav_put_float(buf, 4, y); - _mav_put_float(buf, 8, z); - _mav_put_float(buf, 12, yaw); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET, buf, 16, 126); -#else - mavlink_position_target_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.yaw = yaw; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET, (const char *)&packet, 16, 126); -#endif -} - -#endif - -// MESSAGE POSITION_TARGET UNPACKING - - -/** - * @brief Get field x from position_target message - * - * @return x position - */ -static inline float mavlink_msg_position_target_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field y from position_target message - * - * @return y position - */ -static inline float mavlink_msg_position_target_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field z from position_target message - * - * @return z position - */ -static inline float mavlink_msg_position_target_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field yaw from position_target message - * - * @return yaw orientation in radians, 0 = NORTH - */ -static inline float mavlink_msg_position_target_get_yaw(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Decode a position_target message into a struct - * - * @param msg The message to decode - * @param position_target C-struct to decode the message contents into - */ -static inline void mavlink_msg_position_target_decode(const mavlink_message_t* msg, mavlink_position_target_t* position_target) -{ -#if MAVLINK_NEED_BYTE_SWAP - position_target->x = mavlink_msg_position_target_get_x(msg); - position_target->y = mavlink_msg_position_target_get_y(msg); - position_target->z = mavlink_msg_position_target_get_z(msg); - position_target->yaw = mavlink_msg_position_target_get_yaw(msg); -#else - memcpy(position_target, _MAV_PAYLOAD(msg), 16); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_altitude.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_altitude.h deleted file mode 100644 index c7a768aa4a..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_altitude.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SET_ALTITUDE PACKING - -#define MAVLINK_MSG_ID_SET_ALTITUDE 65 - -typedef struct __mavlink_set_altitude_t -{ - uint32_t mode; ///< The new altitude in meters - uint8_t target; ///< The system setting the altitude -} mavlink_set_altitude_t; - -#define MAVLINK_MSG_ID_SET_ALTITUDE_LEN 5 -#define MAVLINK_MSG_ID_65_LEN 5 - - - -#define MAVLINK_MESSAGE_INFO_SET_ALTITUDE { \ - "SET_ALTITUDE", \ - 2, \ - { { "mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_altitude_t, mode) }, \ - { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_altitude_t, target) }, \ - } \ -} - - -/** - * @brief Pack a set_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 target The system setting the altitude - * @param mode The new altitude in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint32_t(buf, 0, mode); - _mav_put_uint8_t(buf, 4, target); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_set_altitude_t packet; - packet.mode = mode; - packet.target = target; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; - return mavlink_finalize_message(msg, system_id, component_id, 5, 54); -} - -/** - * @brief Pack a set_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system setting the altitude - * @param mode The new altitude in meters - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint32_t(buf, 0, mode); - _mav_put_uint8_t(buf, 4, target); - - memcpy(_MAV_PAYLOAD(msg), buf, 5); -#else - mavlink_set_altitude_t packet; - packet.mode = mode; - packet.target = target; - - memcpy(_MAV_PAYLOAD(msg), &packet, 5); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_ALTITUDE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5, 54); -} - -/** - * @brief Encode a set_altitude struct into a 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 set_altitude C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_altitude_t* set_altitude) -{ - return mavlink_msg_set_altitude_pack(system_id, component_id, msg, set_altitude->target, set_altitude->mode); -} - -/** - * @brief Send a set_altitude message - * @param chan MAVLink channel to send the message - * - * @param target The system setting the altitude - * @param mode The new altitude in meters - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_altitude_send(mavlink_channel_t chan, uint8_t target, uint32_t mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[5]; - _mav_put_uint32_t(buf, 0, mode); - _mav_put_uint8_t(buf, 4, target); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ALTITUDE, buf, 5, 54); -#else - mavlink_set_altitude_t packet; - packet.mode = mode; - packet.target = target; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ALTITUDE, (const char *)&packet, 5, 54); -#endif -} - -#endif - -// MESSAGE SET_ALTITUDE UNPACKING - - -/** - * @brief Get field target from set_altitude message - * - * @return The system setting the altitude - */ -static inline uint8_t mavlink_msg_set_altitude_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 4); -} - -/** - * @brief Get field mode from set_altitude message - * - * @return The new altitude in meters - */ -static inline uint32_t mavlink_msg_set_altitude_get_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Decode a set_altitude message into a struct - * - * @param msg The message to decode - * @param set_altitude C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_altitude_decode(const mavlink_message_t* msg, mavlink_set_altitude_t* set_altitude) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_altitude->mode = mavlink_msg_set_altitude_get_mode(msg); - set_altitude->target = mavlink_msg_set_altitude_get_target(msg); -#else - memcpy(set_altitude, _MAV_PAYLOAD(msg), 5); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_nav_mode.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_nav_mode.h deleted file mode 100644 index 5832ecb6b6..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_set_nav_mode.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SET_NAV_MODE PACKING - -#define MAVLINK_MSG_ID_SET_NAV_MODE 12 - -typedef struct __mavlink_set_nav_mode_t -{ - uint8_t target; ///< The system setting the mode - uint8_t nav_mode; ///< The new navigation mode -} mavlink_set_nav_mode_t; - -#define MAVLINK_MSG_ID_SET_NAV_MODE_LEN 2 -#define MAVLINK_MSG_ID_12_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_SET_NAV_MODE { \ - "SET_NAV_MODE", \ - 2, \ - { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_nav_mode_t, target) }, \ - { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_nav_mode_t, nav_mode) }, \ - } \ -} - - -/** - * @brief Pack a set_nav_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 The system setting the mode - * @param nav_mode The new navigation mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_nav_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; - return mavlink_finalize_message(msg, system_id, component_id, 2, 10); -} - -/** - * @brief Pack a set_nav_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target The system setting the mode - * @param nav_mode The new navigation mode - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_set_nav_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 10); -} - -/** - * @brief Encode a set_nav_mode struct into a 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 set_nav_mode C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_set_nav_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_nav_mode_t* set_nav_mode) -{ - return mavlink_msg_set_nav_mode_pack(system_id, component_id, msg, set_nav_mode->target, set_nav_mode->nav_mode); -} - -/** - * @brief Send a set_nav_mode message - * @param chan MAVLink channel to send the message - * - * @param target The system setting the mode - * @param nav_mode The new navigation mode - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_set_nav_mode_send(mavlink_channel_t chan, uint8_t target, uint8_t nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint8_t(buf, 0, target); - _mav_put_uint8_t(buf, 1, nav_mode); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, buf, 2, 10); -#else - mavlink_set_nav_mode_t packet; - packet.target = target; - packet.nav_mode = nav_mode; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, (const char *)&packet, 2, 10); -#endif -} - -#endif - -// MESSAGE SET_NAV_MODE UNPACKING - - -/** - * @brief Get field target from set_nav_mode message - * - * @return The system setting the mode - */ -static inline uint8_t mavlink_msg_set_nav_mode_get_target(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field nav_mode from set_nav_mode message - * - * @return The new navigation mode - */ -static inline uint8_t mavlink_msg_set_nav_mode_get_nav_mode(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a set_nav_mode message into a struct - * - * @param msg The message to decode - * @param set_nav_mode C-struct to decode the message contents into - */ -static inline void mavlink_msg_set_nav_mode_decode(const mavlink_message_t* msg, mavlink_set_nav_mode_t* set_nav_mode) -{ -#if MAVLINK_NEED_BYTE_SWAP - set_nav_mode->target = mavlink_msg_set_nav_mode_get_target(msg); - set_nav_mode->nav_mode = mavlink_msg_set_nav_mode_get_nav_mode(msg); -#else - memcpy(set_nav_mode, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time_utc.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time_utc.h deleted file mode 100644 index fc6395099e..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_system_time_utc.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE SYSTEM_TIME_UTC PACKING - -#define MAVLINK_MSG_ID_SYSTEM_TIME_UTC 4 - -typedef struct __mavlink_system_time_utc_t -{ - uint32_t utc_date; ///< GPS UTC date ddmmyy - uint32_t utc_time; ///< GPS UTC time hhmmss -} mavlink_system_time_utc_t; - -#define MAVLINK_MSG_ID_SYSTEM_TIME_UTC_LEN 8 -#define MAVLINK_MSG_ID_4_LEN 8 - - - -#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC { \ - "SYSTEM_TIME_UTC", \ - 2, \ - { { "utc_date", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_system_time_utc_t, utc_date) }, \ - { "utc_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_system_time_utc_t, utc_time) }, \ - } \ -} - - -/** - * @brief Pack a system_time_utc 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 utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_utc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t utc_date, uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; - return mavlink_finalize_message(msg, system_id, component_id, 8, 191); -} - -/** - * @brief Pack a system_time_utc 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 was sent over - * @param msg The MAVLink message to compress the data into - * @param utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_system_time_utc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t utc_date,uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - memcpy(_MAV_PAYLOAD(msg), buf, 8); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - memcpy(_MAV_PAYLOAD(msg), &packet, 8); -#endif - - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 191); -} - -/** - * @brief Encode a system_time_utc struct into a 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 system_time_utc C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_system_time_utc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_utc_t* system_time_utc) -{ - return mavlink_msg_system_time_utc_pack(system_id, component_id, msg, system_time_utc->utc_date, system_time_utc->utc_time); -} - -/** - * @brief Send a system_time_utc message - * @param chan MAVLink channel to send the message - * - * @param utc_date GPS UTC date ddmmyy - * @param utc_time GPS UTC time hhmmss - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_system_time_utc_send(mavlink_channel_t chan, uint32_t utc_date, uint32_t utc_time) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[8]; - _mav_put_uint32_t(buf, 0, utc_date); - _mav_put_uint32_t(buf, 4, utc_time); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, buf, 8, 191); -#else - mavlink_system_time_utc_t packet; - packet.utc_date = utc_date; - packet.utc_time = utc_time; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, (const char *)&packet, 8, 191); -#endif -} - -#endif - -// MESSAGE SYSTEM_TIME_UTC UNPACKING - - -/** - * @brief Get field utc_date from system_time_utc message - * - * @return GPS UTC date ddmmyy - */ -static inline uint32_t mavlink_msg_system_time_utc_get_utc_date(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field utc_time from system_time_utc message - * - * @return GPS UTC time hhmmss - */ -static inline uint32_t mavlink_msg_system_time_utc_get_utc_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 4); -} - -/** - * @brief Decode a system_time_utc message into a struct - * - * @param msg The message to decode - * @param system_time_utc C-struct to decode the message contents into - */ -static inline void mavlink_msg_system_time_utc_decode(const mavlink_message_t* msg, mavlink_system_time_utc_t* system_time_utc) -{ -#if MAVLINK_NEED_BYTE_SWAP - system_time_utc->utc_date = mavlink_msg_system_time_utc_get_utc_date(msg); - system_time_utc->utc_time = mavlink_msg_system_time_utc_get_utc_time(msg); -#else - memcpy(system_time_utc, _MAV_PAYLOAD(msg), 8); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint.h deleted file mode 100644 index 455607c44c..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint.h +++ /dev/null @@ -1,430 +0,0 @@ -// MESSAGE WAYPOINT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT 39 - -typedef struct __mavlink_waypoint_t -{ - float param1; ///< PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - float param2; ///< PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - float param3; ///< PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - float param4; ///< PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - float x; ///< PARAM5 / local: x position, global: latitude - float y; ///< PARAM6 / y position: global: longitude - float z; ///< PARAM7 / z position: global: altitude - uint16_t seq; ///< Sequence - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t frame; ///< The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - uint8_t command; ///< The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - uint8_t current; ///< false:0, true:1 - uint8_t autocontinue; ///< autocontinue to next wp -} mavlink_waypoint_t; - -#define MAVLINK_MSG_ID_WAYPOINT_LEN 36 -#define MAVLINK_MSG_ID_39_LEN 36 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT { \ - "WAYPOINT", \ - 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_waypoint_t, param1) }, \ - { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_waypoint_t, param2) }, \ - { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_waypoint_t, param3) }, \ - { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_waypoint_t, param4) }, \ - { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_waypoint_t, x) }, \ - { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_waypoint_t, y) }, \ - { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_waypoint_t, z) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_waypoint_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_waypoint_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_waypoint_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_waypoint_t, frame) }, \ - { "command", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_waypoint_t, command) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_waypoint_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_waypoint_t, autocontinue) }, \ - } \ -} - - -/** - * @brief Pack a waypoint 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 waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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, uint8_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[36]; - _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_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, command); - _mav_put_uint8_t(buf, 34, current); - _mav_put_uint8_t(buf, 35, autocontinue); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_waypoint_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.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT; - return mavlink_finalize_message(msg, system_id, component_id, 36, 205); -} - -/** - * @brief Pack a waypoint 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 was 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 waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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,uint8_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[36]; - _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_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, command); - _mav_put_uint8_t(buf, 34, current); - _mav_put_uint8_t(buf, 35, autocontinue); - - memcpy(_MAV_PAYLOAD(msg), buf, 36); -#else - mavlink_waypoint_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.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - - memcpy(_MAV_PAYLOAD(msg), &packet, 36); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36, 205); -} - -/** - * @brief Encode a waypoint struct into a 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 waypoint C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_t* waypoint) -{ - return mavlink_msg_waypoint_pack(system_id, component_id, msg, waypoint->target_system, waypoint->target_component, waypoint->seq, waypoint->frame, waypoint->command, waypoint->current, waypoint->autocontinue, waypoint->param1, waypoint->param2, waypoint->param3, waypoint->param4, waypoint->x, waypoint->y, waypoint->z); -} - -/** - * @brief Send a waypoint 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 waypoint. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - * @param param2 PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - * @param param3 PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - * @param param4 PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint8_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[36]; - _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_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, command); - _mav_put_uint8_t(buf, 34, current); - _mav_put_uint8_t(buf, 35, autocontinue); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT, buf, 36, 205); -#else - mavlink_waypoint_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.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.command = command; - packet.current = current; - packet.autocontinue = autocontinue; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT, (const char *)&packet, 36, 205); -#endif -} - -#endif - -// MESSAGE WAYPOINT UNPACKING - - -/** - * @brief Get field target_system from waypoint message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 30); -} - -/** - * @brief Get field target_component from waypoint message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 31); -} - -/** - * @brief Get field seq from waypoint message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 28); -} - -/** - * @brief Get field frame from waypoint message - * - * @return The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - */ -static inline uint8_t mavlink_msg_waypoint_get_frame(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 32); -} - -/** - * @brief Get field command from waypoint message - * - * @return The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - */ -static inline uint8_t mavlink_msg_waypoint_get_command(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 33); -} - -/** - * @brief Get field current from waypoint message - * - * @return false:0, true:1 - */ -static inline uint8_t mavlink_msg_waypoint_get_current(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 34); -} - -/** - * @brief Get field autocontinue from waypoint message - * - * @return autocontinue to next wp - */ -static inline uint8_t mavlink_msg_waypoint_get_autocontinue(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 35); -} - -/** - * @brief Get field param1 from waypoint message - * - * @return PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - */ -static inline float mavlink_msg_waypoint_get_param1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 0); -} - -/** - * @brief Get field param2 from waypoint message - * - * @return PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - */ -static inline float mavlink_msg_waypoint_get_param2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field param3 from waypoint message - * - * @return PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - */ -static inline float mavlink_msg_waypoint_get_param3(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field param4 from waypoint message - * - * @return PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - */ -static inline float mavlink_msg_waypoint_get_param4(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 12); -} - -/** - * @brief Get field x from waypoint message - * - * @return PARAM5 / local: x position, global: latitude - */ -static inline float mavlink_msg_waypoint_get_x(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 16); -} - -/** - * @brief Get field y from waypoint message - * - * @return PARAM6 / y position: global: longitude - */ -static inline float mavlink_msg_waypoint_get_y(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 20); -} - -/** - * @brief Get field z from waypoint message - * - * @return PARAM7 / z position: global: altitude - */ -static inline float mavlink_msg_waypoint_get_z(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 24); -} - -/** - * @brief Decode a waypoint message into a struct - * - * @param msg The message to decode - * @param waypoint C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_decode(const mavlink_message_t* msg, mavlink_waypoint_t* waypoint) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint->param1 = mavlink_msg_waypoint_get_param1(msg); - waypoint->param2 = mavlink_msg_waypoint_get_param2(msg); - waypoint->param3 = mavlink_msg_waypoint_get_param3(msg); - waypoint->param4 = mavlink_msg_waypoint_get_param4(msg); - waypoint->x = mavlink_msg_waypoint_get_x(msg); - waypoint->y = mavlink_msg_waypoint_get_y(msg); - waypoint->z = mavlink_msg_waypoint_get_z(msg); - waypoint->seq = mavlink_msg_waypoint_get_seq(msg); - waypoint->target_system = mavlink_msg_waypoint_get_target_system(msg); - waypoint->target_component = mavlink_msg_waypoint_get_target_component(msg); - waypoint->frame = mavlink_msg_waypoint_get_frame(msg); - waypoint->command = mavlink_msg_waypoint_get_command(msg); - waypoint->current = mavlink_msg_waypoint_get_current(msg); - waypoint->autocontinue = mavlink_msg_waypoint_get_autocontinue(msg); -#else - memcpy(waypoint, _MAV_PAYLOAD(msg), 36); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_ack.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_ack.h deleted file mode 100644 index 846ae88393..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_ack.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_ACK PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_ACK 47 - -typedef struct __mavlink_waypoint_ack_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID - uint8_t type; ///< 0: OK, 1: Error -} mavlink_waypoint_ack_t; - -#define MAVLINK_MSG_ID_WAYPOINT_ACK_LEN 3 -#define MAVLINK_MSG_ID_47_LEN 3 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_ACK { \ - "WAYPOINT_ACK", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_ack_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_ack_t, target_component) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_waypoint_ack_t, type) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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 0: OK, 1: Error - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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[3]; - _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(msg), buf, 3); -#else - mavlink_waypoint_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; - return mavlink_finalize_message(msg, system_id, component_id, 3, 214); -} - -/** - * @brief Pack a waypoint_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 was sent over - * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param type 0: OK, 1: Error - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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[3]; - _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(msg), buf, 3); -#else - mavlink_waypoint_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; - - memcpy(_MAV_PAYLOAD(msg), &packet, 3); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_ACK; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 214); -} - -/** - * @brief Encode a waypoint_ack struct into a 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 waypoint_ack C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_ack_t* waypoint_ack) -{ - return mavlink_msg_waypoint_ack_pack(system_id, component_id, msg, waypoint_ack->target_system, waypoint_ack->target_component, waypoint_ack->type); -} - -/** - * @brief Send a waypoint_ack message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param type 0: OK, 1: Error - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_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[3]; - _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_WAYPOINT_ACK, buf, 3, 214); -#else - mavlink_waypoint_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_WAYPOINT_ACK, (const char *)&packet, 3, 214); -#endif -} - -#endif - -// MESSAGE WAYPOINT_ACK UNPACKING - - -/** - * @brief Get field target_system from waypoint_ack message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_ack message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field type from waypoint_ack message - * - * @return 0: OK, 1: Error - */ -static inline uint8_t mavlink_msg_waypoint_ack_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Decode a waypoint_ack message into a struct - * - * @param msg The message to decode - * @param waypoint_ack C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_ack_decode(const mavlink_message_t* msg, mavlink_waypoint_ack_t* waypoint_ack) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_ack->target_system = mavlink_msg_waypoint_ack_get_target_system(msg); - waypoint_ack->target_component = mavlink_msg_waypoint_ack_get_target_component(msg); - waypoint_ack->type = mavlink_msg_waypoint_ack_get_type(msg); -#else - memcpy(waypoint_ack, _MAV_PAYLOAD(msg), 3); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_clear_all.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_clear_all.h deleted file mode 100644 index 4133b58d06..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_clear_all.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE WAYPOINT_CLEAR_ALL PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL 45 - -typedef struct __mavlink_waypoint_clear_all_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_clear_all_t; - -#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL_LEN 2 -#define MAVLINK_MSG_ID_45_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL { \ - "WAYPOINT_CLEAR_ALL", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_clear_all_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_clear_all_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; - return mavlink_finalize_message(msg, system_id, component_id, 2, 229); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 229); -} - -/** - * @brief Encode a waypoint_clear_all struct into a 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 waypoint_clear_all C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_clear_all_t* waypoint_clear_all) -{ - return mavlink_msg_waypoint_clear_all_pack(system_id, component_id, msg, waypoint_clear_all->target_system, waypoint_clear_all->target_component); -} - -/** - * @brief Send a waypoint_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_waypoint_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[2]; - _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_WAYPOINT_CLEAR_ALL, buf, 2, 229); -#else - mavlink_waypoint_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, (const char *)&packet, 2, 229); -#endif -} - -#endif - -// MESSAGE WAYPOINT_CLEAR_ALL UNPACKING - - -/** - * @brief Get field target_system from waypoint_clear_all message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_clear_all message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a waypoint_clear_all message into a struct - * - * @param msg The message to decode - * @param waypoint_clear_all C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_clear_all_decode(const mavlink_message_t* msg, mavlink_waypoint_clear_all_t* waypoint_clear_all) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_clear_all->target_system = mavlink_msg_waypoint_clear_all_get_target_system(msg); - waypoint_clear_all->target_component = mavlink_msg_waypoint_clear_all_get_target_component(msg); -#else - memcpy(waypoint_clear_all, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_count.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_count.h deleted file mode 100644 index cfa433338b..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_count.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_COUNT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_COUNT 44 - -typedef struct __mavlink_waypoint_count_t -{ - uint16_t count; ///< Number of Waypoints in the Sequence - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_count_t; - -#define MAVLINK_MSG_ID_WAYPOINT_COUNT_LEN 4 -#define MAVLINK_MSG_ID_44_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT { \ - "WAYPOINT_COUNT", \ - 3, \ - { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_count_t, count) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_waypoint_count_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_waypoint_count_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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 Waypoints in the Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_count_t packet; - packet.count = count; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; - return mavlink_finalize_message(msg, system_id, component_id, 4, 8); -} - -/** - * @brief Pack a waypoint_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 was 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 Waypoints in the Sequence - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_count_t packet; - packet.count = count; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_COUNT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 8); -} - -/** - * @brief Encode a waypoint_count struct into a 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 waypoint_count C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_count_t* waypoint_count) -{ - return mavlink_msg_waypoint_count_pack(system_id, component_id, msg, waypoint_count->target_system, waypoint_count->target_component, waypoint_count->count); -} - -/** - * @brief Send a waypoint_count message - * @param chan MAVLink channel to send the message - * - * @param target_system System ID - * @param target_component Component ID - * @param count Number of Waypoints in the Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_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[4]; - _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_WAYPOINT_COUNT, buf, 4, 8); -#else - mavlink_waypoint_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_WAYPOINT_COUNT, (const char *)&packet, 4, 8); -#endif -} - -#endif - -// MESSAGE WAYPOINT_COUNT UNPACKING - - -/** - * @brief Get field target_system from waypoint_count message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_count_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field target_component from waypoint_count message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_count_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field count from waypoint_count message - * - * @return Number of Waypoints in the Sequence - */ -static inline uint16_t mavlink_msg_waypoint_count_get_count(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_count message into a struct - * - * @param msg The message to decode - * @param waypoint_count C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_count_decode(const mavlink_message_t* msg, mavlink_waypoint_count_t* waypoint_count) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_count->count = mavlink_msg_waypoint_count_get_count(msg); - waypoint_count->target_system = mavlink_msg_waypoint_count_get_target_system(msg); - waypoint_count->target_component = mavlink_msg_waypoint_count_get_target_component(msg); -#else - memcpy(waypoint_count, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_current.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_current.h deleted file mode 100644 index a2438a4568..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_current.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE WAYPOINT_CURRENT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_CURRENT 42 - -typedef struct __mavlink_waypoint_current_t -{ - uint16_t seq; ///< Sequence -} mavlink_waypoint_current_t; - -#define MAVLINK_MSG_ID_WAYPOINT_CURRENT_LEN 2 -#define MAVLINK_MSG_ID_42_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT { \ - "WAYPOINT_CURRENT", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_current_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 2, 101); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 101); -} - -/** - * @brief Encode a waypoint_current struct into a 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 waypoint_current C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_current_t* waypoint_current) -{ - return mavlink_msg_waypoint_current_pack(system_id, component_id, msg, waypoint_current->seq); -} - -/** - * @brief Send a waypoint_current message - * @param chan MAVLink channel to send the message - * - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_current_send(mavlink_channel_t chan, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CURRENT, buf, 2, 101); -#else - mavlink_waypoint_current_t packet; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CURRENT, (const char *)&packet, 2, 101); -#endif -} - -#endif - -// MESSAGE WAYPOINT_CURRENT UNPACKING - - -/** - * @brief Get field seq from waypoint_current message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_current_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_current message into a struct - * - * @param msg The message to decode - * @param waypoint_current C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_current_decode(const mavlink_message_t* msg, mavlink_waypoint_current_t* waypoint_current) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_current->seq = mavlink_msg_waypoint_current_get_seq(msg); -#else - memcpy(waypoint_current, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_reached.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_reached.h deleted file mode 100644 index e1d64b4b66..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_reached.h +++ /dev/null @@ -1,144 +0,0 @@ -// MESSAGE WAYPOINT_REACHED PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REACHED 46 - -typedef struct __mavlink_waypoint_reached_t -{ - uint16_t seq; ///< Sequence -} mavlink_waypoint_reached_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REACHED_LEN 2 -#define MAVLINK_MSG_ID_46_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED { \ - "WAYPOINT_REACHED", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_reached_t, seq) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; - return mavlink_finalize_message(msg, system_id, component_id, 2, 21); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[2]; - _mav_put_uint16_t(buf, 0, seq); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REACHED; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 21); -} - -/** - * @brief Encode a waypoint_reached struct into a 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 waypoint_reached C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_reached_t* waypoint_reached) -{ - return mavlink_msg_waypoint_reached_pack(system_id, component_id, msg, waypoint_reached->seq); -} - -/** - * @brief Send a waypoint_reached message - * @param chan MAVLink channel to send the message - * - * @param seq Sequence - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_waypoint_reached_send(mavlink_channel_t chan, uint16_t seq) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[2]; - _mav_put_uint16_t(buf, 0, seq); - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REACHED, buf, 2, 21); -#else - mavlink_waypoint_reached_t packet; - packet.seq = seq; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REACHED, (const char *)&packet, 2, 21); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REACHED UNPACKING - - -/** - * @brief Get field seq from waypoint_reached message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_reached_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_reached message into a struct - * - * @param msg The message to decode - * @param waypoint_reached C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_reached_decode(const mavlink_message_t* msg, mavlink_waypoint_reached_t* waypoint_reached) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_reached->seq = mavlink_msg_waypoint_reached_get_seq(msg); -#else - memcpy(waypoint_reached, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request.h deleted file mode 100644 index b88f4dbfbe..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_REQUEST PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST 40 - -typedef struct __mavlink_waypoint_request_t -{ - uint16_t seq; ///< Sequence - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_request_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LEN 4 -#define MAVLINK_MSG_ID_40_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST { \ - "WAYPOINT_REQUEST", \ - 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_request_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_waypoint_request_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_waypoint_request_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_request_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; - return mavlink_finalize_message(msg, system_id, component_id, 4, 51); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_request_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 51); -} - -/** - * @brief Encode a waypoint_request struct into a 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 waypoint_request C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_request_t* waypoint_request) -{ - return mavlink_msg_waypoint_request_pack(system_id, component_id, msg, waypoint_request->target_system, waypoint_request->target_component, waypoint_request->seq); -} - -/** - * @brief Send a waypoint_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_waypoint_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[4]; - _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_WAYPOINT_REQUEST, buf, 4, 51); -#else - mavlink_waypoint_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_WAYPOINT_REQUEST, (const char *)&packet, 4, 51); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REQUEST UNPACKING - - -/** - * @brief Get field target_system from waypoint_request message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_request_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field target_component from waypoint_request message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_request_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field seq from waypoint_request message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_request_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_request message into a struct - * - * @param msg The message to decode - * @param waypoint_request C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_request_decode(const mavlink_message_t* msg, mavlink_waypoint_request_t* waypoint_request) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_request->seq = mavlink_msg_waypoint_request_get_seq(msg); - waypoint_request->target_system = mavlink_msg_waypoint_request_get_target_system(msg); - waypoint_request->target_component = mavlink_msg_waypoint_request_get_target_component(msg); -#else - memcpy(waypoint_request, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request_list.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request_list.h deleted file mode 100644 index 61e8d834bd..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_request_list.h +++ /dev/null @@ -1,166 +0,0 @@ -// MESSAGE WAYPOINT_REQUEST_LIST PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST 43 - -typedef struct __mavlink_waypoint_request_list_t -{ - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_request_list_t; - -#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST_LEN 2 -#define MAVLINK_MSG_ID_43_LEN 2 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST { \ - "WAYPOINT_REQUEST_LIST", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_request_list_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_request_list_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; - return mavlink_finalize_message(msg, system_id, component_id, 2, 213); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[2]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - - memcpy(_MAV_PAYLOAD(msg), buf, 2); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 2); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 213); -} - -/** - * @brief Encode a waypoint_request_list struct into a 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 waypoint_request_list C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_request_list_t* waypoint_request_list) -{ - return mavlink_msg_waypoint_request_list_pack(system_id, component_id, msg, waypoint_request_list->target_system, waypoint_request_list->target_component); -} - -/** - * @brief Send a waypoint_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_waypoint_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[2]; - _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_WAYPOINT_REQUEST_LIST, buf, 2, 213); -#else - mavlink_waypoint_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST, (const char *)&packet, 2, 213); -#endif -} - -#endif - -// MESSAGE WAYPOINT_REQUEST_LIST UNPACKING - - -/** - * @brief Get field target_system from waypoint_request_list message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_request_list_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field target_component from waypoint_request_list message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_request_list_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Decode a waypoint_request_list message into a struct - * - * @param msg The message to decode - * @param waypoint_request_list C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_request_list_decode(const mavlink_message_t* msg, mavlink_waypoint_request_list_t* waypoint_request_list) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_request_list->target_system = mavlink_msg_waypoint_request_list_get_target_system(msg); - waypoint_request_list->target_component = mavlink_msg_waypoint_request_list_get_target_component(msg); -#else - memcpy(waypoint_request_list, _MAV_PAYLOAD(msg), 2); -#endif -} diff --git a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_set_current.h b/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_set_current.h deleted file mode 100644 index e2c683ee3c..0000000000 --- a/libraries/GCS_MAVLink/include_v1.0/common/mavlink_msg_waypoint_set_current.h +++ /dev/null @@ -1,188 +0,0 @@ -// MESSAGE WAYPOINT_SET_CURRENT PACKING - -#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT 41 - -typedef struct __mavlink_waypoint_set_current_t -{ - uint16_t seq; ///< Sequence - uint8_t target_system; ///< System ID - uint8_t target_component; ///< Component ID -} mavlink_waypoint_set_current_t; - -#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT_LEN 4 -#define MAVLINK_MSG_ID_41_LEN 4 - - - -#define MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT { \ - "WAYPOINT_SET_CURRENT", \ - 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_waypoint_set_current_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_waypoint_set_current_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_waypoint_set_current_t, target_component) }, \ - } \ -} - - -/** - * @brief Pack a waypoint_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_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_set_current_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; - return mavlink_finalize_message(msg, system_id, component_id, 4, 80); -} - -/** - * @brief Pack a waypoint_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 was 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_waypoint_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[4]; - _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(msg), buf, 4); -#else - mavlink_waypoint_set_current_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - - memcpy(_MAV_PAYLOAD(msg), &packet, 4); -#endif - - msg->msgid = MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 80); -} - -/** - * @brief Encode a waypoint_set_current struct into a 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 waypoint_set_current C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_waypoint_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_set_current_t* waypoint_set_current) -{ - return mavlink_msg_waypoint_set_current_pack(system_id, component_id, msg, waypoint_set_current->target_system, waypoint_set_current->target_component, waypoint_set_current->seq); -} - -/** - * @brief Send a waypoint_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_waypoint_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[4]; - _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_WAYPOINT_SET_CURRENT, buf, 4, 80); -#else - mavlink_waypoint_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_WAYPOINT_SET_CURRENT, (const char *)&packet, 4, 80); -#endif -} - -#endif - -// MESSAGE WAYPOINT_SET_CURRENT UNPACKING - - -/** - * @brief Get field target_system from waypoint_set_current message - * - * @return System ID - */ -static inline uint8_t mavlink_msg_waypoint_set_current_get_target_system(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field target_component from waypoint_set_current message - * - * @return Component ID - */ -static inline uint8_t mavlink_msg_waypoint_set_current_get_target_component(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field seq from waypoint_set_current message - * - * @return Sequence - */ -static inline uint16_t mavlink_msg_waypoint_set_current_get_seq(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a waypoint_set_current message into a struct - * - * @param msg The message to decode - * @param waypoint_set_current C-struct to decode the message contents into - */ -static inline void mavlink_msg_waypoint_set_current_decode(const mavlink_message_t* msg, mavlink_waypoint_set_current_t* waypoint_set_current) -{ -#if MAVLINK_NEED_BYTE_SWAP - waypoint_set_current->seq = mavlink_msg_waypoint_set_current_get_seq(msg); - waypoint_set_current->target_system = mavlink_msg_waypoint_set_current_get_target_system(msg); - waypoint_set_current->target_component = mavlink_msg_waypoint_set_current_get_target_component(msg); -#else - memcpy(waypoint_set_current, _MAV_PAYLOAD(msg), 4); -#endif -} diff --git a/libraries/GCS_MAVLink/license.txt b/libraries/GCS_MAVLink/license.txt deleted file mode 100644 index 65c5ca88a6..0000000000 --- a/libraries/GCS_MAVLink/license.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/libraries/GCS_MAVLink/message_definitions/ardupilotmega.xml b/libraries/GCS_MAVLink/message_definitions/ardupilotmega.xml deleted file mode 100644 index c6019e03f2..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/ardupilotmega.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - common.xml - - - - - - - Enumeration of possible mount operation modes - Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop stabilization - Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM. - Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization - Load neutral position and start RC Roll,Pitch,Yaw control with stabilization - Load neutral position and start to point to Lat,Lon,Alt - - - - - - 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) - - - - 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 - - - - - 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 - - - - Mission command to control a camera or antenna mount - pitch(deg*100) or lat, depending on mount mode. - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - Empty - Empty - Empty - Empty - - - - - - - Disable fenced mode - - - Switched to guided mode to return point (fence point 0) - - - - - - No last fence breach - - - Breached minimum altitude - - - Breached minimum altitude - - - Breached fence boundary - - - - - - - Offsets and calibrations values for hardware - sensors. This makes it easier to debug the calibration process. - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - magnetic declination (radians) - raw pressure from barometer - raw temperature from barometer - gyro X calibration - gyro Y calibration - gyro Z calibration - accel X calibration - accel Y calibration - accel Z calibration - - - - set the magnetometer offsets - System ID - Component ID - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - - - - state of APM memory - heap top - free memory - - - - raw ADC output - ADC output 1 - ADC output 2 - ADC output 3 - ADC output 4 - ADC output 5 - ADC output 6 - - - - - Configure on-board Camera Control System. - System ID - Component ID - Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - Exposure type enumeration from 1 to N (0 means ignore) - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - Control on-board Camera Control System to take shots. - System ID - Component ID - 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - 1 to N //Zoom's absolute position (0 means ignore) - -100 to 100 //Zooming step value to offset zoom from the current position - 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - 0: ignore, 1: shot or start filming - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - - Message to configure a camera mount, directional antenna, etc. - System ID - Component ID - mount operating mode (see MAV_MOUNT_MODE enum) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - - - - Message to control a camera mount, directional antenna, etc. - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - - - - Message with some status from APM to GCS about camera or antenna mount - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - - - - - A fence point. Used to set a point when from - GCS -> MAV. Also used to return a point from MAV -> GCS - System ID - Component ID - point index (first point is 1, 0 is for return point) - total number of points (for sanity checking) - Latitude of point - Longitude of point - - - - Request a current fence point from MAV - System ID - Component ID - point index (first point is 1, 0 is for return point) - - - - Status of geo-fencing. Sent in extended - status stream when fencing enabled - 0 if currently inside fence, 1 if outside - number of fence breaches - last breach type (see FENCE_BREACH_* enum) - time of last breach in milliseconds since boot - - - - Status of DCM attitude estimator - X gyro drift estimate rad/s - Y gyro drift estimate rad/s - Z gyro drift estimate rad/s - average accel_weight - average renormalisation value - average error_roll_pitch value - average error_yaw value - - - - Status of simulation environment, if used - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - X acceleration m/s/s - Y acceleration m/s/s - Z acceleration m/s/s - Angular speed around X axis rad/s - Angular speed around Y axis rad/s - Angular speed around Z axis rad/s - - - - Status of key hardware - board voltage (mV) - I2C error count - - - - Status generated by radio - local signal strength - remote signal strength - how full the tx buffer is as a percentage - background noise level - remote background noise level - receive errors - count of error corrected packets - - - diff --git a/libraries/GCS_MAVLink/message_definitions/common.xml b/libraries/GCS_MAVLink/message_definitions/common.xml deleted file mode 100644 index dd4ea84430..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/common.xml +++ /dev/null @@ -1,941 +0,0 @@ - - - 2 - - - 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. - - Navigate to waypoint. - Hold time in decimal seconds. (ignored by fixed wing, time to stay at waypoint for rotary wing) - Acceptance radius in meters (if the sphere with this radius is hit, the waypoint 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 waypoint (rotary wing) - Latitude - Longitude - Altitude - - - Loiter around this waypoint an unlimited amount of time - Empty - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Loiter around this waypoint for X turns - Turns - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Loiter around this waypoint for X seconds - Seconds (decimal) - Empty - Radius around waypoint, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Return to launch location - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Land at location - Empty - Empty - Empty - Desired yaw angle. - Latitude - Longitude - Altitude - - - 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 - - - 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) - Waypoint 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 - - - 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 - - - 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 - - - Delay mission state machine. - Delay in seconds (decimal) - Empty - Empty - Empty - Empty - Empty - Empty - - - Ascend/descend at rate. Delay mission state machine until desired altitude reached. - Descent / Ascend rate (m/s) - Empty - Empty - Empty - Empty - Empty - Finish Altitude - - - Delay mission state machine until within desired distance of next NAV point. - Distance (meters) - Empty - Empty - Empty - Empty - Empty - Empty - - - 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 - - - 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 - - - Set system mode. - Mode, as defined by ENUM MAV_MODE - Empty - Empty - Empty - Empty - Empty - Empty - - - 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 - - - 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) - Empty - Empty - Empty - Empty - - - 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 - - - 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 - - - Set a relay to a condition. - Relay number - Setting (1=on, 0=off, others possible depending on system hardware) - Empty - Empty - Empty - Empty - Empty - - - 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 - - - Set a servo to a desired PWM value. - Servo number - PWM (microseconds, 1000 to 2000 typical) - Empty - Empty - Empty - Empty - Empty - - - 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 - - - Control onboard camera capturing. - 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 - - - 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 - devices such as cameras. - - Region of interest mode. (see MAV_ROI enum) - Waypoint index/ target ID. (see MAV_ROI enum) - ROI index (allows a vehicle to manage multiple cameras etc.) - Empty - x the location of the fixed ROI (see MAV_FRAME) - y - z - - - 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 - - - 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 - Empty - Empty - Empty - - - 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 - Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM - Reserved - Reserved - Empty - Empty - Empty - - - - Data stream IDs. 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. - - - Enable all data streams - - - Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. - - - Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS - - - Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW - - - Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. - - - Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. - - - Dependent on the autopilot - - - Dependent on the autopilot - - - Dependent on the autopilot - - - - 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). - - - No region of interest. - - - Point toward next waypoint. - - - Point toward given waypoint. - - - Point toward fixed location. - - - Point toward of given id. - - - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - MAVLink version - - - The boot message indicates that a system is starting. The onboard software version allows to keep track of onboard soft/firmware revisions. - The onboard software version - - - The system time is the time of the master clock, typically the computer clock of the main onboard computer. - Timestamp of the master clock in microseconds since UNIX epoch. - - - A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. - PING sequence - 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 - 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 - Unix timestamp in microseconds - - - UTC date and time from GPS module - GPS UTC date ddmmyy - GPS UTC time hhmmss - - - Request to control this MAV - System the GCS requests control for - 0: request control of this MAV, 1: Release control of this MAV - 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. - 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 "!?,.-" - - - Accept / deny control of this MAV - ID of the GCS this message - 0: request control of this MAV, 1: Release control of this MAV - 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - - - Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. - key - - - This message acknowledges an action. IMPORTANT: The acknowledgement can be also negative, e.g. the MAV rejects a reset message because it is in-flight. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The action id - 0: Action DENIED, 1: Action executed - - - An action message allows to execute a certain onboard action. These include liftoff, land, storing parameters too EEPROM, shutddown, etc. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The system executing the action - The component executing the action - The action id - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. - The system setting the mode - The new mode - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h. The navigation mode applies to the whole aircraft and thus all components. - The system setting the mode - The new navigation mode - - - Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. - System ID - Component ID - Onboard parameter id - Parameter index. Send -1 to use the param ID field as identifier - - - Request all parameters of this component. After his request, all parameters are emitted. - System ID - Component ID - - - Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. - Onboard parameter id - Onboard parameter value - Total number of onboard parameters - Index of this onboard parameter - - - Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. - System ID - Component ID - Onboard parameter id - Onboard parameter value - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - 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. - Latitude in 1E7 degrees - Longitude in 1E7 degrees - Altitude in 1E3 meters (millimeters) - GPS HDOP - GPS VDOP - GPS ground speed (m/s) - Compass heading in degrees, 0..360 degrees - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - Angular speed around X axis (millirad /sec) - Angular speed around Y axis (millirad /sec) - Angular speed around Z axis (millirad /sec) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X acceleration (raw) - Y acceleration (raw) - Z acceleration (raw) - Angular speed around X axis (raw) - Angular speed around Y axis (raw) - Angular speed around Z axis (raw) - X Magnetic field (raw) - Y Magnetic field (raw) - Z Magnetic field (raw) - - - The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (raw) - Differential pressure 1 (raw) - Differential pressure 2 (raw) - Raw Temperature measurement (raw) - - - The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Temperature measurement (0.01 degrees celsius) - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X Position - Y Position - Z Position - X Speed - Y Speed - Z Speed - - - The filtered global position (e.g. fused GPS and accelerometers). Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since unix epoch) - Latitude, in degrees - Longitude, in degrees - Absolute altitude, in meters - X Speed (in Latitude direction, positive: going north) - Y Speed (in Longitude direction, positive: going east) - Z Speed (in Altitude direction, positive: going up) - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame) - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - 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. - Latitude in degrees - Longitude in degrees - Altitude in meters - GPS HDOP - GPS VDOP - GPS ground speed - Compass heading in degrees, 0..360 degrees - - - The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - Battery voltage, in millivolts (1 = 1 millivolt) - Remaining battery energy: (0%: 0, 100%: 1000) - Dropped packets (packets that were corrupted on reception on the MAV) - - - The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - Receive signal strength indicator, 0: 0%, 255: 100% - - - The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - Receive signal strength indicator, 0: 0%, 255: 100% - - - The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. - Servo output 1 value, in microseconds - Servo output 2 value, in microseconds - Servo output 3 value, in microseconds - Servo output 4 value, in microseconds - Servo output 5 value, in microseconds - Servo output 6 value, in microseconds - Servo output 7 value, in microseconds - Servo output 8 value, in microseconds - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint and to set a waypoint on the system. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed, global frame is Z-up, right handed - System ID - Component ID - Sequence - The coordinate system of the waypoint. see MAV_FRAME in mavlink_types.h - The scheduled action for the waypoint. see MAV_COMMAND in common.xml MAVLink specs - false:0, true:1 - autocontinue to next wp - PARAM1 / For NAV command waypoints: Radius in which the waypoint is accepted as reached, in meters - PARAM2 / For NAV command waypoints: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - PARAM3 / For LOITER command waypoints: Orbit to circle around the waypoint, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - PARAM4 / For NAV and LOITER command waypoints: Yaw orientation in degrees, [0..360] 0 = NORTH - PARAM5 / local: x position, global: latitude - PARAM6 / y position: global: longitude - PARAM7 / z position: global: altitude - - - Request the information of the waypoint with the sequence number seq. The response of the system to this message should be a WAYPOINT message. - System ID - Component ID - Sequence - - - Set the waypoint with sequence number seq as current waypoint. This means that the MAV will continue to this waypoint on the shortest path (not following the waypoints in-between). - System ID - Component ID - Sequence - - - Message that announces the sequence number of the current active waypoint. The MAV will fly towards this waypoint. - Sequence - - - Request the overall list of waypoints from the system/component. - System ID - Component ID - - - This message is emitted as response to WAYPOINT_REQUEST_LIST by the MAV. The GCS can then request the individual waypoints based on the knowledge of the total number of waypoints. - System ID - Component ID - Number of Waypoints in the Sequence - - - Delete all waypoints at once. - System ID - Component ID - - - A certain waypoint has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. - Sequence - - - Ack message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - System ID - Component ID - 0: OK, 1: Error - - - As local waypoints exist, the global waypoint reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. - System ID - Component ID - global position * 1E7 - global position * 1E7 - global position * 1000 - - - Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position - Latitude (WGS84), expressed as * 1E7 - Longitude (WGS84), expressed as * 1E7 - Altitude(WGS84), expressed as * 1000 - - - Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/waypoint planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. - System ID - Component ID - x position - y position - z position - Desired yaw angle - - - Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. - x position - y position - z position - Desired yaw angle - - - Position fix: 0: lost, 2: 2D position fix, 3: 3D position fix - Vision position fix: 0: lost, 1: 2D local position hold, 2: 2D global position fix, 3: 3D global position fix - GPS position fix: 0: no reception, 1: Minimum 1 satellite, but no position fix, 2: 2D position fix, 3: 3D position fix - Attitude estimation health: 0: poor, 255: excellent - 0: Attitude control disabled, 1: enabled - 0: X, Y position control disabled, 1: enabled - 0: Z position control disabled, 1: enabled - 0: Yaw angle control disabled, 1: enabled - - - Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations. - System ID - Component ID - 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. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Read out the safety zone the MAV currently assumes. - 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. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Setpoint in roll, pitch, yaw currently active on the system. - Timestamp in micro seconds since unix epoch - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. - Timestamp in micro seconds since unix epoch - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Outputs of the APM navigation controller. The primary use of this message is to check the response and signs -of the controller before actual flight and to assist with tuning controller parameters - Current desired roll in degrees - Current desired pitch in degrees - Current desired heading in degrees - Bearing to current waypoint/target in degrees - Distance to active waypoint in meters - Current altitude error in meters - Current airspeed error in meters/second - Current crosstrack error on x-y plane in meters - - - The goal position of the system. This position is the input to any navigation or path planning algorithm and does NOT represent the current controller setpoint. - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. - x position error - y position error - z position error - roll error (radians) - pitch error (radians) - yaw error (radians) - x velocity - y velocity - z velocity - - - The system setting the altitude - The new altitude in meters - - - The target requested to send the message stream. - The target requested to send the message stream. - The ID of the requested message type - Update rate in Hertz - 1 to start sending, 0 to stop sending. - - - This packet is useful for high throughput - applications such as hardware in the loop simulations. - - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - - - Hardware in the loop control outputs - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Control output -3 .. 1 - Control output -1 .. 1 - Control output -1 .. 1 - Throttle 0 .. 1 - System mode (MAV_MODE) - Navigation mode (MAV_NAV_MODE) - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - System ID - Component ID - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - - - The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - - - Metrics typically displayed on a HUD for fixed wing aircraft - Current airspeed in m/s - Current ground speed in m/s - Current heading in degrees, in compass units (0..360, 0=north) - Current throttle setting in integer percent, 0 to 100 - Current altitude (MSL), in meters - Current climb rate in meters/second - - - Send a command with up to four parameters to the MAV - System which should execute the command - Component which should execute the command, 0 for all components - Command ID, as defined by MAV_CMD enum. - 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - Parameter 1, as defined by MAV_CMD enum. - Parameter 2, as defined by MAV_CMD enum. - Parameter 3, as defined by MAV_CMD enum. - Parameter 4, as defined by MAV_CMD enum. - - - Report status of a command. Includes feedback wether the command was executed - Current airspeed in m/s - 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION - - - Optical flow from a flow sensor (e.g. optical mouse sensor) - Timestamp (UNIX) - Sensor ID - Flow in pixels in x-sensor direction - Flow in pixels in y-sensor direction - Optical flow quality / confidence. 0: bad, 255: maximum quality - Ground distance in meters - - - Object has been detected - Timestamp in milliseconds since system boot - Object ID - Object type: 0: image, 1: letter, 2: ground vehicle, 3: air vehicle, 4: surface vehicle, 5: sub-surface vehicle, 6: human, 7: animal - Name of the object as defined by the detector - Detection quality / confidence. 0: bad, 255: maximum confidence - Angle of the object with respect to the body frame in NED coordinates in radians. 0: front - Ground distance in meters - - - - Name - Timestamp - x - y - z - - - Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Name of the debug variable - Floating point value - - - Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Name of the debug variable - Signed integer value - - - Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. - index of debug variable - DEBUG value - - - diff --git a/libraries/GCS_MAVLink/message_definitions/common_slugs.xml b/libraries/GCS_MAVLink/message_definitions/common_slugs.xml deleted file mode 100644 index 3ff7b5cab4..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/common_slugs.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - - - - The boot message indicates that a system is starting. The onboard software version allows to keep track of onboard soft/firmware revisions. - The onboard software version - - - - The system time is the time of the master clock, typically the computer clock of the main onboard computer. - Timestamp of the master clock in microseconds since UNIX epoch. - - - - A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. - PING sequence - 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 - 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 - Unix timestamp in microseconds - - - - An action message allows to execute a certain onboard action. These include liftoff, land, storing parameters too EEPROM, shutddown, etc. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The system executing the action - The component executing the action - The action id - - - - This message acknowledges an action. IMPORTANT: The acknowledgement can be also negative, e.g. the MAV rejects a reset message because it is in-flight. The action ids are defined in ENUM MAV_ACTION in mavlink/include/mavlink_types.h - The action id - 0: Action DENIED, 1: Action executed - - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. - The system setting the mode - The new mode - - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h. The navigation mode applies to the whole aircraft and thus all components. - The system setting the mode - The new navigation mode - - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. - Timestamp (microseconds since UNIX epoch) - X acceleration (mg raw) - Y acceleration (mg raw) - Z acceleration (mg raw) - Angular speed around X axis (adc units) - Angular speed around Y axis (adc units) - Angular speed around Z axis (adc units) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - - The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, unscaled ADC values. - Timestamp (microseconds since UNIX epoch) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Differential pressure 2 (hectopascal) - Raw Temperature measurement - - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - - The filtered local position (e.g. fused computer vision and accelerometers). - Timestamp (microseconds since unix epoch) - X Position - Y Position - Z Position - X Speed - Y Speed - Z Speed - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - Timestamp (microseconds since unix epoch) - 0-1: no fix, 2: 2D fix, 3: 3D fix - X Position - Y Position - Z Position in meters - Uncertainty in meters of latitude - Uncertainty in meters of longitude - Overall speed - Heading, in FIXME - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - - The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Battery voltage, in millivolts (1 = 1 millivolt) - Motor block status flag, 0: Motors can be switched on (and could be either off or on), 1: Mechanical motor block switch is on, motors cannot be switched on (and are definitely off) - Dropped packets (packets that were corrupted on reception on the MAV) - - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint. It cannot be used to set a waypoint, use WAYPOINT_SET for this purpose. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore y encodes in global mode the latitude, whereas x encodes the longitude and z the GPS altitude (WGS84). - System ID - Component ID - Sequence - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters. Set to 0 to fly straight through the waypoint - Direction of the orbit circling: 0: clockwise, 1: counter-clockwise - For waypoints of type 0 and 1: Radius in which the waypoint is accepted as reached, in meters - For waypoints of type 0 and 1: Time that the MAV should stay inside the orbit before advancing, in milliseconds - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - yaw orientation in radians, 0 = NORTH - autocontinue to next wp - - - - Request the information of the waypoint with the sequence number seq. The response of the system to this message should be a WAYPOINT message. - System ID - Component ID - Sequence - - - - Set the waypoint with sequence number seq as current waypoint. This means that the MAV will continue to this waypoint on the shortest path (not following the waypoints in-between). - System ID - Component ID - Sequence - - - - Message that announces the sequence number of the current active waypoint. The MAV will fly towards this waypoint. - Sequence - - - - This message is emitted as response to WAYPOINT_REQUEST_LIST by the MAV. The GCS can then request the individual waypoints based on the knowledge of the total number of waypoints. - System ID - Component ID - Number of Waypoints in the Sequence - - - - Delete all waypoints at once. - System ID - Component ID - - - - A certain waypoint has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. - Sequence - - - - Ack message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - System ID - Component ID - 0: OK, 1: Error - - - - As local waypoints exist, the global waypoint reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. - System ID - Component ID - global x position - global y position - global z position - global yaw orientation in radians, 0 = NORTH - local x position that matches the global x position - local y position that matches the global y position - local z position that matches the global z position - local yaw that matches the global yaw orientation - - - - - - - Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - - - Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. - index of debug variable - DEBUG value - - - - diff --git a/libraries/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml b/libraries/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml deleted file mode 100644 index 43f0a0435d..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/mavlink_standard_proposal.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - The heartbeat message just shows that a system is present. - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - - - - A ping message either requesting or responding to a ping. - PING sequence - 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 - 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 - Unix timestamp in microseconds - The onboard software version - - - - - System mode, see MAV_MODE ENUM in mavlink/include/mavlink_types.h - Navigation mode, see MAV_NAV_MODE ENUM - System status flag, see MAV_STATUS ENUM - Failure code description, see MAV_FAILURE ENUM - Motor block status flag - Dropped packets - - - - Set the system mode, as defined by enum MAV_MODE in mavlink/include/mavlink_types.h - The system setting the mode - The new mode - - - - Set the system navigation mode, as defined by enum MAV_NAV_MODE in mavlink/include/mavlink_types.h - The system setting the mode - The new navigation mode - - - - Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. - System ID - Component ID - Onboard parameter id - Onboard parameter value - - - - Set the current parameter value (currently active in RAM) PERMANTLY to EEPROM/HDD. It will be the new default value. - System ID - Component ID - Onboard parameter id - - - - Set PID values. - System ID - Component ID - PID ID - P - I - D - - - - Trim values to scale the RAW RC channel values. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - System ID - Component ID - RC channel id - RC channel 1 min value, in microseconds - RC channel 1 zero value, in microseconds - RC channel 1 max value, in microseconds - - - - Mapping defining which functions each RC channel has. - System ID - Component ID - RC channel id - RC channel function, as defined in ENUM MAVLINK_RC_CHAN_MAPPING in mavlink/include/mavlink_types.h - - - - Message setting a waypoint. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore x encodes in global mode the latitude, whereas y encodes the longitude and z the altitude over ground. - System ID - Component ID - Waypoint ID - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters - Time that the MAV should stay inside the orbit before advancing, in milliseconds - 0: No orbit, 1: Right Orbit, 2: Left Orbit - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - autocontinue to next wp - - - - System ID - Component ID - Waypoint ID - - - - System ID - Component ID - - - - The system executing the action - Component ID - The action id - - - - The system executing the action - Component ID - The id of the action being successfully executed and acknowledged - - - - Request to read the onboard parameters. - System ID - Component ID - Onboard parameter id - - - - Emit the value of a onboard parameter. - Onboard parameter id - Onboard parameter value - - - - Request all parameters of this component. - System ID - Component ID - 0: All parameters, else report a subset of parameters as defined in MAVLIN_SUBSET_PARAM enum - - - - Report PID controller values. - PID ID - P - I - D - - - - Report trim values to scale the RAW RC channel values. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel id - RC channel 1 min value, in microseconds - RC channel 1 zero value, in microseconds - RC channel 1 max value, in microseconds - - - - Report the mapping defining which functions each RC channel has. - RC channel id - RC channel function, as defined in ENUM MAVLINK_RC_CHAN_MAPPING in mavlink/include/mavlink_types.h - - - - Message encoding a waypoint. This message is emitted to announce - the presence of a waypoint. It cannot be used to set a waypoint, use WAYPOINT_SET for this purpose. The waypoint can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon. The global and body frame are related as: positive Z-down, positive X(front looking north, positive Y(body:right) looking east. Therefore x encodes in global mode the latitude, whereas y encodes the longitude and z the altitude over ground. - Waypoint ID - 0: global (GPS), 1: local, 2: global orbit, 3: local orbit - Orbit to circle around the waypoint, in meters - Time that the MAV should stay inside the orbit before advancing, in milliseconds - 0: No orbit, 1: Right Orbit, 2: Left Orbit - false:0, true:1 - local: x position, global: longitude - y position: global: latitude - z position: global: altitude - autocontinue to next wp - - - - Message emmited by a system to anounce eit - Waypoint ID - Waypoint status: 0: Ok, 1: Reached, 2: Orbit time expired, 254: Error - - - - X acceleration (mg raw) - Y acceleration (mg raw) - Z acceleration (mg raw) - Angular speed around X axis (adc units) - Angular speed around Y axis (adc units) - Angular speed around Z axis (adc units) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - - Timestamp (microseconds since UNIX epoch) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Differential pressure 2 (hectopascal) - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - 0-1: no fix, 2: 2D fix, 3: 3D fix - X Position - Y Position - Z Position in meters - Uncertainty in meters of latitude - Uncertainty in meters of longitude - Overall speed - Heading, in FIXME - - - - The global position, as returned by the Global Positioning System (GPS). This is -NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (microseconds) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - - The filtered local position (e.g. fused computer vision and accelerometers). - Position type: 0: Local, 1: Global - X (long) Position - Y (lat) Position - Z (alt) Position - Vx - Vy - Vz - - - - The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 3 value, in microseconds - RC channel 3 value, in microseconds - - - - - - - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - - - index of debug variable - DEBUG value - - - - \ No newline at end of file diff --git a/libraries/GCS_MAVLink/message_definitions/minimal.xml b/libraries/GCS_MAVLink/message_definitions/minimal.xml deleted file mode 100644 index 5b41a49090..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/minimal.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - 2 - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM - MAVLink version - - - diff --git a/libraries/GCS_MAVLink/message_definitions/pixhawk.xml b/libraries/GCS_MAVLink/message_definitions/pixhawk.xml deleted file mode 100644 index a9a51d6989..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/pixhawk.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - common.xml - - - Content Types for data transmission handshake - - - - - - - - Camera id - Camera mode: 0 = auto, 1 = manual - Trigger pin, 0-3 for PtGrey FireFly - Shutter interval, in microseconds - Exposure time, in microseconds - Camera gain - - - Timestamp - IMU seq - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - 0 to disable, 1 to enable - - - Camera id - Camera # (starts with 0) - Timestamp - Until which timestamp this buffer will stay valid - The image sequence number - Position of the image in the buffer, starts with 0 - Image width - Image height - Image depth - Image channels - Shared memory area key - Exposure time, in microseconds - Camera gain - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X speed - Global Y speed - Global Z speed - - - Message sent to the MAV to set a new position as reference for the controller - System ID - Component ID - ID of waypoint, 0 for plain position - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - Message sent to the MAV to set a new offset from the currently controlled position - System ID - Component ID - x position offset - y position offset - z position offset - yaw orientation offset in radians, 0 = NORTH - - - - ID of waypoint, 0 for plain position - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - ID - x position - y position - z position - roll orientation - pitch orientation - yaw orientation - - - ADC1 (J405 ADC3, LPC2148 AD0.6) - ADC2 (J405 ADC5, LPC2148 AD0.2) - ADC3 (J405 ADC6, LPC2148 AD0.1) - ADC4 (J405 ADC7, LPC2148 AD1.3) - Battery voltage - Temperature (degrees celcius) - Barometric pressure (hecto Pascal) - - - Watchdog ID - Number of processes - - - Watchdog ID - Process ID - Process name - Process arguments - Timeout (seconds) - - - Watchdog ID - Process ID - Is running / finished / suspended / crashed - Is muted - PID - Number of crashes - - - Target system ID - Watchdog ID - Process ID - Command ID - - - 0: Pattern, 1: Letter - Confidence of detection - Pattern file name - Accepted as true detection, 0 no, 1 yes - - - Notifies the operator about a point of interest (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X Position - Y Position - Z Position - POI name - - - Notifies the operator about the connection of two point of interests (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X1 Position - Y1 Position - Z1 Position - X2 Position - Y2 Position - Z2 Position - POI connection name - - - type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - total data size in bytes (set on ACK only) - number of packets beeing sent (set on ACK only) - payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - JPEG quality out of [1,100] - - - sequence number (starting with 0 on every transmission) - image data bytes - - - x position in m - y position in m - z position in m - Orientation assignment 0: false, 1:true - Size in pixels - Orientation - Descriptor - Harris operator response at this location - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - diff --git a/libraries/GCS_MAVLink/message_definitions/slugs.xml b/libraries/GCS_MAVLink/message_definitions/slugs.xml deleted file mode 100644 index f8644c5c4b..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/slugs.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - common.xml - - - - - - - Sensor and DSC control loads. - Sensor DSC Load - Control DSC Load - Battery Voltage in millivolts - - - - Air data for altitude and airspeed computation. - Dynamic pressure (Pa) - Static pressure (Pa) - Board temperature - - - - Accelerometer and gyro biases. - Accelerometer X bias (m/s) - Accelerometer Y bias (m/s) - Accelerometer Z bias (m/s) - Gyro X bias (rad/s) - Gyro Y bias (rad/s) - Gyro Z bias (rad/s) - - - - Configurable diagnostic messages. - Diagnostic float 1 - Diagnostic float 2 - Diagnostic float 3 - Diagnostic short 1 - Diagnostic short 2 - Diagnostic short 3 - - - - Data used in the navigation algorithm. - Measured Airspeed prior to the Nav Filter - Commanded Roll - Commanded Pitch - Commanded Turn rate - Y component of the body acceleration - Total Distance to Run on this leg of Navigation - Remaining distance to Run on this leg of Navigation - Origin WP - Destination WP - - - - Configurable data log probes to be used inside Simulink - Log value 1 - Log value 2 - Log value 3 - Log value 4 - Log value 5 - Log value 6 - - - - Pilot console PWM messges. - Year reported by Gps - Month reported by Gps - Day reported by Gps - Hour reported by Gps - Min reported by Gps - Sec reported by Gps - Visible sattelites reported by Gps - - - - Mid Level commands sent from the GS to the autopilot. These are only sent when being opperated in mid-level commands mode from the ground; for periodic report of these commands generated from the autopilot see message XXXX. - The system setting the commands - Commanded Airspeed - Log value 2 - Log value 3 - - - - - This message configures the Selective Passthrough mode. it allows to select which control surfaces the Pilot can control from his console. It is implemented as a bitfield as follows: - Position Bit Code - ================================= - 15-8 Reserved - 7 dt_pass 128 - 6 dla_pass 64 - 5 dra_pass 32 - 4 dr_pass 16 - 3 dle_pass 8 - 2 dre_pass 4 - 1 dlf_pass 2 - 0 drf_pass 1 - Where Bit 15 is the MSb. 0 = AP has control of the surface; 1 = Pilot Console has control of the surface. - The system setting the commands - Bitfield containing the PT configuration - - - - - - Action messages focused on the SLUGS AP. - The system reporting the action - Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names - Value associated with the action - - - - diff --git a/libraries/GCS_MAVLink/message_definitions/slugs_ap.xml b/libraries/GCS_MAVLink/message_definitions/slugs_ap.xml deleted file mode 100644 index 6b51a9f837..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/slugs_ap.xml +++ /dev/null @@ -1,152 +0,0 @@ - - -common_slugs.xml - - - Sensor and DSC control loads. - Sensor DSC Load - Control DSC Load - Battery Voltage in millivolts - - - - Air data for altitude and airspeed computation. - Dynamic pressure (Pa) - Static pressure (Pa) - Board temperature - - - - Accelerometer and gyro biases. - Accelerometer X bias (m/s) - Accelerometer Y bias (m/s) - Accelerometer Z bias (m/s) - Gyro X bias (rad/s) - Gyro Y bias (rad/s) - Gyro Z bias (rad/s) - - - - Configurable diagnostic messages. - Diagnostic float 1 - Diagnostic float 2 - Diagnostic float 3 - Diagnostic short 1 - Diagnostic short 2 - Diagnostic short 3 - - - - Pilot console PWM messges. - Pilot's console throttle command - Pilot's console left aileron command - Pilot's console right aileron command - Pilot's console rudder command - Pilot's console elevator command - - - - PWM Commands from the AP to the control surfaces. - AutoPilot's throttle command - AutoPilot's left aileron command - AutoPilot's right aileron command - AutoPilot's rudder command - AutoPilot's left elevator command - AutoPilot's right elevator command - AutoPilot's left flap command - AutoPilot's right flap command - AutoPilot's aux1 command - AutoPilot's aux2 command - - - - Data used in the navigation algorithm. - Measured Airspeed prior to the Nav Filter - Commanded Roll - Commanded Pitch - Commanded Turn rate - Y component of the body acceleration - Total Distance to Run on this leg of Navigation - Remaining distance to Run on this leg of Navigation - Origin WP - Destination WP - - - - Configurable data log probes to be used inside Simulink - Log value 1 - Log value 2 - Log value 3 - Log value 4 - Log value 5 - Log value 6 - - - - Measured value from the IMU in units after sensor calibration and temperature compensation. Note that this IS NOT the output of the attitude filter, for that see messages 30 and 33. - Accelerometer X value (m/s^2) - Accelerometer Y value (m/s^2) - Accelerometer Z value (m/s^2) - Gyro X value (rad/s) - Gyro Y value (rad/s) - Gyro Z value (rad/s) - Magnetometer X (normalized to 1) - Magnetometer Y (normalized to 1) - Magnetometer Z (normalized to 1) - - - - Pilot console PWM messges. - Year reported by Gps - Month reported by Gps - Day reported by Gps - Hour reported by Gps - Min reported by Gps - Sec reported by Gps - Visible sattelites reported by Gps - - - - Mid Level commands sent from the GS to the autopilot. These are only sent when being opperated in mid-level commands mode from the ground; for periodic report of these commands generated from the autopilot see message XXXX. - The system setting the commands - Commanded Airspeed - Log value 2 - Log value 3 - - - -This message configures the Selective Passthrough mode. it allows to select which control surfaces the Pilot can control from his console. It is implemented as a bitfield as follows: - Position Bit Code - ================================= - 15-8 Reserved - 7 dt_pass 128 - 6 dla_pass 64 - 5 dra_pass 32 - 4 dr_pass 16 - 3 dle_pass 8 - 2 dre_pass 4 - 1 dlf_pass 2 - 0 drf_pass 1 - Where Bit 15 is the MSb. 0 = AP has control of the surface; 1 = Pilot Console has control of the surface. - The system setting the commands - Bitfield containing the PT configuration - - - - Configure a PID loop. - The system setting the PID values - Proportional gain - Integral gain - Derivative gain - PID loop index - - - - Action messages focused on the SLUGS AP. - The system reporting the action - Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names - Value associated with the action - - - - \ No newline at end of file diff --git a/libraries/GCS_MAVLink/message_definitions/test.xml b/libraries/GCS_MAVLink/message_definitions/test.xml deleted file mode 100644 index 43a11e3d13..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 3 - - - Test all field types - char - string - uint8_t - uint16_t - uint32_t - uint64_t - int8_t - int16_t - int32_t - int64_t - float - double - uint8_t_array - uint16_t_array - uint32_t_array - uint64_t_array - int8_t_array - int16_t_array - int32_t_array - int64_t_array - float_array - double_array - - - diff --git a/libraries/GCS_MAVLink/message_definitions/ualberta.xml b/libraries/GCS_MAVLink/message_definitions/ualberta.xml deleted file mode 100644 index 5e53e141e9..0000000000 --- a/libraries/GCS_MAVLink/message_definitions/ualberta.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - common.xml - - - Available autopilot modes for ualberta uav - Raw input pulse widts sent to output - Inputs are normalized using calibration, the converted back to raw pulse widths for output - dfsdfs - dfsfds - dfsdfsdfs - - - Navigation filter mode - - AHRS mode - INS/GPS initialization mode - INS/GPS mode - - - Mode currently commanded by pilot - sdf - dfs - Rotomotion mode - - - - - Accelerometer and Gyro biases from the navigation filter - Timestamp (microseconds) - b_f[0] - b_f[1] - b_f[2] - b_f[0] - b_f[1] - b_f[2] - - - Complete set of calibration parameters for the radio - Aileron setpoints: left, center, right - Elevator setpoints: nose down, center, nose up - Rudder setpoints: nose left, center, nose right - Tail gyro mode/gain setpoints: heading hold, rate mode - Pitch curve setpoints (every 25%) - Throttle curve setpoints (every 25%) - - - System status specific to ualberta uav - System mode, see UALBERTA_AUTOPILOT_MODE ENUM - Navigation mode, see UALBERTA_NAV_MODE ENUM - Pilot mode, see UALBERTA_PILOT_MODE - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/ardupilotmega.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/ardupilotmega.xml deleted file mode 100644 index c6019e03f2..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/ardupilotmega.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - common.xml - - - - - - - Enumeration of possible mount operation modes - Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop stabilization - Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM. - Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization - Load neutral position and start RC Roll,Pitch,Yaw control with stabilization - Load neutral position and start to point to Lat,Lon,Alt - - - - - - 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) - - - - 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 - - - - - 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 - - - - Mission command to control a camera or antenna mount - pitch(deg*100) or lat, depending on mount mode. - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - Empty - Empty - Empty - Empty - - - - - - - Disable fenced mode - - - Switched to guided mode to return point (fence point 0) - - - - - - No last fence breach - - - Breached minimum altitude - - - Breached minimum altitude - - - Breached fence boundary - - - - - - - Offsets and calibrations values for hardware - sensors. This makes it easier to debug the calibration process. - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - magnetic declination (radians) - raw pressure from barometer - raw temperature from barometer - gyro X calibration - gyro Y calibration - gyro Z calibration - accel X calibration - accel Y calibration - accel Z calibration - - - - set the magnetometer offsets - System ID - Component ID - magnetometer X offset - magnetometer Y offset - magnetometer Z offset - - - - state of APM memory - heap top - free memory - - - - raw ADC output - ADC output 1 - ADC output 2 - ADC output 3 - ADC output 4 - ADC output 5 - ADC output 6 - - - - - Configure on-board Camera Control System. - System ID - Component ID - Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) - Divisor number //e.g. 1000 means 1/1000 (0 means ignore) - F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) - ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) - Exposure type enumeration from 1 to N (0 means ignore) - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - Control on-board Camera Control System to take shots. - System ID - Component ID - 0: stop, 1: start or keep it up //Session control e.g. show/hide lens - 1 to N //Zoom's absolute position (0 means ignore) - -100 to 100 //Zooming step value to offset zoom from the current position - 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus - 0: ignore, 1: shot or start filming - Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once - Extra parameters enumeration (0 means ignore) - Correspondent value to given extra_param - - - - - Message to configure a camera mount, directional antenna, etc. - System ID - Component ID - mount operating mode (see MAV_MOUNT_MODE enum) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - (1 = yes, 0 = no) - - - - Message to control a camera mount, directional antenna, etc. - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - - - - Message with some status from APM to GCS about camera or antenna mount - System ID - Component ID - pitch(deg*100) or lat, depending on mount mode - roll(deg*100) or lon depending on mount mode - yaw(deg*100) or alt (in cm) depending on mount mode - - - - - A fence point. Used to set a point when from - GCS -> MAV. Also used to return a point from MAV -> GCS - System ID - Component ID - point index (first point is 1, 0 is for return point) - total number of points (for sanity checking) - Latitude of point - Longitude of point - - - - Request a current fence point from MAV - System ID - Component ID - point index (first point is 1, 0 is for return point) - - - - Status of geo-fencing. Sent in extended - status stream when fencing enabled - 0 if currently inside fence, 1 if outside - number of fence breaches - last breach type (see FENCE_BREACH_* enum) - time of last breach in milliseconds since boot - - - - Status of DCM attitude estimator - X gyro drift estimate rad/s - Y gyro drift estimate rad/s - Z gyro drift estimate rad/s - average accel_weight - average renormalisation value - average error_roll_pitch value - average error_yaw value - - - - Status of simulation environment, if used - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - X acceleration m/s/s - Y acceleration m/s/s - Z acceleration m/s/s - Angular speed around X axis rad/s - Angular speed around Y axis rad/s - Angular speed around Z axis rad/s - - - - Status of key hardware - board voltage (mV) - I2C error count - - - - Status generated by radio - local signal strength - remote signal strength - how full the tx buffer is as a percentage - background noise level - remote background noise level - receive errors - count of error corrected packets - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/common.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/common.xml deleted file mode 100644 index 8af1eaa413..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/common.xml +++ /dev/null @@ -1,1536 +0,0 @@ - - - 3 - - - Micro air vehicle / autopilot classes. This identifies the individual model. - - Generic autopilot, full support for everything - - - PIXHAWK autopilot, http://pixhawk.ethz.ch - - - SLUGS autopilot, http://slugsuav.soe.ucsc.edu - - - ArduPilotMega / ArduCopter, http://diydrones.com - - - OpenPilot, http://openpilot.org - - - Generic autopilot only supporting simple waypoints - - - Generic autopilot supporting waypoints and other simple navigation commands - - - Generic autopilot supporting the full mission command set - - - No valid autopilot, e.g. a GCS or other MAVLink component - - - PPZ UAV - http://nongnu.org/paparazzi - - - UAV Dev Board - - - FlexiPilot - - - - - These flags encode the MAV mode. - - 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. - - - 0b01000000 remote control input is enabled. - - - 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. - - - 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. - - - 0b00001000 guided mode enabled, system flies MISSIONs / mission items. - - - 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. - - - 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. - - - 0b00000001 Reserved for future use. - - - - - 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. - - First bit: 10000000 - - - Second bit: 01000000 - - - Third bit: 00100000 - - - Fourth bit: 00010000 - - - Fifth bit: 00001000 - - - Sixt bit: 00000100 - - - Seventh bit: 00000010 - - - Eighth bit: 00000001 - - - - Override command, pauses current mission execution and moves immediately to a position - - Hold at the current position. - - - Continue with the next item in mission execution. - - - Hold at the current position of the system - - - Hold at the position specified in the parameters of the DO_HOLD action - - - - 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. - - System is not ready to fly, booting, calibrating, etc. No flag is set. - - - System is allowed to be active, under assisted RC control. - - - System is allowed to be active, under assisted RC control. - - - System is allowed to be active, under manual (RC) control, no stabilization - - - System is allowed to be active, under manual (RC) control, no stabilization - - - System is allowed to be active, under autonomous control, manual setpoint - - - System is allowed to be active, under autonomous control, manual setpoint - - - System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) - - - System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) - - - UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. - - - UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. - - - - - Uninitialized system, state is unknown. - - - System is booting up. - - - System is calibrating and not flight-ready. - - - System is grounded and on standby. It can be launched any time. - - - System is active and might be already airborne. Motors are engaged. - - - System is in a non-normal flight mode. It can however still navigate. - - - 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. - - - System just initialized its power-down sequence, will shut down now. - - - - - Generic micro air vehicle. - - - Fixed wing aircraft. - - - Quadrotor - - - Coaxial helicopter - - - Normal helicopter with tail rotor. - - - Ground installation - - - Operator control unit / ground control station - - - Airship, controlled - - - Free balloon, uncontrolled - - - Rocket - - - Ground rover - - - Surface vessel, boat, ship - - - Submarine - - - Hexarotor - - - Octorotor - - - Octorotor - - - Flapping wing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) - - - Local coordinate frame, Z-up (x: north, y: east, z: down). - - - NOT a coordinate frame, indicates a mission command. - - - 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. - - - Local coordinate frame, Z-down (x: east, y: north, z: up) - - - - - - - - - - - - - - - - - - - - - - - - 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. - - 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 - - - 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 - - - Loiter around this MISSION for X turns - Turns - Empty - Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Loiter around this MISSION for X seconds - Seconds (decimal) - Empty - Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise - Desired yaw angle. - Latitude - Longitude - Altitude - - - Return to launch location - Empty - Empty - Empty - Empty - Empty - Empty - Empty - - - Land at location - Empty - Empty - Empty - Desired yaw angle. - Latitude - Longitude - Altitude - - - 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 - - - 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 - - - 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 - - - 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 - - - Delay mission state machine. - Delay in seconds (decimal) - Empty - Empty - Empty - Empty - Empty - Empty - - - Ascend/descend at rate. Delay mission state machine until desired altitude reached. - Descent / Ascend rate (m/s) - Empty - Empty - Empty - Empty - Empty - Finish Altitude - - - Delay mission state machine until within desired distance of next NAV point. - Distance (meters) - Empty - Empty - Empty - Empty - Empty - Empty - - - 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 - - - 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 - - - Set system mode. - Mode, as defined by ENUM MAV_MODE - Empty - Empty - Empty - Empty - Empty - Empty - - - 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 - - - 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) - Empty - Empty - Empty - Empty - - - 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 - - - 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 - - - Set a relay to a condition. - Relay number - Setting (1=on, 0=off, others possible depending on system hardware) - Empty - Empty - Empty - Empty - Empty - - - 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 - - - Set a servo to a desired PWM value. - Servo number - PWM (microseconds, 1000 to 2000 typical) - Empty - Empty - Empty - Empty - Empty - - - 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 - - - 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 - - - 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 - - - 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 - Empty - Empty - Empty - - - 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 - 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 - - - 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 - Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM - Reserved - Reserved - Empty - Empty - Empty - - - Request the reboot or shutdown of system components. - 0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot. - 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer. - Reserved - Reserved - Empty - Empty - Empty - - - 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 - - - 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) - - - - Data stream IDs. 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. - - - Enable all data streams - - - Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. - - - Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS - - - Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW - - - Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. - - - Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. - - - Dependent on the autopilot - - - Dependent on the autopilot - - - Dependent on the autopilot - - - - 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). - - - No region of interest. - - - Point toward next MISSION. - - - Point toward given MISSION. - - - Point toward fixed location. - - - Point toward of given id. - - - - ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. - - Command / mission item is ok. - - - Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. - - - The system is refusing to accept this command from this source / communication partner. - - - Command or mission item is not supported, other commands would be accepted. - - - The coordinate frame of this command / mission item is not supported. - - - 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. - - - The X or latitude value is out of range. - - - The Y or longitude value is out of range. - - - The Z or altitude value is out of range. - - - - - type of a mavlink parameter - - 32 bit float - - - 8 bit unsigned integer - - - 8 bit signed integer - - - 16 bit unsigned integer - - - 16 bit signed integer - - - 32 bit unsigned integer - - - 32 bit signed integer - - - - - result from a mavlink command - - Command ACCEPTED and EXECUTED - - - Command TEMPORARY REJECTED/DENIED - - - Command PERMANENTLY DENIED - - - Command UNKNOWN/UNSUPPORTED - - - Command executed, but failed - - - - - result in a mavlink mission ack - - mission accepted OK - - - generic error / not accepting mission commands at all right now - - - coordinate frame is not supported - - - command is not supported - - - mission item exceeds storage space - - - one of the parameters has an invalid value - - - param1 has an invalid value - - - param2 has an invalid value - - - param3 has an invalid value - - - param4 has an invalid value - - - x/param5 has an invalid value - - - y/param6 has an invalid value - - - param7 has an invalid value - - - received waypoint out of sequence - - - not accepting any mission commands from this communication partner - - - - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Autopilot type / class. defined in MAV_CLASS ENUM - System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. - System status flag, see MAV_STATUS ENUM - MAVLink version - - - The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. - Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control - Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control - Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control - Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - Battery voltage, in millivolts (1 = 1 millivolt) - Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery - 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) - Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - Autopilot-specific errors - Autopilot-specific errors - Autopilot-specific errors - Autopilot-specific errors - - - - The system time is the time of the master clock, typically the computer clock of the main onboard computer. - Timestamp of the master clock in microseconds since UNIX epoch. - Timestamp of the component clock since boot time in milliseconds. - - - - A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. - Unix timestamp in microseconds - PING sequence - 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 - 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 - - - Request to control this MAV - System the GCS requests control for - 0: request control of this MAV, 1: Release control of this MAV - 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. - 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 "!?,.-" - - - Accept / deny control of this MAV - ID of the GCS this message - 0: request control of this MAV, 1: Release control of this MAV - 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control - - - Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. - key - - - Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. - The system setting the mode - The new base mode - The new autopilot-specific mode. This field can be ignored by an autopilot. - - - Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. - System ID - Component ID - Onboard parameter id - Parameter index. Send -1 to use the param ID field as identifier - - - Request all parameters of this component. After his request, all parameters are emitted. - System ID - Component ID - - - Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. - Onboard parameter id - Onboard parameter value - Onboard parameter type: see MAV_VAR enum - Total number of onboard parameters - Index of this onboard parameter - - - Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. - System ID - Component ID - Onboard parameter id - Onboard parameter value - Onboard parameter type: see MAV_VAR enum - - - The global position, as returned by the Global Positioning System (GPS). This is - NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame) - - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - 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. - Latitude in 1E7 degrees - Longitude in 1E7 degrees - Altitude in 1E3 meters (millimeters) above MSL - GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - GPS ground speed (m/s * 100). If unknown, set to: 65535 - Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - Number of satellites visible. If unknown, set to 255 - - - The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. - Number of satellites visible - Global satellite ID - 0: Satellite not used, 1: used for localization - Elevation (0: right on top of receiver, 90: on the horizon) of satellite - Direction of satellite, 0: 0 deg, 255: 360 deg. - Signal to noise ratio of satellite - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units - Timestamp (milliseconds since system boot) - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - Angular speed around X axis (millirad /sec) - Angular speed around Y axis (millirad /sec) - Angular speed around Z axis (millirad /sec) - X Magnetic field (milli tesla) - Y Magnetic field (milli tesla) - Z Magnetic field (milli tesla) - - - The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - X acceleration (raw) - Y acceleration (raw) - Z acceleration (raw) - Angular speed around X axis (raw) - Angular speed around Y axis (raw) - Angular speed around Z axis (raw) - X Magnetic field (raw) - Y Magnetic field (raw) - Z Magnetic field (raw) - - - The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (raw) - Differential pressure 1 (raw) - Differential pressure 2 (raw) - Raw Temperature measurement (raw) - - - The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Absolute pressure (hectopascal) - Differential pressure 1 (hectopascal) - Temperature measurement (0.01 degrees celsius) - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). - Timestamp (milliseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. - Timestamp (milliseconds since system boot) - Quaternion component 1 - Quaternion component 2 - Quaternion component 3 - Quaternion component 4 - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - - - The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) - Timestamp (milliseconds since system boot) - X Position - Y Position - Z Position - X Speed - Y Speed - Z Speed - - - The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It - is designed as scaled integer message since the resolution of float is not sufficient. - Timestamp (milliseconds since system boot) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters), above MSL - Altitude above ground in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - - - The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000 - Timestamp (milliseconds since system boot) - Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000 - Receive signal strength indicator, 0: 0%, 255: 100% - - - The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - Timestamp (milliseconds since system boot) - Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - Receive signal strength indicator, 0: 0%, 255: 100% - - - The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. - Timestamp (since UNIX epoch or microseconds since system boot) - Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - Servo output 1 value, in microseconds - Servo output 2 value, in microseconds - Servo output 3 value, in microseconds - Servo output 4 value, in microseconds - Servo output 5 value, in microseconds - Servo output 6 value, in microseconds - Servo output 7 value, in microseconds - Servo output 8 value, in microseconds - - - Request the overall list of MISSIONs from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol - System ID - Component ID - Start index, 0 by default - End index, -1 by default (-1: send list to end). Else a valid index of the list - - - This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! - System ID - Component ID - Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - End index, equal or greater than start index. - - - Message encoding a mission item. This message is emitted to announce - the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). http://qgroundcontrol.org/mavlink/waypoint_protocol - - System ID - Component ID - Sequence - The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - false:0, true:1 - autocontinue to next wp - PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters - PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds - PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise. - PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH - PARAM5 / local: x position, global: latitude - PARAM6 / y position: global: longitude - PARAM7 / z position: global: altitude - - - Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol - System ID - Component ID - Sequence - - - Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). - System ID - Component ID - Sequence - - - Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. - Sequence - - - Request the overall list of mission items from the system/component. - System ID - Component ID - - - This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. - System ID - Component ID - Number of mission items in the sequence - - - Delete all mission items at once. - System ID - Component ID - - - A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. - Sequence - - - Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - System ID - Component ID - See MAV_MISSION_RESULT enum - - - As local MISSIONs exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. - System ID - global position * 1E7 - global position * 1E7 - global position * 1000 - - - Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position - Latitude (WGS84), expressed as * 1E7 - Longitude (WGS84), expressed as * 1E7 - Altitude(WGS84), expressed as * 1000 - - - Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. - System ID - Component ID - Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU - x position - y position - z position - Desired yaw angle - - - Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. - Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU - x position - y position - z position - Desired yaw angle - - - Transmit the current local setpoint of the controller to other MAVs (collision avoidance) and to the GCS. - Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - WGS84 Latitude position in degrees * 1E7 - WGS84 Longitude position in degrees * 1E7 - WGS84 Altitude in meters * 1000 (positive for up) - Desired yaw angle in degrees * 100 - - - Set the current global position setpoint. - Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - WGS84 Latitude position in degrees * 1E7 - WGS84 Longitude position in degrees * 1E7 - WGS84 Altitude in meters * 1000 (positive for up) - Desired yaw angle in degrees * 100 - - - Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. - System ID - Component ID - 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. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Read out the safety zone the MAV currently assumes. - 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. - x position 1 / Latitude 1 - y position 1 / Longitude 1 - z position 1 / Altitude 1 - x position 2 / Latitude 2 - y position 2 / Longitude 2 - z position 2 / Altitude 2 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Set roll, pitch and yaw. - System ID - Component ID - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Setpoint in roll, pitch, yaw currently active on the system. - Timestamp in milliseconds since system boot - Desired roll angle in radians - Desired pitch angle in radians - Desired yaw angle in radians - Collective thrust, normalized to 0 .. 1 - - - Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. - Timestamp in milliseconds since system boot - Desired roll angular speed in rad/s - Desired pitch angular speed in rad/s - Desired yaw angular speed in rad/s - Collective thrust, normalized to 0 .. 1 - - - Outputs of the APM navigation controller. The primary use of this message is to check the response and signs - of the controller before actual flight and to assist with tuning controller parameters - - Current desired roll in degrees - Current desired pitch in degrees - Current desired heading in degrees - Bearing to current MISSION/target in degrees - Distance to active MISSION in meters - Current altitude error in meters - Current airspeed error in meters/second - Current crosstrack error on x-y plane in meters - - - Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. - x position error - y position error - z position error - roll error (radians) - pitch error (radians) - yaw error (radians) - x velocity - y velocity - z velocity - - - The target requested to send the message stream. - The target requested to send the message stream. - The ID of the requested data stream - The requested interval between two messages of this type - 1 to start sending, 0 to stop sending. - - - The ID of the requested data stream - The requested interval between two messages of this type - 1 stream is enabled, 0 stream is stopped. - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of -1 means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - System ID - Component ID - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - - - Metrics typically displayed on a HUD for fixed wing aircraft - Current airspeed in m/s - Current ground speed in m/s - Current heading in degrees, in compass units (0..360, 0=north) - Current throttle setting in integer percent, 0 to 100 - Current altitude (MSL), in meters - Current climb rate in meters/second - - - Send a command with up to four parameters to the MAV - System which should execute the command - Component which should execute the command, 0 for all components - Command ID, as defined by MAV_CMD enum. - 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - Parameter 1, as defined by MAV_CMD enum. - Parameter 2, as defined by MAV_CMD enum. - Parameter 3, as defined by MAV_CMD enum. - Parameter 4, as defined by MAV_CMD enum. - Parameter 5, as defined by MAV_CMD enum. - Parameter 6, as defined by MAV_CMD enum. - Parameter 7, as defined by MAV_CMD enum. - - - Report status of a command. Includes feedback wether the command was executed - Command ID, as defined by MAV_CMD enum. - See MAV_RESULT enum - - - - - Sent from simulation to autopilot. This packet is useful for high throughput - applications such as hardware in the loop simulations. - - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Roll angle (rad) - Pitch angle (rad) - Yaw angle (rad) - Roll angular speed (rad/s) - Pitch angular speed (rad/s) - Yaw angular speed (rad/s) - Latitude, expressed as * 1E7 - Longitude, expressed as * 1E7 - Altitude in meters, expressed as * 1000 (millimeters) - Ground X Speed (Latitude), expressed as m/s * 100 - Ground Y Speed (Longitude), expressed as m/s * 100 - Ground Z Speed (Altitude), expressed as m/s * 100 - X acceleration (mg) - Y acceleration (mg) - Z acceleration (mg) - - - Sent from autopilot to simulation. Hardware in the loop control outputs - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - Control output -1 .. 1 - Control output -1 .. 1 - Control output -1 .. 1 - Throttle 0 .. 1 - Aux 1, -1 .. 1 - Aux 2, -1 .. 1 - Aux 3, -1 .. 1 - Aux 4, -1 .. 1 - System mode (MAV_MODE) - Navigation mode (MAV_NAV_MODE) - - - Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. - Timestamp (microseconds since UNIX epoch or microseconds since system boot) - RC channel 1 value, in microseconds - RC channel 2 value, in microseconds - RC channel 3 value, in microseconds - RC channel 4 value, in microseconds - RC channel 5 value, in microseconds - RC channel 6 value, in microseconds - RC channel 7 value, in microseconds - RC channel 8 value, in microseconds - RC channel 9 value, in microseconds - RC channel 10 value, in microseconds - RC channel 11 value, in microseconds - RC channel 12 value, in microseconds - Receive signal strength indicator, 0: 0%, 255: 100% - - - Optical flow from a flow sensor (e.g. optical mouse sensor) - Timestamp (UNIX) - Sensor ID - Flow in pixels in x-sensor direction - Flow in pixels in y-sensor direction - Optical flow quality / confidence. 0: bad, 255: maximum quality - Ground distance in meters - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - Timestamp (milliseconds) - Global X speed - Global Y speed - Global Z speed - - - Timestamp (milliseconds) - Global X position - Global Y position - Global Z position - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - - - - Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Starting address of the debug variables - Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below - 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 - Memory contents at specified address - - - Name - Timestamp - x - y - z - - - Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Timestamp (milliseconds since system boot) - Name of the debug variable - Floating point value - - - Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - Timestamp (milliseconds since system boot) - Name of the debug variable - Signed integer value - - - Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). - Severity of status, 0 = info message, 255 = critical fault - Status text message, without null termination character - - - Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. - Timestamp (milliseconds since system boot) - index of debug variable - DEBUG value - - - Extended message spacer. - System which should execute the command - Component which should execute the command, 0 for all components - Retransmission / ACK flags - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/matrixpilot.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/matrixpilot.xml deleted file mode 100644 index 9e86eaf999..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/matrixpilot.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - common.xml - - - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/minimal.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/minimal.xml deleted file mode 100644 index 185a657de9..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/minimal.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 2 - - - - The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). - Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - Autopilot type / class. defined in MAV_CLASS ENUM - System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h - Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific. - System status flag, see MAV_STATUS ENUM - MAVLink version - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/pixhawk.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/pixhawk.xml deleted file mode 100644 index 75d536a12e..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/pixhawk.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - common.xml - - - Content Types for data transmission handshake - - - - - - - - Camera id - Camera mode: 0 = auto, 1 = manual - Trigger pin, 0-3 for PtGrey FireFly - Shutter interval, in microseconds - Exposure time, in microseconds - Camera gain - - - Timestamp - IMU seq - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - 0 to disable, 1 to enable - - - Camera id - Camera # (starts with 0) - Timestamp - Until which timestamp this buffer will stay valid - The image sequence number - Position of the image in the buffer, starts with 0 - Image width - Image height - Image depth - Image channels - Shared memory area key - Exposure time, in microseconds - Camera gain - Roll angle in rad - Pitch angle in rad - Yaw angle in rad - Local frame Z coordinate (height over ground) - GPS X coordinate - GPS Y coordinate - Global frame altitude - Ground truth X - Ground truth Y - Ground truth Z - - - Message sent to the MAV to set a new offset from the currently controlled position - System ID - Component ID - x position offset - y position offset - z position offset - yaw orientation offset in radians, 0 = NORTH - - - - ID of waypoint, 0 for plain position - x position - y position - z position - yaw orientation in radians, 0 = NORTH - - - ID - x position - y position - z position - roll orientation - pitch orientation - yaw orientation - - - ADC1 (J405 ADC3, LPC2148 AD0.6) - ADC2 (J405 ADC5, LPC2148 AD0.2) - ADC3 (J405 ADC6, LPC2148 AD0.1) - ADC4 (J405 ADC7, LPC2148 AD1.3) - Battery voltage - Temperature (degrees celcius) - Barometric pressure (hecto Pascal) - - - Watchdog ID - Number of processes - - - Watchdog ID - Process ID - Process name - Process arguments - Timeout (seconds) - - - Watchdog ID - Process ID - Is running / finished / suspended / crashed - Is muted - PID - Number of crashes - - - Target system ID - Watchdog ID - Process ID - Command ID - - - 0: Pattern, 1: Letter - Confidence of detection - Pattern file name - Accepted as true detection, 0 no, 1 yes - - - Notifies the operator about a point of interest (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X Position - Y Position - Z Position - POI name - - - Notifies the operator about the connection of two point of interests (POI). This can be anything detected by the - system. This generic message is intented to help interfacing to generic visualizations and to display - the POI on a map. - - 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug - 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta - 0: global, 1:local - 0: no timeout, >1: timeout in seconds - X1 Position - Y1 Position - Z1 Position - X2 Position - Y2 Position - Z2 Position - POI connection name - - - type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - total data size in bytes (set on ACK only) - number of packets beeing sent (set on ACK only) - payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - JPEG quality out of [1,100] - - - sequence number (starting with 0 on every transmission) - image data bytes - - - x position in m - y position in m - z position in m - Orientation assignment 0: false, 1:true - Size in pixels - Orientation - Descriptor - Harris operator response at this location - - - The system to be controlled - roll - pitch - yaw - thrust - roll control enabled auto:0, manual:1 - pitch auto:0, manual:1 - yaw auto:0, manual:1 - thrust auto:0, manual:1 - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/slugs.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/slugs.xml deleted file mode 100644 index f8644c5c4b..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/slugs.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - common.xml - - - - - - - Sensor and DSC control loads. - Sensor DSC Load - Control DSC Load - Battery Voltage in millivolts - - - - Air data for altitude and airspeed computation. - Dynamic pressure (Pa) - Static pressure (Pa) - Board temperature - - - - Accelerometer and gyro biases. - Accelerometer X bias (m/s) - Accelerometer Y bias (m/s) - Accelerometer Z bias (m/s) - Gyro X bias (rad/s) - Gyro Y bias (rad/s) - Gyro Z bias (rad/s) - - - - Configurable diagnostic messages. - Diagnostic float 1 - Diagnostic float 2 - Diagnostic float 3 - Diagnostic short 1 - Diagnostic short 2 - Diagnostic short 3 - - - - Data used in the navigation algorithm. - Measured Airspeed prior to the Nav Filter - Commanded Roll - Commanded Pitch - Commanded Turn rate - Y component of the body acceleration - Total Distance to Run on this leg of Navigation - Remaining distance to Run on this leg of Navigation - Origin WP - Destination WP - - - - Configurable data log probes to be used inside Simulink - Log value 1 - Log value 2 - Log value 3 - Log value 4 - Log value 5 - Log value 6 - - - - Pilot console PWM messges. - Year reported by Gps - Month reported by Gps - Day reported by Gps - Hour reported by Gps - Min reported by Gps - Sec reported by Gps - Visible sattelites reported by Gps - - - - Mid Level commands sent from the GS to the autopilot. These are only sent when being opperated in mid-level commands mode from the ground; for periodic report of these commands generated from the autopilot see message XXXX. - The system setting the commands - Commanded Airspeed - Log value 2 - Log value 3 - - - - - This message configures the Selective Passthrough mode. it allows to select which control surfaces the Pilot can control from his console. It is implemented as a bitfield as follows: - Position Bit Code - ================================= - 15-8 Reserved - 7 dt_pass 128 - 6 dla_pass 64 - 5 dra_pass 32 - 4 dr_pass 16 - 3 dle_pass 8 - 2 dre_pass 4 - 1 dlf_pass 2 - 0 drf_pass 1 - Where Bit 15 is the MSb. 0 = AP has control of the surface; 1 = Pilot Console has control of the surface. - The system setting the commands - Bitfield containing the PT configuration - - - - - - Action messages focused on the SLUGS AP. - The system reporting the action - Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names - Value associated with the action - - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/test.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/test.xml deleted file mode 100644 index 02bc03204d..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 3 - - - Test all field types - char - string - uint8_t - uint16_t - uint32_t - uint64_t - int8_t - int16_t - int32_t - int64_t - float - double - uint8_t_array - uint16_t_array - uint32_t_array - uint64_t_array - int8_t_array - int16_t_array - int32_t_array - int64_t_array - float_array - double_array - - - diff --git a/libraries/GCS_MAVLink/message_definitions_v1.0/ualberta.xml b/libraries/GCS_MAVLink/message_definitions_v1.0/ualberta.xml deleted file mode 100644 index 5e53e141e9..0000000000 --- a/libraries/GCS_MAVLink/message_definitions_v1.0/ualberta.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - common.xml - - - Available autopilot modes for ualberta uav - Raw input pulse widts sent to output - Inputs are normalized using calibration, the converted back to raw pulse widths for output - dfsdfs - dfsfds - dfsdfsdfs - - - Navigation filter mode - - AHRS mode - INS/GPS initialization mode - INS/GPS mode - - - Mode currently commanded by pilot - sdf - dfs - Rotomotion mode - - - - - Accelerometer and Gyro biases from the navigation filter - Timestamp (microseconds) - b_f[0] - b_f[1] - b_f[2] - b_f[0] - b_f[1] - b_f[2] - - - Complete set of calibration parameters for the radio - Aileron setpoints: left, center, right - Elevator setpoints: nose down, center, nose up - Rudder setpoints: nose left, center, nose right - Tail gyro mode/gain setpoints: heading hold, rate mode - Pitch curve setpoints (every 25%) - Throttle curve setpoints (every 25%) - - - System status specific to ualberta uav - System mode, see UALBERTA_AUTOPILOT_MODE ENUM - Navigation mode, see UALBERTA_NAV_MODE ENUM - Pilot mode, see UALBERTA_PILOT_MODE - - - diff --git a/libraries/GCS_MAVLink/missionlib/testing/.gitignore b/libraries/GCS_MAVLink/missionlib/testing/.gitignore deleted file mode 100644 index 0776965a63..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.o -udptest -build diff --git a/libraries/GCS_MAVLink/missionlib/testing/Makefile b/libraries/GCS_MAVLink/missionlib/testing/Makefile deleted file mode 100644 index 134aa47fc4..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -VERSION = 1.00 -CC = gcc -CFLAGS = -I ../../include/common -Wall -Werror -DVERSION=\"$(MAVLINK_VERSION)\" -std=c99 -LDFLAGS = "" - -OBJ = udp.o - -udptest: $(OBJ) - $(CC) $(CFLAGS) -o udptest $(OBJ) $(LDFLAGS) - -%.o: %.c - $(CC) $(CFLAGS) -c $< \ No newline at end of file diff --git a/libraries/GCS_MAVLink/missionlib/testing/main.c b/libraries/GCS_MAVLink/missionlib/testing/main.c deleted file mode 100644 index 0bec1155ad..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/main.c +++ /dev/null @@ -1,276 +0,0 @@ -/******************************************************************************* - - Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch - and Bryan Godbolt godbolt ( a t ) ualberta.ca - - adapted from example written by Bryan Godbolt godbolt ( a t ) ualberta.ca - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - ****************************************************************************/ -/* - This program sends some data to qgroundcontrol using the mavlink protocol. The sent packets - cause qgroundcontrol to respond with heartbeats. Any settings or custom commands sent from - qgroundcontrol are printed by this program along with the heartbeats. - - - I compiled this program sucessfully on Ubuntu 10.04 with the following command - - gcc -I ../../pixhawk/mavlink/include -o udp-server udp.c - - the rt library is needed for the clock_gettime on linux - */ -/* These headers are for QNX, but should all be standard on unix/linux */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if (defined __QNX__) | (defined __QNXNTO__) -/* QNX specific headers */ -#include -#else -/* Linux / MacOS POSIX timer headers */ -#include -#include -#include -#endif - -/* 0: Include MAVLink types */ -#include <../mavlink_types.h> - -/* 1: Define mavlink system storage */ -mavlink_system_t mavlink_system; - -/* 2: Include actual protocol, REQUIRES mavlink_system */ -#include - -/* 3: Define waypoint helper functions */ -void mavlink_wpm_send_message(mavlink_message_t* msg); -void mavlink_wpm_send_gcs_string(const char* string); -uint64_t mavlink_wpm_get_system_timestamp(); - -/* 4: Include waypoint protocol */ -#include "waypoints.h" -mavlink_wpm_storage wpm; - - -#define BUFFER_LENGTH 2041 // minimum buffer size that can be used with qnx (I don't know why) - -char help[] = "--help"; - - -char target_ip[100]; - -float position[6] = {}; -int sock; -struct sockaddr_in gcAddr; -struct sockaddr_in locAddr; -uint8_t buf[BUFFER_LENGTH]; -ssize_t recsize; -socklen_t fromlen; -int bytes_sent; -mavlink_message_t msg; -uint16_t len; -int i = 0; -unsigned int temp = 0; - -uint64_t microsSinceEpoch(); - - - - -/* Provide the interface functions for the waypoint manager */ - -/* - * @brief Sends a MAVLink message over UDP - */ -void mavlink_wpm_send_message(mavlink_message_t* msg) -{ - uint8_t buf[MAVLINK_MAX_PACKET_LEN]; - uint16_t len = mavlink_msg_to_send_buffer(buf, msg); - uint16_t bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof (struct sockaddr_in)); - - printf("SENT %d bytes", bytes_sent); -} - -void mavlink_wpm_send_gcs_string(const char* string) -{ - printf("%s",string); -} - -uint64_t mavlink_wpm_get_system_timestamp() -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec; -} - - - -int main(int argc, char* argv[]) -{ - // Initialize MAVLink - mavlink_wpm_init(&wpm); - mavlink_system.sysid = 1; - mavlink_system.compid = MAV_COMP_ID_WAYPOINTPLANNER; - - - - // Create socket - sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); - - // Check if --help flag was used - if ((argc == 2) && (strcmp(argv[1], help) == 0)) - { - printf("\n"); - printf("\tUsage:\n\n"); - printf("\t"); - printf("%s", argv[0]); - printf(" \n"); - printf("\tDefault for localhost: udp-server 127.0.0.1\n\n"); - exit(EXIT_FAILURE); - } - - - // Change the target ip if parameter was given - strcpy(target_ip, "127.0.0.1"); - if (argc == 2) - { - strcpy(target_ip, argv[1]); - } - - - memset(&locAddr, 0, sizeof(locAddr)); - locAddr.sin_family = AF_INET; - locAddr.sin_addr.s_addr = INADDR_ANY; - locAddr.sin_port = htons(14551); - - /* Bind the socket to port 14551 - necessary to receive packets from qgroundcontrol */ - if (-1 == bind(sock,(struct sockaddr *)&locAddr, sizeof(struct sockaddr))) - { - perror("error bind failed"); - close(sock); - exit(EXIT_FAILURE); - } - - /* Attempt to make it non blocking */ - if (fcntl(sock, F_SETFL, O_NONBLOCK | FASYNC) < 0) - { - fprintf(stderr, "error setting nonblocking: %s\n", strerror(errno)); - close(sock); - exit(EXIT_FAILURE); - } - - - memset(&gcAddr, 0, sizeof(gcAddr)); - gcAddr.sin_family = AF_INET; - gcAddr.sin_addr.s_addr = inet_addr(target_ip); - gcAddr.sin_port = htons(14550); - - - printf("MAVLINK MISSION LIBRARY EXAMPLE PROCESS INITIALIZATION DONE, RUNNING..\n"); - - - for (;;) - { - - /*Send Heartbeat */ - mavlink_msg_heartbeat_pack(mavlink_system.sysid, 200, &msg, MAV_HELICOPTER, MAV_CLASS_GENERIC); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - /* Send Status */ - mavlink_msg_sys_status_pack(1, 200, &msg, MAV_MODE_GUIDED, MAV_NAV_HOLD, MAV_STATE_ACTIVE, 500, 7500, 0, 0); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof (struct sockaddr_in)); - - /* Send Local Position */ - mavlink_msg_local_position_pack(mavlink_system.sysid, 200, &msg, microsSinceEpoch(), - position[0], position[1], position[2], - position[3], position[4], position[5]); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - /* Send attitude */ - mavlink_msg_attitude_pack(mavlink_system.sysid, 200, &msg, microsSinceEpoch(), 1.2, 1.7, 3.14, 0.01, 0.02, 0.03); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - - memset(buf, 0, BUFFER_LENGTH); - recsize = recvfrom(sock, (void *)buf, BUFFER_LENGTH, 0, (struct sockaddr *)&gcAddr, &fromlen); - if (recsize > 0) - { - // Something received - print out all bytes and parse packet - mavlink_message_t msg; - mavlink_status_t status; - - printf("Bytes Received: %d\nDatagram: ", (int)recsize); - for (i = 0; i < recsize; ++i) - { - temp = buf[i]; - printf("%02x ", (unsigned char)temp); - if (mavlink_parse_char(MAVLINK_COMM_0, buf[i], &msg, &status)) - { - // Packet received - printf("\nReceived packet: SYS: %d, COMP: %d, LEN: %d, MSG ID: %d\n", msg.sysid, msg.compid, msg.len, msg.msgid); - - // Handle packet with waypoint component - mavlink_wpm_message_handler(&msg); - - // Handle packet with parameter component - } - } - printf("\n"); - } - memset(buf, 0, BUFFER_LENGTH); - usleep(50000); // Sleep one second - } -} - - -/* QNX timer version */ -#if (defined __QNX__) | (defined __QNXNTO__) -uint64_t microsSinceEpoch() -{ - - struct timespec time; - - uint64_t micros = 0; - - clock_gettime(CLOCK_REALTIME, &time); - micros = (uint64_t)time.tv_sec * 100000 + time.tv_nsec/1000; - - return micros; -} -#else -uint64_t microsSinceEpoch() -{ - - struct timeval tv; - - uint64_t micros = 0; - - gettimeofday(&tv, NULL); - micros = ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec; - - return micros; -} -#endif \ No newline at end of file diff --git a/libraries/GCS_MAVLink/missionlib/testing/udp.c b/libraries/GCS_MAVLink/missionlib/testing/udp.c deleted file mode 100644 index dc096be51b..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udp.c +++ /dev/null @@ -1,1073 +0,0 @@ -/******************************************************************************* - - Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch - and Bryan Godbolt godbolt ( a t ) ualberta.ca - - adapted from example written by Bryan Godbolt godbolt ( a t ) ualberta.ca - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - ****************************************************************************/ -/* - This program sends some data to qgroundcontrol using the mavlink protocol. The sent packets - cause qgroundcontrol to respond with heartbeats. Any settings or custom commands sent from - qgroundcontrol are printed by this program along with the heartbeats. - - - I compiled this program sucessfully on Ubuntu 10.04 with the following command - - gcc -I ../../pixhawk/mavlink/include -o udp-server udp.c - - the rt library is needed for the clock_gettime on linux - */ -/* These headers are for QNX, but should all be standard on unix/linux */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if (defined __QNX__) | (defined __QNXNTO__) -/* QNX specific headers */ -#include -#else -/* Linux / MacOS POSIX timer headers */ -#include -#include -#include -#endif - -/* This assumes you have the mavlink headers on your include path - or in the same folder as this source file */ -#include - - -#define BUFFER_LENGTH 2041 // minimum buffer size that can be used with qnx (I don't know why) - -uint64_t microsSinceEpoch(); - - -// FIXME XXX - TO BE MOVED TO XML -enum MAVLINK_WPM_STATES -{ - MAVLINK_WPM_STATE_IDLE = 0, - MAVLINK_WPM_STATE_SENDLIST, - MAVLINK_WPM_STATE_SENDLIST_SENDWPS, - MAVLINK_WPM_STATE_GETLIST, - MAVLINK_WPM_STATE_GETLIST_GETWPS, - MAVLINK_WPM_STATE_GETLIST_GOTALL, - MAVLINK_WPM_STATE_ENUM_END -}; - -enum MAVLINK_WPM_CODES -{ - MAVLINK_WPM_CODE_OK = 0, - MAVLINK_WPM_CODE_ERR_WAYPOINT_ACTION_NOT_SUPPORTED, - MAVLINK_WPM_CODE_ERR_WAYPOINT_FRAME_NOT_SUPPORTED, - MAVLINK_WPM_CODE_ERR_WAYPOINT_OUT_OF_BOUNDS, - MAVLINK_WPM_CODE_ERR_WAYPOINT_MAX_NUMBER_EXCEEDED, - MAVLINK_WPM_CODE_ENUM_END -}; - - -/* WAYPOINT MANAGER - MISSION LIB */ - -#define MAVLINK_WPM_MAX_WP_COUNT 100 -#define MAVLINK_WPM_CONFIG_IN_FLIGHT_UPDATE ///< Enable double buffer and in-flight updates -#define MAVLINK_WPM_TEXT_FEEDBACK ///< Report back status information as text -#define MAVLINK_WPM_SYSTEM_ID 1 -#define MAVLINK_WPM_COMPONENT_ID 1 - -struct _mavlink_wpm_storage { - mavlink_waypoint_t waypoints[MAVLINK_WPM_MAX_WP_COUNT]; ///< Currently active waypoints -#ifdef MAVLINK_WPM_CONFIG_IN_FLIGHT_UPDATE - mavlink_waypoint_t rcv_waypoints[MAVLINK_WPM_MAX_WP_COUNT]; ///< Receive buffer for next waypoints -#endif - uint16_t count; - MAVLINK_WPM_STATES current_state; -} mavlink_wpm_storage; - - -void mavlink_wpm_init(mavlink_wpm_storage* state) -{ - // Set all waypoints to zero - - // Set count to zero - state->count = 0; - state->current_state = MAVLINK_WPM_STATE_IDLE; -} - - -PX_WAYPOINTPLANNER_STATES current_state = PX_WPP_IDLE; -uint16_t protocol_current_wp_id = 0; -uint16_t protocol_current_count = 0; -uint8_t protocol_current_partner_systemid = 0; -uint8_t protocol_current_partner_compid = 0; -uint64_t protocol_timestamp_lastaction = 0; - -uint64_t timestamp_last_send_setpoint = 0; - - -/* - * @brief Sends an waypoint ack message - */ -void mavlink_wpm_send_waypoint_ack(uint8_t target_systemid, uint8_t target_compid, uint8_t type) -{ - mavlink_message_t msg; - mavlink_waypoint_ack_t wpa; - - wpa.target_system = target_systemid; - wpa.target_component = target_compid; - wpa.type = type; - - mavlink_msg_waypoint_ack_encode(systemid, compid, &msg, &wpa); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); - - if (verbose) printf("Sent waypoint ack (%u) to ID %u\n", wpa.type, wpa.target_system); -} - -/* - * @brief Broadcasts the new target waypoint and directs the MAV to fly there - * - * This function broadcasts its new active waypoint sequence number and - * sends a message to the controller, advising it to fly to the coordinates - * of the waypoint with a given orientation - * - * @param seq The waypoint sequence number the MAV should fly to. - */ -void mavlink_wpm_send_waypoint_current(uint16_t seq) -{ - if(seq < waypoints->size()) - { - mavlink_waypoint_t *cur = waypoints->at(seq); - - mavlink_message_t msg; - mavlink_waypoint_current_t wpc; - - wpc.seq = cur->seq; - - mavlink_msg_waypoint_current_encode(systemid, compid, &msg, &wpc); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); - - if (verbose) printf("Broadcasted new current waypoint %u\n", wpc.seq); - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } -} - -/* - * @brief Directs the MAV to fly to a position - * - * Sends a message to the controller, advising it to fly to the coordinates - * of the waypoint with a given orientation - * - * @param seq The waypoint sequence number the MAV should fly to. - */ -void mavlink_wpm_send_setpoint(uint16_t seq) -{ - if(seq < waypoints->size()) - { - mavlink_waypoint_t *cur = waypoints->at(seq); - - mavlink_message_t msg; - mavlink_local_position_setpoint_set_t PControlSetPoint; - - // send new set point to local IMU - if (cur->frame == 1) - { - PControlSetPoint.target_system = systemid; - PControlSetPoint.target_component = MAV_COMP_ID_IMU; - PControlSetPoint.x = cur->x; - PControlSetPoint.y = cur->y; - PControlSetPoint.z = cur->z; - PControlSetPoint.yaw = cur->param4; - - mavlink_msg_local_position_setpoint_set_encode(systemid, compid, &msg, &PControlSetPoint); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (verbose) printf("No new set point sent to IMU because the new waypoint %u had no local coordinates\n", cur->seq); - } - - struct timeval tv; - gettimeofday(&tv, NULL); - uint64_t now = ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec; - timestamp_last_send_setpoint = now; - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } -} - -void mavlink_wpm_send_waypoint_count(uint8_t target_systemid, uint8_t target_compid, uint16_t count) -{ - mavlink_message_t msg; - mavlink_waypoint_count_t wpc; - - wpc.target_system = target_systemid; - wpc.target_component = target_compid; - wpc.count = count; - - mavlink_msg_waypoint_count_encode(systemid, compid, &msg, &wpc); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - - if (verbose) printf("Sent waypoint count (%u) to ID %u\n", wpc.count, wpc.target_system); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); -} - -void mavlink_wpm_send_waypoint(uint8_t target_systemid, uint8_t target_compid, uint16_t seq) -{ - if (seq < waypoints->size()) - { - mavlink_message_t msg; - mavlink_waypoint_t *wp = waypoints->at(seq); - wp->target_system = target_systemid; - wp->target_component = target_compid; - mavlink_msg_waypoint_encode(systemid, compid, &msg, wp); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - if (verbose) printf("Sent waypoint %u to ID %u\n", wp->seq, wp->target_system); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } -} - -void mavlink_wpm_send_waypoint_request(uint8_t target_systemid, uint8_t target_compid, uint16_t seq) -{ - if (seq < waypoints->size()) - { - mavlink_message_t msg; - mavlink_waypoint_request_t wpr; - wpr.target_system = target_systemid; - wpr.target_component = target_compid; - wpr.seq = seq; - mavlink_msg_waypoint_request_encode(systemid, compid, &msg, &wpr); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - if (verbose) printf("Sent waypoint request %u to ID %u\n", wpr.seq, wpr.target_system); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } -} - -/* - * @brief emits a message that a waypoint reached - * - * This function broadcasts a message that a waypoint is reached. - * - * @param seq The waypoint sequence number the MAV has reached. - */ -void mavlink_wpm_send_waypoint_reached(uint16_t seq) -{ - mavlink_message_t msg; - mavlink_waypoint_reached_t wp_reached; - - wp_reached.seq = seq; - - mavlink_msg_waypoint_reached_encode(systemid, compid, &msg, &wp_reached); - mavlink_message_t_publish(lcm, "MAVLINK", &msg); - - if (verbose) printf("Sent waypoint %u reached message\n", wp_reached.seq); - - usleep(paramClient->getParamValue("PROTOCOLDELAY")); -} - -float mavlink_wpm_distance_to_segment(uint16_t seq, float x, float y, float z) -{ - if (seq < waypoints->size()) - { - mavlink_waypoint_t *cur = waypoints->at(seq); - - const PxVector3 A(cur->x, cur->y, cur->z); - const PxVector3 C(x, y, z); - - // seq not the second last waypoint - if ((uint16_t)(seq+1) < waypoints->size()) - { - mavlink_waypoint_t *next = waypoints->at(seq+1); - const PxVector3 B(next->x, next->y, next->z); - const float r = (B-A).dot(C-A) / (B-A).lengthSquared(); - if (r >= 0 && r <= 1) - { - const PxVector3 P(A + r*(B-A)); - return (P-C).length(); - } - else if (r < 0.f) - { - return (C-A).length(); - } - else - { - return (C-B).length(); - } - } - else - { - return (C-A).length(); - } - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } - return -1.f; -} - -float mavlink_wpm_distance_to_point(uint16_t seq, float x, float y, float z) -{ - if (seq < waypoints->size()) - { - mavlink_waypoint_t *cur = waypoints->at(seq); - - const PxVector3 A(cur->x, cur->y, cur->z); - const PxVector3 C(x, y, z); - - return (C-A).length(); - } - else - { - if (verbose) printf("ERROR: index out of bounds\n"); - } - return -1.f; -} - - -static void mavlink_wpm_mavlink_handler(const lcm_recv_buf_t *rbuf, const char * channel, const mavlink_message_t* msg, void * user) -{ - // Handle param messages - paramClient->handleMAVLinkPacket(msg); - - //check for timed-out operations - struct timeval tv; - gettimeofday(&tv, NULL); - uint64_t now = ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec; - if (now-protocol_timestamp_lastaction > paramClient->getParamValue("PROTOCOLTIMEOUT") && current_state != PX_WPP_IDLE) - { - if (verbose) printf("Last operation (state=%u) timed out, changing state to PX_WPP_IDLE\n", current_state); - current_state = PX_WPP_IDLE; - protocol_current_count = 0; - protocol_current_partner_systemid = 0; - protocol_current_partner_compid = 0; - protocol_current_wp_id = -1; - - if(waypoints->size() == 0) - { - current_active_wp_id = -1; - } - } - - if(now-timestamp_last_send_setpoint > paramClient->getParamValue("SETPOINTDELAY") && current_active_wp_id < waypoints->size()) - { - send_setpoint(current_active_wp_id); - } - - switch(msg->msgid) - { - case MAVLINK_MSG_ID_ATTITUDE: - { - if(msg->sysid == systemid && current_active_wp_id < waypoints->size()) - { - mavlink_waypoint_t *wp = waypoints->at(current_active_wp_id); - if(wp->frame == 1) - { - mavlink_attitude_t att; - mavlink_msg_attitude_decode(msg, &att); - float yaw_tolerance = paramClient->getParamValue("YAWTOLERANCE"); - //compare current yaw - if (att.yaw - yaw_tolerance >= 0.0f && att.yaw + yaw_tolerance < 2.f*M_PI) - { - if (att.yaw - yaw_tolerance <= wp->param4 && att.yaw + yaw_tolerance >= wp->param4) - yawReached = true; - } - else if(att.yaw - yaw_tolerance < 0.0f) - { - float lowerBound = 360.0f + att.yaw - yaw_tolerance; - if (lowerBound < wp->param4 || wp->param4 < att.yaw + yaw_tolerance) - yawReached = true; - } - else - { - float upperBound = att.yaw + yaw_tolerance - 2.f*M_PI; - if (att.yaw - yaw_tolerance < wp->param4 || wp->param4 < upperBound) - yawReached = true; - } - } - } - break; - } - - case MAVLINK_MSG_ID_LOCAL_POSITION: - { - if(msg->sysid == systemid && current_active_wp_id < waypoints->size()) - { - mavlink_waypoint_t *wp = waypoints->at(current_active_wp_id); - - if(wp->frame == 1) - { - mavlink_local_position_t pos; - mavlink_msg_local_position_decode(msg, &pos); - if (debug) printf("Received new position: x: %f | y: %f | z: %f\n", pos.x, pos.y, pos.z); - - posReached = false; - - // compare current position (given in message) with current waypoint - float orbit = wp->param1; - - float dist; - if (wp->param2 == 0) - { - dist = distanceToSegment(current_active_wp_id, pos.x, pos.y, pos.z); - } - else - { - dist = distanceToPoint(current_active_wp_id, pos.x, pos.y, pos.z); - } - - if (dist >= 0.f && dist <= orbit && yawReached) - { - posReached = true; - } - } - } - break; - } - - case MAVLINK_MSG_ID_CMD: // special action from ground station - { - mavlink_cmd_t action; - mavlink_msg_cmd_decode(msg, &action); - if(action.target == systemid) - { - if (verbose) std::cerr << "Waypoint: received message with action " << action.action << std::endl; - switch (action.action) - { - // case MAV_ACTION_LAUNCH: - // if (verbose) std::cerr << "Launch received" << std::endl; - // current_active_wp_id = 0; - // if (waypoints->size()>0) - // { - // setActive(waypoints[current_active_wp_id]); - // } - // else - // if (verbose) std::cerr << "No launch, waypointList empty" << std::endl; - // break; - - // case MAV_ACTION_CONTINUE: - // if (verbose) std::c - // err << "Continue received" << std::endl; - // idle = false; - // setActive(waypoints[current_active_wp_id]); - // break; - - // case MAV_ACTION_HALT: - // if (verbose) std::cerr << "Halt received" << std::endl; - // idle = true; - // break; - - // default: - // if (verbose) std::cerr << "Unknown action received with id " << action.action << ", no action taken" << std::endl; - // break; - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_ACK: - { - mavlink_waypoint_ack_t wpa; - mavlink_msg_waypoint_ack_decode(msg, &wpa); - - if((msg->sysid == protocol_current_partner_systemid && msg->compid == protocol_current_partner_compid) && (wpa.target_system == systemid && wpa.target_component == compid)) - { - protocol_timestamp_lastaction = now; - - if (current_state == PX_WPP_SENDLIST || current_state == PX_WPP_SENDLIST_SENDWPS) - { - if (protocol_current_wp_id == waypoints->size()-1) - { - if (verbose) printf("Received Ack after having sent last waypoint, going to state PX_WPP_IDLE\n"); - current_state = PX_WPP_IDLE; - protocol_current_wp_id = 0; - } - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT: - { - mavlink_waypoint_set_current_t wpc; - mavlink_msg_waypoint_set_current_decode(msg, &wpc); - - if(wpc.target_system == systemid && wpc.target_component == compid) - { - protocol_timestamp_lastaction = now; - - if (current_state == PX_WPP_IDLE) - { - if (wpc.seq < waypoints->size()) - { - if (verbose) printf("Received MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT\n"); - current_active_wp_id = wpc.seq; - uint32_t i; - for(i = 0; i < waypoints->size(); i++) - { - if (i == current_active_wp_id) - { - waypoints->at(i)->current = true; - } - else - { - waypoints->at(i)->current = false; - } - } - if (verbose) printf("New current waypoint %u\n", current_active_wp_id); - yawReached = false; - posReached = false; - send_waypoint_current(current_active_wp_id); - send_setpoint(current_active_wp_id); - timestamp_firstinside_orbit = 0; - } - else - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT: Index out of bounds\n"); - } - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST: - { - mavlink_waypoint_request_list_t wprl; - mavlink_msg_waypoint_request_list_decode(msg, &wprl); - if(wprl.target_system == systemid && wprl.target_component == compid) - { - protocol_timestamp_lastaction = now; - - if (current_state == PX_WPP_IDLE || current_state == PX_WPP_SENDLIST) - { - if (waypoints->size() > 0) - { - if (verbose && current_state == PX_WPP_IDLE) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST from %u changing state to PX_WPP_SENDLIST\n", msg->sysid); - if (verbose && current_state == PX_WPP_SENDLIST) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST again from %u staying in state PX_WPP_SENDLIST\n", msg->sysid); - current_state = PX_WPP_SENDLIST; - protocol_current_wp_id = 0; - protocol_current_partner_systemid = msg->sysid; - protocol_current_partner_compid = msg->compid; - } - else - { - if (verbose) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST from %u but have no waypoints, staying in \n", msg->sysid); - } - protocol_current_count = waypoints->size(); - send_waypoint_count(msg->sysid,msg->compid, protocol_current_count); - } - else - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST because i'm doing something else already (state=%i).\n", current_state); - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_REQUEST: - { - mavlink_waypoint_request_t wpr; - mavlink_msg_waypoint_request_decode(msg, &wpr); - if(msg->sysid == protocol_current_partner_systemid && msg->compid == protocol_current_partner_compid && wpr.target_system == systemid && wpr.target_component == compid) - { - protocol_timestamp_lastaction = now; - - //ensure that we are in the correct state and that the first request has id 0 and the following requests have either the last id (re-send last waypoint) or last_id+1 (next waypoint) - if ((current_state == PX_WPP_SENDLIST && wpr.seq == 0) || (current_state == PX_WPP_SENDLIST_SENDWPS && (wpr.seq == protocol_current_wp_id || wpr.seq == protocol_current_wp_id + 1) && wpr.seq < waypoints->size())) - { - if (verbose && current_state == PX_WPP_SENDLIST) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u from %u changing state to PX_WPP_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); - if (verbose && current_state == PX_WPP_SENDLIST_SENDWPS && wpr.seq == protocol_current_wp_id + 1) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u from %u staying in state PX_WPP_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); - if (verbose && current_state == PX_WPP_SENDLIST_SENDWPS && wpr.seq == protocol_current_wp_id) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u (again) from %u staying in state PX_WPP_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); - - current_state = PX_WPP_SENDLIST_SENDWPS; - protocol_current_wp_id = wpr.seq; - send_waypoint(protocol_current_partner_systemid, protocol_current_partner_compid, wpr.seq); - } - else - { - if (verbose) - { - if (!(current_state == PX_WPP_SENDLIST || current_state == PX_WPP_SENDLIST_SENDWPS)) { printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because i'm doing something else already (state=%i).\n", current_state); break; } - else if (current_state == PX_WPP_SENDLIST) - { - if (wpr.seq != 0) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the first requested waypoint ID (%u) was not 0.\n", wpr.seq); - } - else if (current_state == PX_WPP_SENDLIST_SENDWPS) - { - if (wpr.seq != protocol_current_wp_id && wpr.seq != protocol_current_wp_id + 1) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the requested waypoint ID (%u) was not the expected (%u or %u).\n", wpr.seq, protocol_current_wp_id, protocol_current_wp_id+1); - else if (wpr.seq >= waypoints->size()) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the requested waypoint ID (%u) was out of bounds.\n", wpr.seq); - } - else printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST - FIXME: missed error description\n"); - } - } - } - else - { - //we we're target but already communicating with someone else - if((wpr.target_system == systemid && wpr.target_component == compid) && !(msg->sysid == protocol_current_partner_systemid && msg->compid == protocol_current_partner_compid)) - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST from ID %u because i'm already talking to ID %u.\n", msg->sysid, protocol_current_partner_systemid); - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_COUNT: - { - mavlink_waypoint_count_t wpc; - mavlink_msg_waypoint_count_decode(msg, &wpc); - if(wpc.target_system == systemid && wpc.target_component == compid) - { - protocol_timestamp_lastaction = now; - - if (current_state == PX_WPP_IDLE || (current_state == PX_WPP_GETLIST && protocol_current_wp_id == 0)) - { - if (wpc.count > 0) - { - if (verbose && current_state == PX_WPP_IDLE) printf("Got MAVLINK_MSG_ID_WAYPOINT_COUNT (%u) from %u changing state to PX_WPP_GETLIST\n", wpc.count, msg->sysid); - if (verbose && current_state == PX_WPP_GETLIST) printf("Got MAVLINK_MSG_ID_WAYPOINT_COUNT (%u) again from %u\n", wpc.count, msg->sysid); - - current_state = PX_WPP_GETLIST; - protocol_current_wp_id = 0; - protocol_current_partner_systemid = msg->sysid; - protocol_current_partner_compid = msg->compid; - protocol_current_count = wpc.count; - - printf("clearing receive buffer and readying for receiving waypoints\n"); - while(waypoints_receive_buffer->size() > 0) - { - delete waypoints_receive_buffer->back(); - waypoints_receive_buffer->pop_back(); - } - - send_waypoint_request(protocol_current_partner_systemid, protocol_current_partner_compid, protocol_current_wp_id); - } - else if (wpc.count == 0) - { - printf("got waypoint count of 0, clearing waypoint list and staying in state PX_WPP_IDLE\n"); - while(waypoints_receive_buffer->size() > 0) - { - delete waypoints->back(); - waypoints->pop_back(); - } - current_active_wp_id = -1; - yawReached = false; - posReached = false; - break; - - } - else - { - if (verbose) printf("Ignoring MAVLINK_MSG_ID_WAYPOINT_COUNT from %u with count of %u\n", msg->sysid, wpc.count); - } - } - else - { - if (verbose && !(current_state == PX_WPP_IDLE || current_state == PX_WPP_GETLIST)) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT because i'm doing something else already (state=%i).\n", current_state); - else if (verbose && current_state == PX_WPP_GETLIST && protocol_current_wp_id != 0) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT because i'm already receiving waypoint %u.\n", protocol_current_wp_id); - else printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT - FIXME: missed error description\n"); - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT: - { - mavlink_waypoint_t wp; - mavlink_msg_waypoint_decode(msg, &wp); - - if((msg->sysid == protocol_current_partner_systemid && msg->compid == protocol_current_partner_compid) && (wp.target_system == systemid && wp.target_component == compid)) - { - protocol_timestamp_lastaction = now; - - //ensure that we are in the correct state and that the first waypoint has id 0 and the following waypoints have the correct ids - if ((current_state == PX_WPP_GETLIST && wp.seq == 0) || (current_state == PX_WPP_GETLIST_GETWPS && wp.seq == protocol_current_wp_id && wp.seq < protocol_current_count)) - { - if (verbose && current_state == PX_WPP_GETLIST) printf("Got MAVLINK_MSG_ID_WAYPOINT %u from %u changing state to PX_WPP_GETLIST_GETWPS\n", wp.seq, msg->sysid); - if (verbose && current_state == PX_WPP_GETLIST_GETWPS && wp.seq == protocol_current_wp_id) printf("Got MAVLINK_MSG_ID_WAYPOINT %u from %u\n", wp.seq, msg->sysid); - if (verbose && current_state == PX_WPP_GETLIST_GETWPS && wp.seq-1 == protocol_current_wp_id) printf("Got MAVLINK_MSG_ID_WAYPOINT %u (again) from %u\n", wp.seq, msg->sysid); - - current_state = PX_WPP_GETLIST_GETWPS; - protocol_current_wp_id = wp.seq + 1; - mavlink_waypoint_t* newwp = new mavlink_waypoint_t; - memcpy(newwp, &wp, sizeof(mavlink_waypoint_t)); - waypoints_receive_buffer->push_back(newwp); - - if (verbose) printf ("Added new waypoint to list. X= %f\t Y= %f\t Z= %f\t Yaw= %f\n", newwp->x, newwp->y, newwp->z, newwp->param4); - - if(protocol_current_wp_id == protocol_current_count && current_state == PX_WPP_GETLIST_GETWPS) - { - if (verbose) printf("Got all %u waypoints, changing state to PX_WPP_IDLE\n", protocol_current_count); - - send_waypoint_ack(protocol_current_partner_systemid, protocol_current_partner_compid, 0); - - if (current_active_wp_id > waypoints_receive_buffer->size()-1) - { - current_active_wp_id = waypoints_receive_buffer->size() - 1; - } - - // switch the waypoints list - std::vector* waypoints_temp = waypoints; - waypoints = waypoints_receive_buffer; - waypoints_receive_buffer = waypoints_temp; - - //get the new current waypoint - uint32_t i; - for(i = 0; i < waypoints->size(); i++) - { - if (waypoints->at(i)->current == 1) - { - current_active_wp_id = i; - //if (verbose) printf("New current waypoint %u\n", current_active_wp_id); - yawReached = false; - posReached = false; - send_waypoint_current(current_active_wp_id); - send_setpoint(current_active_wp_id); - timestamp_firstinside_orbit = 0; - break; - } - } - - if (i == waypoints->size()) - { - current_active_wp_id = -1; - yawReached = false; - posReached = false; - timestamp_firstinside_orbit = 0; - } - - current_state = PX_WPP_IDLE; - } - else - { - send_waypoint_request(protocol_current_partner_systemid, protocol_current_partner_compid, protocol_current_wp_id); - } - } - else - { - if (current_state == PX_WPP_IDLE) - { - //we're done receiving waypoints, answer with ack. - send_waypoint_ack(protocol_current_partner_systemid, protocol_current_partner_compid, 0); - printf("Received MAVLINK_MSG_ID_WAYPOINT while state=PX_WPP_IDLE, answered with WAYPOINT_ACK.\n"); - } - if (verbose) - { - if (!(current_state == PX_WPP_GETLIST || current_state == PX_WPP_GETLIST_GETWPS)) { printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u because i'm doing something else already (state=%i).\n", wp.seq, current_state); break; } - else if (current_state == PX_WPP_GETLIST) - { - if(!(wp.seq == 0)) printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the first waypoint ID (%u) was not 0.\n", wp.seq); - else printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - else if (current_state == PX_WPP_GETLIST_GETWPS) - { - if (!(wp.seq == protocol_current_wp_id)) printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the waypoint ID (%u) was not the expected %u.\n", wp.seq, protocol_current_wp_id); - else if (!(wp.seq < protocol_current_count)) printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the waypoint ID (%u) was out of bounds.\n", wp.seq); - else printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - else printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - } - } - else - { - //we we're target but already communicating with someone else - if((wp.target_system == systemid && wp.target_component == compid) && !(msg->sysid == protocol_current_partner_systemid && msg->compid == protocol_current_partner_compid) && current_state != PX_WPP_IDLE) - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u from ID %u because i'm already talking to ID %u.\n", wp.seq, msg->sysid, protocol_current_partner_systemid); - } - else if(wp.target_system == systemid && wp.target_component == compid) - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u from ID %u because i have no idea what to do with it\n", wp.seq, msg->sysid); - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL: - { - mavlink_waypoint_clear_all_t wpca; - mavlink_msg_waypoint_clear_all_decode(msg, &wpca); - - if(wpca.target_system == systemid && wpca.target_component == compid && current_state == PX_WPP_IDLE) - { - protocol_timestamp_lastaction = now; - - if (verbose) printf("Got MAVLINK_MSG_ID_WAYPOINT_CLEAR_LIST from %u deleting all waypoints\n", msg->sysid); - while(waypoints->size() > 0) - { - delete waypoints->back(); - waypoints->pop_back(); - } - current_active_wp_id = -1; - yawReached = false; - posReached = false; - } - else if (wpca.target_system == systemid && wpca.target_component == compid && current_state != PX_WPP_IDLE) - { - if (verbose) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_CLEAR_LIST from %u because i'm doing something else already (state=%i).\n", msg->sysid, current_state); - } - break; - } - - default: - { - if (debug) std::cerr << "Waypoint: received message of unknown type" << std::endl; - break; - } - } - - //check if the current waypoint was reached - if ((posReached && /*yawReached &&*/ !idle)) - { - if (current_active_wp_id < waypoints->size()) - { - mavlink_waypoint_t *cur_wp = waypoints->at(current_active_wp_id); - - if (timestamp_firstinside_orbit == 0) - { - // Announce that last waypoint was reached - if (verbose) printf("*** Reached waypoint %u ***\n", cur_wp->seq); - send_waypoint_reached(cur_wp->seq); - timestamp_firstinside_orbit = now; - } - - // check if the MAV was long enough inside the waypoint orbit - //if (now-timestamp_lastoutside_orbit > (cur_wp->hold_time*1000)) - if(now-timestamp_firstinside_orbit >= cur_wp->param2*1000) - { - if (cur_wp->autocontinue) - { - cur_wp->current = 0; - if (current_active_wp_id == waypoints->size() - 1 && waypoints->size() > 1) - { - //the last waypoint was reached, if auto continue is - //activated restart the waypoint list from the beginning - current_active_wp_id = 1; - } - else - { - if ((uint16_t)(current_active_wp_id + 1) < waypoints->size()) - current_active_wp_id++; - } - - // Fly to next waypoint - timestamp_firstinside_orbit = 0; - send_waypoint_current(current_active_wp_id); - send_setpoint(current_active_wp_id); - waypoints->at(current_active_wp_id)->current = true; - posReached = false; - yawReached = false; - if (verbose) printf("Set new waypoint (%u)\n", current_active_wp_id); - } - } - } - } - else - { - timestamp_lastoutside_orbit = now; - } -} - - - - - - - - -int main(int argc, char* argv[]) -{ - - char help[] = "--help"; - - - char target_ip[100]; - - float position[6] = {}; - int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); - struct sockaddr_in gcAddr; - struct sockaddr_in locAddr; - //struct sockaddr_in fromAddr; - uint8_t buf[BUFFER_LENGTH]; - ssize_t recsize; - socklen_t fromlen; - int bytes_sent; - mavlink_message_t msg; - uint16_t len; - int i = 0; - //int success = 0; - unsigned int temp = 0; - - // Check if --help flag was used - if ((argc == 2) && (strcmp(argv[1], help) == 0)) - { - printf("\n"); - printf("\tUsage:\n\n"); - printf("\t"); - printf("%s", argv[0]); - printf(" \n"); - printf("\tDefault for localhost: udp-server 127.0.0.1\n\n"); - exit(EXIT_FAILURE); - } - - - // Change the target ip if parameter was given - strcpy(target_ip, "127.0.0.1"); - if (argc == 2) - { - strcpy(target_ip, argv[1]); - } - - - memset(&locAddr, 0, sizeof(locAddr)); - locAddr.sin_family = AF_INET; - locAddr.sin_addr.s_addr = INADDR_ANY; - locAddr.sin_port = htons(14551); - - /* Bind the socket to port 14551 - necessary to receive packets from qgroundcontrol */ - if (-1 == bind(sock,(struct sockaddr *)&locAddr, sizeof(struct sockaddr))) - { - perror("error bind failed"); - close(sock); - exit(EXIT_FAILURE); - } - - /* Attempt to make it non blocking */ - if (fcntl(sock, F_SETFL, O_NONBLOCK | FASYNC) < 0) - { - fprintf(stderr, "error setting nonblocking: %s\n", strerror(errno)); - close(sock); - exit(EXIT_FAILURE); - } - - - memset(&gcAddr, 0, sizeof(gcAddr)); - gcAddr.sin_family = AF_INET; - gcAddr.sin_addr.s_addr = inet_addr(target_ip); - gcAddr.sin_port = htons(14550); - - - printf("MAVLINK MISSION LIBRARY EXAMPLE PROCESS INITIALIZATION DONE, RUNNING..\n"); - - - for (;;) - { - - /*Send Heartbeat */ - mavlink_msg_heartbeat_pack(1, 200, &msg, MAV_TYPE_HELICOPTER, MAV_CLASS_GENERIC); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - /* Send Status */ - mavlink_msg_sys_status_pack(1, 200, &msg, MAV_MODE_GUIDED, MAV_NAV_HOLD, MAV_STATE_ACTIVE, 500, 7500, 0, 0); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof (struct sockaddr_in)); - - /* Send Local Position */ - mavlink_msg_local_position_pack(1, 200, &msg, microsSinceEpoch(), - position[0], position[1], position[2], - position[3], position[4], position[5]); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - /* Send attitude */ - mavlink_msg_attitude_pack(1, 200, &msg, microsSinceEpoch(), 1.2, 1.7, 3.14, 0.01, 0.02, 0.03); - len = mavlink_msg_to_send_buffer(buf, &msg); - bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in)); - - - memset(buf, 0, BUFFER_LENGTH); - recsize = recvfrom(sock, (void *)buf, BUFFER_LENGTH, 0, (struct sockaddr *)&gcAddr, &fromlen); - if (recsize > 0) - { - // Something received - print out all bytes and parse packet - mavlink_message_t msg; - mavlink_status_t status; - - printf("Bytes Received: %d\nDatagram: ", (int)recsize); - for (i = 0; i < recsize; ++i) - { - temp = buf[i]; - printf("%02x ", (unsigned char)temp); - if (mavlink_parse_char(MAVLINK_COMM_0, buf[i], &msg, &status)) - { - // Packet received - printf("\nReceived packet: SYS: %d, COMP: %d, LEN: %d, MSG ID: %d\n", msg.sysid, msg.compid, msg.len, msg.msgid); - } - } - printf("\n"); - } - memset(buf, 0, BUFFER_LENGTH); - sleep(1); // Sleep one second - } -} - - -/* QNX timer version */ -#if (defined __QNX__) | (defined __QNXNTO__) -uint64_t microsSinceEpoch() -{ - - struct timespec time; - - uint64_t micros = 0; - - clock_gettime(CLOCK_REALTIME, &time); - micros = (uint64_t)time.tv_sec * 100000 + time.tv_nsec/1000; - - return micros; -} -#else -uint64_t microsSinceEpoch() -{ - - struct timeval tv; - - uint64_t micros = 0; - - gettimeofday(&tv, NULL); - micros = ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec; - - return micros; -} -#endif \ No newline at end of file diff --git a/libraries/GCS_MAVLink/missionlib/testing/udptest.1 b/libraries/GCS_MAVLink/missionlib/testing/udptest.1 deleted file mode 100644 index 78b31915f7..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udptest.1 +++ /dev/null @@ -1,79 +0,0 @@ -.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. -.\"See Also: -.\"man mdoc.samples for a complete listing of options -.\"man mdoc for the short list of editing options -.\"/usr/share/misc/mdoc.template -.Dd 01.08.11 \" DATE -.Dt udptest 1 \" Program name and manual section number -.Os Darwin -.Sh NAME \" Section Header - required - don't modify -.Nm udptest, -.\" The following lines are read in generating the apropos(man -k) database. Use only key -.\" words here as the database is built based on the words here and in the .ND line. -.Nm Other_name_for_same_program(), -.Nm Yet another name for the same program. -.\" Use .Nm macro to designate other names for the documented program. -.Nd This line parsed for whatis database. -.Sh SYNOPSIS \" Section Header - required - don't modify -.Nm -.Op Fl abcd \" [-abcd] -.Op Fl a Ar path \" [-a path] -.Op Ar file \" [file] -.Op Ar \" [file ...] -.Ar arg0 \" Underlined argument - use .Ar anywhere to underline -arg2 ... \" Arguments -.Sh DESCRIPTION \" Section Header - required - don't modify -Use the .Nm macro to refer to your program throughout the man page like such: -.Nm -Underlining is accomplished with the .Ar macro like this: -.Ar underlined text . -.Pp \" Inserts a space -A list of items with descriptions: -.Bl -tag -width -indent \" Begins a tagged list -.It item a \" Each item preceded by .It macro -Description of item a -.It item b -Description of item b -.El \" Ends the list -.Pp -A list of flags and their descriptions: -.Bl -tag -width -indent \" Differs from above in tag removed -.It Fl a \"-a flag as a list item -Description of -a flag -.It Fl b -Description of -b flag -.El \" Ends the list -.Pp -.\" .Sh ENVIRONMENT \" May not be needed -.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 -.\" .It Ev ENV_VAR_1 -.\" Description of ENV_VAR_1 -.\" .It Ev ENV_VAR_2 -.\" Description of ENV_VAR_2 -.\" .El -.Sh FILES \" File used or created by the topic of the man page -.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact -.It Pa /usr/share/file_name -FILE_1 description -.It Pa /Users/joeuser/Library/really_long_file_name -FILE_2 description -.El \" Ends the list -.\" .Sh DIAGNOSTICS \" May not be needed -.\" .Bl -diag -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .El -.Sh SEE ALSO -.\" List links in ascending order by section, alphabetically within a section. -.\" Please do not reference files that do not exist without filing a bug report -.Xr a 1 , -.Xr b 1 , -.Xr c 1 , -.Xr a 2 , -.Xr b 2 , -.Xr a 3 , -.Xr b 3 -.\" .Sh BUGS \" Document known, unremedied bugs -.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/.gitignore b/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/.gitignore deleted file mode 100644 index d82a5e47de..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.mode1v3 -*.pbxuser diff --git a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/project.pbxproj b/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/project.pbxproj deleted file mode 100644 index ba27d2f32e..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/project.pbxproj +++ /dev/null @@ -1,217 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 34E8AFDB13F5064C001100AA /* waypoints.c in Sources */ = {isa = PBXBuildFile; fileRef = 34E8AFDA13F5064C001100AA /* waypoints.c */; }; - 8DD76FAC0486AB0100D96B5E /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.c */; settings = {ATTRIBUTES = (); }; }; - 8DD76FB00486AB0100D96B5E /* udptest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6A0FF2C0290799A04C91782 /* udptest.1 */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76FAF0486AB0100D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - 8DD76FB00486AB0100D96B5E /* udptest.1 in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 08FB7796FE84155DC02AAC07 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; - 34E8AFDA13F5064C001100AA /* waypoints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = waypoints.c; path = ../waypoints.c; sourceTree = SOURCE_ROOT; }; - 34E8AFDC13F50659001100AA /* waypoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waypoints.h; path = ../waypoints.h; sourceTree = SOURCE_ROOT; }; - 8DD76FB20486AB0100D96B5E /* udptest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = udptest; sourceTree = BUILT_PRODUCTS_DIR; }; - C6A0FF2C0290799A04C91782 /* udptest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = udptest.1; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76FAD0486AB0100D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* udptest */ = { - isa = PBXGroup; - children = ( - 34E8AFDC13F50659001100AA /* waypoints.h */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = udptest; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 34E8AFDA13F5064C001100AA /* waypoints.c */, - 08FB7796FE84155DC02AAC07 /* main.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FB20486AB0100D96B5E /* udptest */, - ); - name = Products; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - C6A0FF2C0290799A04C91782 /* udptest.1 */, - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* udptest */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "udptest" */; - buildPhases = ( - 8DD76FAB0486AB0100D96B5E /* Sources */, - 8DD76FAD0486AB0100D96B5E /* Frameworks */, - 8DD76FAF0486AB0100D96B5E /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = udptest; - productInstallPath = "$(HOME)/bin"; - productName = udptest; - productReference = 8DD76FB20486AB0100D96B5E /* udptest */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "udptest" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* udptest */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76FA90486AB0100D96B5E /* udptest */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76FAB0486AB0100D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8DD76FAC0486AB0100D96B5E /* main.c in Sources */, - 34E8AFDB13F5064C001100AA /* waypoints.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB928608733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = udptest; - }; - name = Debug; - }; - 1DEB928708733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = udptest; - }; - name = Release; - }; - 1DEB928A08733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ../../include/common/; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SDKROOT = macosx10.6; - }; - name = Debug; - }; - 1DEB928B08733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = macosx10.6; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "udptest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928608733DD80010E9CD /* Debug */, - 1DEB928708733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "udptest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928A08733DD80010E9CD /* Debug */, - 1DEB928B08733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.mode1v3 b/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.mode1v3 deleted file mode 100644 index 2bf1029cec..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.mode1v3 +++ /dev/null @@ -1,1440 +0,0 @@ - - - - - ActivePerspectiveName - Project - AllowedModules - - - BundleLoadPath - - MaxInstances - n - Module - PBXSmartGroupTreeModule - Name - Groups and Files Outline View - - - BundleLoadPath - - MaxInstances - n - Module - PBXNavigatorGroup - Name - Editor - - - BundleLoadPath - - MaxInstances - n - Module - XCTaskListModule - Name - Task List - - - BundleLoadPath - - MaxInstances - n - Module - XCDetailModule - Name - File and Smart Group Detail Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXBuildResultsModule - Name - Detailed Build Results Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXProjectFindModule - Name - Project Batch Find Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCProjectFormatConflictsModule - Name - Project Format Conflicts List - - - BundleLoadPath - - MaxInstances - n - Module - PBXBookmarksModule - Name - Bookmarks Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXClassBrowserModule - Name - Class Browser - - - BundleLoadPath - - MaxInstances - n - Module - PBXCVSModule - Name - Source Code Control Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXDebugBreakpointsModule - Name - Debug Breakpoints Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCDockableInspector - Name - Inspector - - - BundleLoadPath - - MaxInstances - n - Module - PBXOpenQuicklyModule - Name - Open Quickly Tool - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugSessionModule - Name - Debugger - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugCLIModule - Name - Debug Console - - - BundleLoadPath - - MaxInstances - n - Module - XCSnapshotModule - Name - Snapshots Tool - - - BundlePath - /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources - Description - DefaultDescriptionKey - DockingSystemVisible - - Extension - mode1v3 - FavBarConfig - - PBXProjectModuleGUID - CEA4FF3213E6BD8E002506EF - XCBarModuleItemNames - - XCBarModuleItems - - - FirstTimeWindowDisplayed - - Identifier - com.apple.perspectives.project.mode1v3 - MajorVersion - 33 - MinorVersion - 0 - Name - Default - Notifications - - OpenEditors - - - Content - - PBXProjectModuleGUID - CED081F713E6F90000BAE9DD - PBXProjectModuleLabel - px_waypointplanner.cc - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - CED081F813E6F90000BAE9DD - PBXProjectModuleLabel - px_waypointplanner.cc - _historyCapacity - 0 - bookmark - CED081FB13E6F90000BAE9DD - history - - CED081F913E6F90000BAE9DD - - - SplitCount - 1 - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {995, 634}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 15 103 995 675 0 0 1280 778 - - - - PerspectiveWidths - - -1 - -1 - - Perspectives - - - ChosenToolbarItems - - active-combo-popup - action - NSToolbarFlexibleSpaceItem - debugger-enable-breakpoints - build-and-go - com.apple.ide.PBXToolbarStopButton - get-info - NSToolbarFlexibleSpaceItem - com.apple.pbx.toolbar.searchfield - - ControllerClassBaseName - - IconName - WindowOfProjectWithEditor - Identifier - perspective.project - IsVertical - - Layout - - - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - 1C37FABC05509CD000000102 - 1C37FABC05539CD112110102 - E2644B35053B69B200211256 - 1C37FABC04509CD000100104 - 1CC0EA4004350EF90044410B - 1CC0EA4004350EF90041110B - - PBXProjectModuleGUID - 1CE0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 186 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 08FB7794FE84155DC02AAC07 - 1C37FBAC04509CD000000102 - 1C37FABC05509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {186, 615}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - - XCSharingToken - com.apple.Xcode.GFSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {203, 633}} - GroupTreeTableConfiguration - - MainColumn - 186 - - RubberWindowFrame - 0 104 1280 674 0 0 1280 778 - - Module - PBXSmartGroupTreeModule - Proportion - 203pt - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CE0B20306471E060097A5F4 - PBXProjectModuleLabel - mavlink_msg_waypoint_count.h - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CE0B20406471E060097A5F4 - PBXProjectModuleLabel - mavlink_msg_waypoint_count.h - _historyCapacity - 0 - bookmark - CED081F313E6F90000BAE9DD - history - - CED081EC13E6F90000BAE9DD - CED081ED13E6F90000BAE9DD - CED081EF13E6F90000BAE9DD - CED081F113E6F90000BAE9DD - - - SplitCount - 1 - - StatusBarVisibility - - - GeometryConfiguration - - Frame - {{0, 0}, {1072, 556}} - RubberWindowFrame - 0 104 1280 674 0 0 1280 778 - - Module - PBXNavigatorGroup - Proportion - 556pt - - - BecomeActive - - ContentConfiguration - - PBXProjectModuleGUID - 1CE0B20506471E060097A5F4 - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{0, 561}, {1072, 72}} - RubberWindowFrame - 0 104 1280 674 0 0 1280 778 - - Module - XCDetailModule - Proportion - 72pt - - - Proportion - 1072pt - - - Name - Project - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - XCModuleDock - PBXNavigatorGroup - XCDetailModule - - TableOfContents - - CED081F513E6F90000BAE9DD - 1CE0B1FE06471DED0097A5F4 - CED081F613E6F90000BAE9DD - 1CE0B20306471E060097A5F4 - 1CE0B20506471E060097A5F4 - - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarConfiguration - xcode.toolbar.config.defaultV3 - - - ControllerClassBaseName - - IconName - WindowOfProject - Identifier - perspective.morph - IsVertical - 0 - Layout - - - BecomeActive - 1 - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - 1C08E77C0454961000C914BD - 1C37FABC05509CD000000102 - 1C37FABC05539CD112110102 - E2644B35053B69B200211256 - 1C37FABC04509CD000100104 - 1CC0EA4004350EF90044410B - 1CC0EA4004350EF90041110B - - PBXProjectModuleGUID - 11E0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 186 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 29B97314FDCFA39411CA2CEA - 1C37FABC05509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {186, 337}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - 1 - XCSharingToken - com.apple.Xcode.GFSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {203, 355}} - GroupTreeTableConfiguration - - MainColumn - 186 - - RubberWindowFrame - 373 269 690 397 0 0 1440 878 - - Module - PBXSmartGroupTreeModule - Proportion - 100% - - - Name - Morph - PreferredWidth - 300 - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - - TableOfContents - - 11E0B1FE06471DED0097A5F4 - - ToolbarConfiguration - xcode.toolbar.config.default.shortV3 - - - PerspectivesBarVisible - - ShelfIsVisible - - SourceDescription - file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' - StatusbarIsVisible - - TimeStamp - 0.0 - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarDisplayMode - 1 - ToolbarIsVisible - - ToolbarSizeMode - 1 - Type - Perspectives - UpdateMessage - The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? - WindowJustification - 5 - WindowOrderList - - CED0820513E6F90000BAE9DD - CED0820613E6F90000BAE9DD - CED0820713E6F90000BAE9DD - 1C78EAAD065D492600B07095 - 1CD10A99069EF8BA00B06720 - CEA4FF3313E6BD8E002506EF - CED081F713E6F90000BAE9DD - /Users/user/src/mavlink10/missionlib/testing/udptest.xcodeproj - - WindowString - 0 104 1280 674 0 0 1280 778 - WindowToolsV3 - - - FirstTimeWindowDisplayed - - Identifier - windowTool.build - IsVertical - - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528F0623707200166675 - PBXProjectModuleLabel - - StatusBarVisibility - - - GeometryConfiguration - - Frame - {{0, 0}, {500, 218}} - RubberWindowFrame - 29 258 500 500 0 0 1280 778 - - Module - PBXNavigatorGroup - Proportion - 218pt - - - ContentConfiguration - - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build Results - XCBuildResultsTrigger_Collapse - 1021 - XCBuildResultsTrigger_Open - 1011 - - GeometryConfiguration - - Frame - {{0, 223}, {500, 236}} - RubberWindowFrame - 29 258 500 500 0 0 1280 778 - - Module - PBXBuildResultsModule - Proportion - 236pt - - - Proportion - 459pt - - - Name - Build Results - ServiceClasses - - PBXBuildResultsModule - - StatusbarIsVisible - - TableOfContents - - CEA4FF3313E6BD8E002506EF - CED081FD13E6F90000BAE9DD - 1CD0528F0623707200166675 - XCMainBuildResultsModuleGUID - - ToolbarConfiguration - xcode.toolbar.config.buildV3 - WindowContentMinSize - 486 300 - WindowString - 29 258 500 500 0 0 1280 778 - WindowToolGUID - CEA4FF3313E6BD8E002506EF - WindowToolIsVisible - - - - FirstTimeWindowDisplayed - - Identifier - windowTool.debugger - IsVertical - - Layout - - - Dock - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {316, 198}} - {{316, 0}, {378, 198}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {694, 198}} - {{0, 198}, {694, 183}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1C162984064C10D400B95A72 - PBXProjectModuleLabel - Debug - GLUTExamples (Underwater) - - GeometryConfiguration - - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 0}, {694, 381}} - PBXDebugSessionStackFrameViewKey - - DebugVariablesTableConfiguration - - Name - 120 - Value - 85 - Summary - 148 - - Frame - {{316, 0}, {378, 198}} - RubberWindowFrame - 196 241 694 422 0 0 1280 778 - - RubberWindowFrame - 196 241 694 422 0 0 1280 778 - - Module - PBXDebugSessionModule - Proportion - 381pt - - - Proportion - 381pt - - - Name - Debugger - ServiceClasses - - PBXDebugSessionModule - - StatusbarIsVisible - - TableOfContents - - 1CD10A99069EF8BA00B06720 - CED081FE13E6F90000BAE9DD - 1C162984064C10D400B95A72 - CED081FF13E6F90000BAE9DD - CED0820013E6F90000BAE9DD - CED0820113E6F90000BAE9DD - CED0820213E6F90000BAE9DD - CED0820313E6F90000BAE9DD - - ToolbarConfiguration - xcode.toolbar.config.debugV3 - WindowString - 196 241 694 422 0 0 1280 778 - WindowToolGUID - 1CD10A99069EF8BA00B06720 - WindowToolIsVisible - - - - Identifier - windowTool.find - Layout - - - Dock - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CDD528C0622207200134675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD0528D0623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {781, 167}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXNavigatorGroup - Proportion - 781pt - - - Proportion - 50% - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528E0623707200166675 - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{8, 0}, {773, 254}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXProjectFindModule - Proportion - 50% - - - Proportion - 428pt - - - Name - Project Find - ServiceClasses - - PBXProjectFindModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D57069F1CE1000CFCEE - 1C530D58069F1CE1000CFCEE - 1C530D59069F1CE1000CFCEE - 1CDD528C0622207200134675 - 1C530D5A069F1CE1000CFCEE - 1CE0B1FE06471DED0097A5F4 - 1CD0528E0623707200166675 - - WindowString - 62 385 781 470 0 0 1440 878 - WindowToolGUID - 1C530D57069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - MENUSEPARATOR - - - FirstTimeWindowDisplayed - - Identifier - windowTool.debuggerConsole - IsVertical - - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAAC065D492600B07095 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {650, 209}} - RubberWindowFrame - 205 385 650 250 0 0 1280 778 - - Module - PBXDebugCLIModule - Proportion - 209pt - - - Proportion - 209pt - - - Name - Debugger Console - ServiceClasses - - PBXDebugCLIModule - - StatusbarIsVisible - - TableOfContents - - 1C78EAAD065D492600B07095 - CED0820413E6F90000BAE9DD - 1C78EAAC065D492600B07095 - - ToolbarConfiguration - xcode.toolbar.config.consoleV3 - WindowString - 205 385 650 250 0 0 1280 778 - WindowToolGUID - 1C78EAAD065D492600B07095 - WindowToolIsVisible - - - - Identifier - windowTool.snapshots - Layout - - - Dock - - - Module - XCSnapshotModule - Proportion - 100% - - - Proportion - 100% - - - Name - Snapshots - ServiceClasses - - XCSnapshotModule - - StatusbarIsVisible - Yes - ToolbarConfiguration - xcode.toolbar.config.snapshots - WindowString - 315 824 300 550 0 0 1440 878 - WindowToolIsVisible - Yes - - - Identifier - windowTool.scm - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAB2065D492600B07095 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1C78EAB3065D492600B07095 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {452, 0}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 0pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD052920623707200166675 - PBXProjectModuleLabel - SCM - - GeometryConfiguration - - ConsoleFrame - {{0, 259}, {452, 0}} - Frame - {{0, 7}, {452, 259}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - TableConfiguration - - Status - 30 - FileName - 199 - Path - 197.0950012207031 - - TableFrame - {{0, 0}, {452, 250}} - - Module - PBXCVSModule - Proportion - 262pt - - - Proportion - 266pt - - - Name - SCM - ServiceClasses - - PBXCVSModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAB4065D492600B07095 - 1C78EAB5065D492600B07095 - 1C78EAB2065D492600B07095 - 1CD052920623707200166675 - - ToolbarConfiguration - xcode.toolbar.config.scm - WindowString - 743 379 452 308 0 0 1280 1002 - - - Identifier - windowTool.breakpoints - IsVertical - 0 - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CE0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - no - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 168 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 1C77FABC04509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {168, 350}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - 0 - - GeometryConfiguration - - Frame - {{0, 0}, {185, 368}} - GroupTreeTableConfiguration - - MainColumn - 168 - - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - PBXSmartGroupTreeModule - Proportion - 185pt - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA1AED706398EBD00589147 - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{190, 0}, {554, 368}} - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - XCDetailModule - Proportion - 554pt - - - Proportion - 368pt - - - MajorVersion - 3 - MinorVersion - 0 - Name - Breakpoints - ServiceClasses - - PBXSmartGroupTreeModule - XCDetailModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CDDB66807F98D9800BB5817 - 1CDDB66907F98D9800BB5817 - 1CE0B1FE06471DED0097A5F4 - 1CA1AED706398EBD00589147 - - ToolbarConfiguration - xcode.toolbar.config.breakpointsV3 - WindowString - 315 424 744 409 0 0 1440 878 - WindowToolGUID - 1CDDB66807F98D9800BB5817 - WindowToolIsVisible - 1 - - - Identifier - windowTool.debugAnimator - Layout - - - Dock - - - Module - PBXNavigatorGroup - Proportion - 100% - - - Proportion - 100% - - - Name - Debug Visualizer - ServiceClasses - - PBXNavigatorGroup - - StatusbarIsVisible - 1 - ToolbarConfiguration - xcode.toolbar.config.debugAnimatorV3 - WindowString - 100 100 700 500 0 0 1280 1002 - - - Identifier - windowTool.bookmarks - Layout - - - Dock - - - Module - PBXBookmarksModule - Proportion - 100% - - - Proportion - 100% - - - Name - Bookmarks - ServiceClasses - - PBXBookmarksModule - - StatusbarIsVisible - 0 - WindowString - 538 42 401 187 0 0 1280 1002 - - - Identifier - windowTool.projectFormatConflicts - Layout - - - Dock - - - Module - XCProjectFormatConflictsModule - Proportion - 100% - - - Proportion - 100% - - - Name - Project Format Conflicts - ServiceClasses - - XCProjectFormatConflictsModule - - StatusbarIsVisible - 0 - WindowContentMinSize - 450 300 - WindowString - 50 850 472 307 0 0 1440 877 - - - Identifier - windowTool.classBrowser - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - OptionsSetName - Hierarchy, all classes - PBXProjectModuleGUID - 1CA6456E063B45B4001379D8 - PBXProjectModuleLabel - Class Browser - NSObject - - GeometryConfiguration - - ClassesFrame - {{0, 0}, {374, 96}} - ClassesTreeTableConfiguration - - PBXClassNameColumnIdentifier - 208 - PBXClassBookColumnIdentifier - 22 - - Frame - {{0, 0}, {630, 331}} - MembersFrame - {{0, 105}, {374, 395}} - MembersTreeTableConfiguration - - PBXMemberTypeIconColumnIdentifier - 22 - PBXMemberNameColumnIdentifier - 216 - PBXMemberTypeColumnIdentifier - 97 - PBXMemberBookColumnIdentifier - 22 - - PBXModuleWindowStatusBarHidden2 - 1 - RubberWindowFrame - 385 179 630 352 0 0 1440 878 - - Module - PBXClassBrowserModule - Proportion - 332pt - - - Proportion - 332pt - - - Name - Class Browser - ServiceClasses - - PBXClassBrowserModule - - StatusbarIsVisible - 0 - TableOfContents - - 1C0AD2AF069F1E9B00FABCE6 - 1C0AD2B0069F1E9B00FABCE6 - 1CA6456E063B45B4001379D8 - - ToolbarConfiguration - xcode.toolbar.config.classbrowser - WindowString - 385 179 630 352 0 0 1440 878 - WindowToolGUID - 1C0AD2AF069F1E9B00FABCE6 - WindowToolIsVisible - 0 - - - Identifier - windowTool.refactoring - IncludeInToolsMenu - 0 - Layout - - - Dock - - - BecomeActive - 1 - GeometryConfiguration - - Frame - {0, 0}, {500, 335} - RubberWindowFrame - {0, 0}, {500, 335} - - Module - XCRefactoringModule - Proportion - 100% - - - Proportion - 100% - - - Name - Refactoring - ServiceClasses - - XCRefactoringModule - - WindowString - 200 200 500 356 0 0 1920 1200 - - - - diff --git a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.pbxuser b/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.pbxuser deleted file mode 100644 index 548d2fa89d..0000000000 --- a/libraries/GCS_MAVLink/missionlib/testing/udptest.xcodeproj/user.pbxuser +++ /dev/null @@ -1,236 +0,0 @@ -// !$*UTF8*$! -{ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - activeBuildConfigurationName = Debug; - activeExecutable = CEA4FF2913E6BD6D002506EF /* udptest */; - activeTarget = 8DD76FA90486AB0100D96B5E /* udptest */; - codeSenseManager = CEA4FF4013E6BD8E002506EF /* Code sense */; - executables = ( - CEA4FF2913E6BD6D002506EF /* udptest */, - ); - perUserDictionary = { - PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 833, - 20, - 48, - 43, - 43, - 20, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - PBXFileDataSource_Target_ColumnID, - ); - }; - PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 301, - 60, - 20, - 48, - 43, - 43, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXTargetDataSource_PrimaryAttribute, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - ); - }; - PBXPerProjectTemplateStateSaveDate = 333907732; - PBXWorkspaceStateSaveDate = 333907732; - }; - perUserProjectItems = { - CED081EC13E6F90000BAE9DD = CED081EC13E6F90000BAE9DD /* PBXTextBookmark */; - CED081ED13E6F90000BAE9DD = CED081ED13E6F90000BAE9DD /* PBXTextBookmark */; - CED081EF13E6F90000BAE9DD = CED081EF13E6F90000BAE9DD /* PBXTextBookmark */; - CED081F113E6F90000BAE9DD = CED081F113E6F90000BAE9DD /* PBXTextBookmark */; - CED081F313E6F90000BAE9DD = CED081F313E6F90000BAE9DD /* PBXTextBookmark */; - CED081F913E6F90000BAE9DD = CED081F913E6F90000BAE9DD /* PBXTextBookmark */; - CED081FB13E6F90000BAE9DD = CED081FB13E6F90000BAE9DD /* PBXTextBookmark */; - }; - sourceControlManager = CEA4FF3F13E6BD8E002506EF /* Source Control */; - userBuildSettings = { - }; - }; - 08FB7796FE84155DC02AAC07 /* main.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1797, 14781}}"; - sepNavSelRange = "{32946, 0}"; - sepNavVisRange = "{32608, 2708}"; - sepNavWindowFrame = "{{374, 47}, {906, 731}}"; - }; - }; - 8DD76FA90486AB0100D96B5E /* udptest */ = { - activeExec = 0; - executables = ( - CEA4FF2913E6BD6D002506EF /* udptest */, - ); - }; - CEA4FF2913E6BD6D002506EF /* udptest */ = { - isa = PBXExecutable; - activeArgIndices = ( - ); - argumentStrings = ( - ); - autoAttachOnCrash = 1; - breakpointsEnabled = 0; - configStateDict = { - }; - customDataFormattersEnabled = 1; - dataTipCustomDataFormattersEnabled = 1; - dataTipShowTypeColumn = 1; - dataTipSortType = 0; - debuggerPlugin = GDBDebugging; - disassemblyDisplayState = 0; - dylibVariantSuffix = ""; - enableDebugStr = 1; - environmentEntries = ( - ); - executableSystemSymbolLevel = 0; - executableUserSymbolLevel = 0; - libgmallocEnabled = 0; - name = udptest; - savedGlobals = { - }; - showTypeColumn = 0; - sourceDirectories = ( - ); - }; - CEA4FF3F13E6BD8E002506EF /* Source Control */ = { - isa = PBXSourceControlManager; - fallbackIsa = XCSourceControlManager; - isSCMEnabled = 0; - scmConfiguration = { - repositoryNamesForRoots = { - "" = ""; - }; - }; - }; - CEA4FF4013E6BD8E002506EF /* Code sense */ = { - isa = PBXCodeSenseManager; - indexTemplatePath = ""; - }; - CED081EC13E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 08FB7796FE84155DC02AAC07 /* main.c */; - name = "main.c: 678"; - rLen = 31; - rLoc = 25201; - rType = 0; - vrLen = 2936; - vrLoc = 23777; - }; - CED081ED13E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081EE13E6F90000BAE9DD /* mavlink_msg_waypoint_request.h */; - name = "mavlink_msg_waypoint_request.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 1362; - vrLoc = 0; - }; - CED081EE13E6F90000BAE9DD /* mavlink_msg_waypoint_request.h */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = mavlink_msg_waypoint_request.h; - path = /Users/user/src/mavlink10/include/common/mavlink_msg_waypoint_request.h; - sourceTree = ""; - }; - CED081EF13E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081F013E6F90000BAE9DD /* mavlink_msg_waypoint_clear_all.h */; - name = "mavlink_msg_waypoint_clear_all.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 1447; - vrLoc = 0; - }; - CED081F013E6F90000BAE9DD /* mavlink_msg_waypoint_clear_all.h */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = mavlink_msg_waypoint_clear_all.h; - path = /Users/user/src/mavlink10/include/common/mavlink_msg_waypoint_clear_all.h; - sourceTree = ""; - }; - CED081F113E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081F213E6F90000BAE9DD /* mavlink_msg_waypoint_count.h */; - rLen = 0; - rLoc = 9223372036854775808; - rType = 0; - }; - CED081F213E6F90000BAE9DD /* mavlink_msg_waypoint_count.h */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = mavlink_msg_waypoint_count.h; - path = /Users/user/src/mavlink10/include/common/mavlink_msg_waypoint_count.h; - sourceTree = ""; - }; - CED081F313E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081F413E6F90000BAE9DD /* mavlink_msg_waypoint_count.h */; - name = "mavlink_msg_waypoint_count.h: 1"; - rLen = 0; - rLoc = 0; - rType = 0; - vrLen = 1530; - vrLoc = 0; - }; - CED081F413E6F90000BAE9DD /* mavlink_msg_waypoint_count.h */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = mavlink_msg_waypoint_count.h; - path = /Users/user/src/mavlink10/include/common/mavlink_msg_waypoint_count.h; - sourceTree = ""; - }; - CED081F913E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081FA13E6F90000BAE9DD /* px_waypointplanner.cc */; - rLen = 0; - rLoc = 41642; - rType = 0; - }; - CED081FA13E6F90000BAE9DD /* px_waypointplanner.cc */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = px_waypointplanner.cc; - path = /Users/user/Documents/pixhawk/mavconn/src/planning/px_waypointplanner.cc; - sourceTree = ""; - }; - CED081FB13E6F90000BAE9DD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = CED081FC13E6F90000BAE9DD /* px_waypointplanner.cc */; - name = "px_waypointplanner.cc: 30"; - rLen = 561; - rLoc = 785; - rType = 0; - vrLen = 1834; - vrLoc = 33761; - }; - CED081FC13E6F90000BAE9DD /* px_waypointplanner.cc */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = px_waypointplanner.cc; - path = /Users/user/Documents/pixhawk/mavconn/src/planning/px_waypointplanner.cc; - sourceTree = ""; - }; -} diff --git a/libraries/GCS_MAVLink/missionlib/waypoints.c b/libraries/GCS_MAVLink/missionlib/waypoints.c deleted file mode 100644 index a7b8ee5f5c..0000000000 --- a/libraries/GCS_MAVLink/missionlib/waypoints.c +++ /dev/null @@ -1,1044 +0,0 @@ -/******************************************************************************* - - Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - ****************************************************************************/ - -#include "waypoints.h" -#include - -bool debug = true; -bool verbose = true; - -extern mavlink_system_t mavlink_system; -extern mavlink_wpm_storage wpm; - -extern void mavlink_wpm_send_message(mavlink_message_t* msg); -extern void mavlink_wpm_send_gcs_string(const char* string); -extern uint64_t mavlink_wpm_get_system_timestamp(); - - -#define MAVLINK_WPM_NO_PRINTF - -void mavlink_wpm_init(mavlink_wpm_storage* state) -{ - // Set all waypoints to zero - - // Set count to zero - state->size = 0; - state->max_size = MAVLINK_WPM_MAX_WP_COUNT; - state->current_state = MAVLINK_WPM_STATE_IDLE; - state->current_partner_sysid = 0; - state->current_partner_compid = 0; - state->timestamp_lastaction = 0; - state->timestamp_last_send_setpoint = 0; - state->timeout = MAVLINK_WPM_PROTOCOL_TIMEOUT_DEFAULT; - state->delay_setpoint = MAVLINK_WPM_SETPOINT_DELAY_DEFAULT; - state->idle = false; ///< indicates if the system is following the waypoints or is waiting - state->current_active_wp_id = -1; ///< id of current waypoint - state->yaw_reached = false; ///< boolean for yaw attitude reached - state->pos_reached = false; ///< boolean for position reached - state->timestamp_lastoutside_orbit = 0;///< timestamp when the MAV was last outside the orbit or had the wrong yaw value - state->timestamp_firstinside_orbit = 0;///< timestamp when the MAV was the first time after a waypoint change inside the orbit and had the correct yaw value - -} - -/* - * @brief Sends an waypoint ack message - */ -void mavlink_wpm_send_waypoint_ack(uint8_t sysid, uint8_t compid, uint8_t type) -{ - mavlink_message_t msg; - mavlink_waypoint_ack_t wpa; - - wpa.target_system = wpm.current_partner_sysid; - wpa.target_component = wpm.current_partner_compid; - wpa.type = type; - - mavlink_msg_waypoint_ack_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &wpa); - mavlink_wpm_send_message(&msg); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); - - if (MAVLINK_WPM_TEXT_FEEDBACK) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("Sent waypoint ACK"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Sent waypoint ack (%u) to ID %u\n", wpa.type, wpa.target_system); -#endif - mavlink_wpm_send_gcs_string("Sent waypoint ACK"); - } -} - -/* - * @brief Broadcasts the new target waypoint and directs the MAV to fly there - * - * This function broadcasts its new active waypoint sequence number and - * sends a message to the controller, advising it to fly to the coordinates - * of the waypoint with a given orientation - * - * @param seq The waypoint sequence number the MAV should fly to. - */ -void mavlink_wpm_send_waypoint_current(uint16_t seq) -{ - if(seq < wpm.size) - { - mavlink_waypoint_t *cur = &(wpm.waypoints[seq]); - - mavlink_message_t msg; - mavlink_waypoint_current_t wpc; - - wpc.seq = cur->seq; - - mavlink_msg_waypoint_current_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &wpc); - mavlink_wpm_send_message(&msg); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); - - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("Broadcasted new current waypoint\n"); //// printf("Broadcasted new current waypoint %u\n", wpc.seq); - } - else - { - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("ERROR: index out of bounds\n"); - } -} - -/* - * @brief Directs the MAV to fly to a position - * - * Sends a message to the controller, advising it to fly to the coordinates - * of the waypoint with a given orientation - * - * @param seq The waypoint sequence number the MAV should fly to. - */ -void mavlink_wpm_send_setpoint(uint16_t seq) -{ - if(seq < wpm.size) - { - mavlink_waypoint_t *cur = &(wpm.waypoints[seq]); - - mavlink_message_t msg; - mavlink_local_position_setpoint_set_t position_control_set_point; - - // Send new NED or ENU setpoint to onbaord autopilot - if (cur->frame == MAV_FRAME_LOCAL_NED || cur->frame == MAV_FRAME_LOCAL_ENU) - { - position_control_set_point.target_system = mavlink_system.sysid; - position_control_set_point.target_component = MAV_COMP_ID_IMU; - position_control_set_point.x = cur->x; - position_control_set_point.y = cur->y; - position_control_set_point.z = cur->z; - position_control_set_point.yaw = cur->param4; - - mavlink_msg_local_position_setpoint_set_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &position_control_set_point); - mavlink_wpm_send_message(&msg); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("No new setpoint set because of invalid coordinate frame of waypoint");//// if (verbose) // printf("No new set point sent to IMU because the new waypoint %u had no local coordinates\n", cur->seq); - } - - wpm.timestamp_last_send_setpoint = mavlink_wpm_get_system_timestamp(); - } - else - { - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("ERROR: Waypoint index out of bounds\n"); //// if (verbose) // printf("ERROR: index out of bounds\n"); - } -} - -void mavlink_wpm_send_waypoint_count(uint8_t sysid, uint8_t compid, uint16_t count) -{ - mavlink_message_t msg; - mavlink_waypoint_count_t wpc; - - wpc.target_system = wpm.current_partner_sysid; - wpc.target_component = wpm.current_partner_compid; - wpc.count = count; - - mavlink_msg_waypoint_count_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &wpc); - mavlink_wpm_send_message(&msg); - - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("Sent waypoint count"); //// if (verbose) // printf("Sent waypoint count (%u) to ID %u\n", wpc.count, wpc.target_system); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); -} - -void mavlink_wpm_send_waypoint(uint8_t sysid, uint8_t compid, uint16_t seq) -{ - if (seq < wpm.size) - { - mavlink_message_t msg; - mavlink_waypoint_t *wp = &(wpm.waypoints[seq]); - wp->target_system = wpm.current_partner_sysid; - wp->target_component = wpm.current_partner_compid; - mavlink_msg_waypoint_encode(mavlink_system.sysid, mavlink_system.compid, &msg, wp); - mavlink_wpm_send_message(&msg); - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("Sent waypoint"); //// if (verbose) // printf("Sent waypoint %u to ID %u\n", wp->seq, wp->target_system); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("ERROR: Waypoint index out of bounds\n"); - } -} - -void mavlink_wpm_send_waypoint_request(uint8_t sysid, uint8_t compid, uint16_t seq) -{ - if (seq < wpm.max_size) - { - mavlink_message_t msg; - mavlink_waypoint_request_t wpr; - wpr.target_system = wpm.current_partner_sysid; - wpr.target_component = wpm.current_partner_compid; - wpr.seq = seq; - mavlink_msg_waypoint_request_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &wpr); - mavlink_wpm_send_message(&msg); - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("Sent waypoint request"); //// if (verbose) // printf("Sent waypoint request %u to ID %u\n", wpr.seq, wpr.target_system); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); - } - else - { - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("ERROR: Waypoint index exceeds list capacity\n"); - } -} - -/* - * @brief emits a message that a waypoint reached - * - * This function broadcasts a message that a waypoint is reached. - * - * @param seq The waypoint sequence number the MAV has reached. - */ -void mavlink_wpm_send_waypoint_reached(uint16_t seq) -{ - mavlink_message_t msg; - mavlink_waypoint_reached_t wp_reached; - - wp_reached.seq = seq; - - mavlink_msg_waypoint_reached_encode(mavlink_system.sysid, mavlink_system.compid, &msg, &wp_reached); - mavlink_wpm_send_message(&msg); - - if (MAVLINK_WPM_TEXT_FEEDBACK) mavlink_wpm_send_gcs_string("Sent waypoint reached message"); //// if (verbose) // printf("Sent waypoint %u reached message\n", wp_reached.seq); - - // FIXME TIMING usleep(paramClient->getParamValue("PROTOCOLDELAY")); -} - -//float mavlink_wpm_distance_to_segment(uint16_t seq, float x, float y, float z) -//{ -// if (seq < wpm.size) -// { -// mavlink_waypoint_t *cur = waypoints->at(seq); -// -// const PxVector3 A(cur->x, cur->y, cur->z); -// const PxVector3 C(x, y, z); -// -// // seq not the second last waypoint -// if ((uint16_t)(seq+1) < wpm.size) -// { -// mavlink_waypoint_t *next = waypoints->at(seq+1); -// const PxVector3 B(next->x, next->y, next->z); -// const float r = (B-A).dot(C-A) / (B-A).lengthSquared(); -// if (r >= 0 && r <= 1) -// { -// const PxVector3 P(A + r*(B-A)); -// return (P-C).length(); -// } -// else if (r < 0.f) -// { -// return (C-A).length(); -// } -// else -// { -// return (C-B).length(); -// } -// } -// else -// { -// return (C-A).length(); -// } -// } -// else -// { -// // if (verbose) // printf("ERROR: index out of bounds\n"); -// } -// return -1.f; -//} - -float mavlink_wpm_distance_to_point(uint16_t seq, float x, float y, float z) -{ - // if (seq < wpm.size) - // { - // mavlink_waypoint_t *cur = waypoints->at(seq); - // - // const PxVector3 A(cur->x, cur->y, cur->z); - // const PxVector3 C(x, y, z); - // - // return (C-A).length(); - // } - // else - // { - // // if (verbose) // printf("ERROR: index out of bounds\n"); - // } - return -1.f; -} - - -void mavlink_wpm_message_handler(const mavlink_message_t* msg) -{ - // Handle param messages - //paramClient->handleMAVLinkPacket(msg); - - //check for timed-out operations - uint64_t now = mavlink_wpm_get_system_timestamp(); - if (now-wpm.timestamp_lastaction > wpm.timeout && wpm.current_state != MAVLINK_WPM_STATE_IDLE) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("Operation timeout switching -> IDLE"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Last operation (state=%u) timed out, changing state to MAVLINK_WPM_STATE_IDLE\n", wpm.current_state); -#endif - wpm.current_state = MAVLINK_WPM_STATE_IDLE; - wpm.current_count = 0; - wpm.current_partner_sysid = 0; - wpm.current_partner_compid = 0; - wpm.current_wp_id = -1; - - if(wpm.size == 0) - { - wpm.current_active_wp_id = -1; - } - } - - if(now-wpm.timestamp_last_send_setpoint > wpm.delay_setpoint && wpm.current_active_wp_id < wpm.size) - { - mavlink_wpm_send_setpoint(wpm.current_active_wp_id); - } - - switch(msg->msgid) - { - case MAVLINK_MSG_ID_ATTITUDE: - { - if(msg->sysid == mavlink_system.sysid && wpm.current_active_wp_id < wpm.size) - { - mavlink_waypoint_t *wp = &(wpm.waypoints[wpm.current_active_wp_id]); - if(wp->frame == MAV_FRAME_LOCAL_ENU || wp->frame == MAV_FRAME_LOCAL_NED) - { - mavlink_attitude_t att; - mavlink_msg_attitude_decode(msg, &att); - float yaw_tolerance = wpm.accept_range_yaw; - //compare current yaw - if (att.yaw - yaw_tolerance >= 0.0f && att.yaw + yaw_tolerance < 2.f*M_PI) - { - if (att.yaw - yaw_tolerance <= wp->param4 && att.yaw + yaw_tolerance >= wp->param4) - wpm.yaw_reached = true; - } - else if(att.yaw - yaw_tolerance < 0.0f) - { - float lowerBound = 360.0f + att.yaw - yaw_tolerance; - if (lowerBound < wp->param4 || wp->param4 < att.yaw + yaw_tolerance) - wpm.yaw_reached = true; - } - else - { - float upperBound = att.yaw + yaw_tolerance - 2.f*M_PI; - if (att.yaw - yaw_tolerance < wp->param4 || wp->param4 < upperBound) - wpm.yaw_reached = true; - } - } - } - break; - } - - case MAVLINK_MSG_ID_LOCAL_POSITION: - { - if(msg->sysid == mavlink_system.sysid && wpm.current_active_wp_id < wpm.size) - { - mavlink_waypoint_t *wp = &(wpm.waypoints[wpm.current_active_wp_id]); - - if(wp->frame == MAV_FRAME_LOCAL_ENU || MAV_FRAME_LOCAL_NED) - { - mavlink_local_position_t pos; - mavlink_msg_local_position_decode(msg, &pos); - //// if (debug) // printf("Received new position: x: %f | y: %f | z: %f\n", pos.x, pos.y, pos.z); - - wpm.pos_reached = false; - - // compare current position (given in message) with current waypoint - float orbit = wp->param1; - - float dist; - if (wp->param2 == 0) - { - // FIXME segment distance - //dist = mavlink_wpm_distance_to_segment(current_active_wp_id, pos.x, pos.y, pos.z); - } - else - { - dist = mavlink_wpm_distance_to_point(wpm.current_active_wp_id, pos.x, pos.y, pos.z); - } - - if (dist >= 0.f && dist <= orbit && wpm.yaw_reached) - { - wpm.pos_reached = true; - } - } - } - break; - } - - // case MAVLINK_MSG_ID_CMD: // special action from ground station - // { - // mavlink_cmd_t action; - // mavlink_msg_cmd_decode(msg, &action); - // if(action.target == mavlink_system.sysid) - // { - // // if (verbose) std::cerr << "Waypoint: received message with action " << action.action << std::endl; - // switch (action.action) - // { - // // case MAV_ACTION_LAUNCH: - // // // if (verbose) std::cerr << "Launch received" << std::endl; - // // current_active_wp_id = 0; - // // if (wpm.size>0) - // // { - // // setActive(waypoints[current_active_wp_id]); - // // } - // // else - // // // if (verbose) std::cerr << "No launch, waypointList empty" << std::endl; - // // break; - // - // // case MAV_ACTION_CONTINUE: - // // // if (verbose) std::c - // // err << "Continue received" << std::endl; - // // idle = false; - // // setActive(waypoints[current_active_wp_id]); - // // break; - // - // // case MAV_ACTION_HALT: - // // // if (verbose) std::cerr << "Halt received" << std::endl; - // // idle = true; - // // break; - // - // // default: - // // // if (verbose) std::cerr << "Unknown action received with id " << action.action << ", no action taken" << std::endl; - // // break; - // } - // } - // break; - // } - - case MAVLINK_MSG_ID_WAYPOINT_ACK: - { - mavlink_waypoint_ack_t wpa; - mavlink_msg_waypoint_ack_decode(msg, &wpa); - - if((msg->sysid == wpm.current_partner_sysid && msg->compid == wpm.current_partner_compid) && (wpa.target_system == mavlink_system.sysid /*&& wpa.target_component == mavlink_system.compid*/)) - { - wpm.timestamp_lastaction = now; - - if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST || wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS) - { - if (wpm.current_wp_id == wpm.size-1) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("Got last WP ACK state -> IDLE"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Received ACK after having sent last waypoint, going to state MAVLINK_WPM_STATE_IDLE\n"); -#endif - wpm.current_state = MAVLINK_WPM_STATE_IDLE; - wpm.current_wp_id = 0; - } - } - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: curr partner id mismatch"); -#else - if (MAVLINK_WPM_VERBOSE) printf("IGNORED WAYPOINT COMMAND BECAUSE TARGET SYSTEM AND COMPONENT OR COMM PARTNER ID MISMATCH\n"); -#endif - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT: - { - mavlink_waypoint_set_current_t wpc; - mavlink_msg_waypoint_set_current_decode(msg, &wpc); - - if(wpc.target_system == mavlink_system.sysid /*&& wpc.target_component == mavlink_system.compid*/) - { - wpm.timestamp_lastaction = now; - - if (wpm.current_state == MAVLINK_WPM_STATE_IDLE) - { - if (wpc.seq < wpm.size) - { - // if (verbose) // printf("Received MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT\n"); - wpm.current_active_wp_id = wpc.seq; - uint32_t i; - for(i = 0; i < wpm.size; i++) - { - if (i == wpm.current_active_wp_id) - { - wpm.waypoints[i].current = true; - } - else - { - wpm.waypoints[i].current = false; - } - } -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("NEW WP SET"); -#else - if (MAVLINK_WPM_VERBOSE) printf("New current waypoint %u\n", wpm.current_active_wp_id); -#endif - wpm.yaw_reached = false; - wpm.pos_reached = false; - mavlink_wpm_send_waypoint_current(wpm.current_active_wp_id); - mavlink_wpm_send_setpoint(wpm.current_active_wp_id); - wpm.timestamp_firstinside_orbit = 0; - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("IGN WP CURR CMD: Not in list"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT: Index out of bounds\n"); -#endif - } - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("IGN WP CURR CMD: Busy"); -#else - if (MAVLINK_WPM_VERBOSE) printf("IGNORED WAYPOINT COMMAND BECAUSE NOT IN IDLE STATE\n"); -#endif - } - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: target id mismatch"); -#else - if (MAVLINK_WPM_VERBOSE) printf("IGNORED WAYPOINT COMMAND BECAUSE TARGET SYSTEM AND COMPONENT OR COMM PARTNER ID MISMATCH\n"); -#endif - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST: - { - mavlink_waypoint_request_list_t wprl; - mavlink_msg_waypoint_request_list_decode(msg, &wprl); - if(wprl.target_system == mavlink_system.sysid /*&& wprl.target_component == mavlink_system.compid*/) - { - wpm.timestamp_lastaction = now; - - if (wpm.current_state == MAVLINK_WPM_STATE_IDLE || wpm.current_state == MAVLINK_WPM_STATE_SENDLIST) - { - if (wpm.size > 0) - { - if (verbose && wpm.current_state == MAVLINK_WPM_STATE_IDLE) // printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST from %u changing state to MAVLINK_WPM_STATE_SENDLIST\n", msg->sysid); - if (verbose && wpm.current_state == MAVLINK_WPM_STATE_SENDLIST) // printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST again from %u staying in state MAVLINK_WPM_STATE_SENDLIST\n", msg->sysid); - wpm.current_state = MAVLINK_WPM_STATE_SENDLIST; - wpm.current_wp_id = 0; - wpm.current_partner_sysid = msg->sysid; - wpm.current_partner_compid = msg->compid; - } - else - { - // if (verbose) // printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST from %u but have no waypoints, staying in \n", msg->sysid); - } - wpm.current_count = wpm.size; - mavlink_wpm_send_waypoint_count(msg->sysid,msg->compid, wpm.current_count); - } - else - { - // if (verbose) // printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST because i'm doing something else already (state=%i).\n", wpm.current_state); - } - } - else - { - // if (verbose) // printf("IGNORED WAYPOINT COMMAND BECAUSE TARGET SYSTEM AND COMPONENT MISMATCH\n"); - } - - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_REQUEST: - { - mavlink_waypoint_request_t wpr; - mavlink_msg_waypoint_request_decode(msg, &wpr); - if(msg->sysid == wpm.current_partner_sysid && msg->compid == wpm.current_partner_compid && wpr.target_system == mavlink_system.sysid /*&& wpr.target_component == mavlink_system.compid*/) - { - wpm.timestamp_lastaction = now; - - //ensure that we are in the correct state and that the first request has id 0 and the following requests have either the last id (re-send last waypoint) or last_id+1 (next waypoint) - if ((wpm.current_state == MAVLINK_WPM_STATE_SENDLIST && wpr.seq == 0) || (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS && (wpr.seq == wpm.current_wp_id || wpr.seq == wpm.current_wp_id + 1) && wpr.seq < wpm.size)) - { - if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("GOT WP REQ, state -> SEND"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u from %u changing state to MAVLINK_WPM_STATE_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); -#endif - } - if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS && wpr.seq == wpm.current_wp_id + 1) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("GOT 2nd WP REQ"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u from %u staying in state MAVLINK_WPM_STATE_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); -#endif - } - if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS && wpr.seq == wpm.current_wp_id) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("GOT 2nd WP REQ"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Got MAVLINK_MSG_ID_WAYPOINT_REQUEST of waypoint %u (again) from %u staying in state MAVLINK_WPM_STATE_SENDLIST_SENDWPS\n", wpr.seq, msg->sysid); -#endif - } - - wpm.current_state = MAVLINK_WPM_STATE_SENDLIST_SENDWPS; - wpm.current_wp_id = wpr.seq; - mavlink_wpm_send_waypoint(wpm.current_partner_sysid, wpm.current_partner_compid, wpr.seq); - } - else - { - // if (verbose) - { - if (!(wpm.current_state == MAVLINK_WPM_STATE_SENDLIST || wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS)) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Busy"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because i'm doing something else already (state=%i).\n", wpm.current_state); -#endif - break; - } - else if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST) - { - if (wpr.seq != 0) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: First id != 0"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the first requested waypoint ID (%u) was not 0.\n", wpr.seq); -#endif - } - } - else if (wpm.current_state == MAVLINK_WPM_STATE_SENDLIST_SENDWPS) - { - if (wpr.seq != wpm.current_wp_id && wpr.seq != wpm.current_wp_id + 1) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Req. WP was unexpected"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the requested waypoint ID (%u) was not the expected (%u or %u).\n", wpr.seq, wpm.current_wp_id, wpm.current_wp_id+1); -#endif - } - else if (wpr.seq >= wpm.size) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Req. WP not in list"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST because the requested waypoint ID (%u) was out of bounds.\n", wpr.seq); -#endif - } - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: ?"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST - FIXME: missed error description\n"); -#endif - } - } - } - } - else - { - //we we're target but already communicating with someone else - if((wpr.target_system == mavlink_system.sysid /*&& wpr.target_component == mavlink_system.compid*/) && !(msg->sysid == wpm.current_partner_sysid && msg->compid == wpm.current_partner_compid)) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Busy"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_REQUEST from ID %u because i'm already talking to ID %u.\n", msg->sysid, wpm.current_partner_sysid); -#endif - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: target id mismatch"); -#else - if (MAVLINK_WPM_VERBOSE) printf("IGNORED WAYPOINT COMMAND BECAUSE TARGET SYSTEM AND COMPONENT OR COMM PARTNER ID MISMATCH\n"); -#endif - } - - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_COUNT: - { - mavlink_waypoint_count_t wpc; - mavlink_msg_waypoint_count_decode(msg, &wpc); - if(wpc.target_system == mavlink_system.sysid/* && wpc.target_component == mavlink_system.compid*/) - { - wpm.timestamp_lastaction = now; - - if (wpm.current_state == MAVLINK_WPM_STATE_IDLE || (wpm.current_state == MAVLINK_WPM_STATE_GETLIST && wpm.current_wp_id == 0)) - { - if (wpc.count > 0) - { - if (wpm.current_state == MAVLINK_WPM_STATE_IDLE) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("WP CMD OK: state -> GETLIST"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Got MAVLINK_MSG_ID_WAYPOINT_COUNT (%u) from %u changing state to MAVLINK_WPM_STATE_GETLIST\n", wpc.count, msg->sysid); -#endif - } - if (wpm.current_state == MAVLINK_WPM_STATE_GETLIST) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("WP CMD OK AGAIN"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Got MAVLINK_MSG_ID_WAYPOINT_COUNT (%u) again from %u\n", wpc.count, msg->sysid); -#endif - } - - wpm.current_state = MAVLINK_WPM_STATE_GETLIST; - wpm.current_wp_id = 0; - wpm.current_partner_sysid = msg->sysid; - wpm.current_partner_compid = msg->compid; - wpm.current_count = wpc.count; - -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("CLR RCV BUF: READY"); -#else - if (MAVLINK_WPM_VERBOSE) printf("clearing receive buffer and readying for receiving waypoints\n"); -#endif - wpm.rcv_size = 0; - //while(waypoints_receive_buffer->size() > 0) - // { - // delete waypoints_receive_buffer->back(); - // waypoints_receive_buffer->pop_back(); - // } - - mavlink_wpm_send_waypoint_request(wpm.current_partner_sysid, wpm.current_partner_compid, wpm.current_wp_id); - } - else if (wpc.count == 0) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("COUNT 0"); -#else - if (MAVLINK_WPM_VERBOSE) printf("got waypoint count of 0, clearing waypoint list and staying in state MAVLINK_WPM_STATE_IDLE\n"); -#endif - wpm.rcv_size = 0; - //while(waypoints_receive_buffer->size() > 0) - // { - // delete waypoints->back(); - // waypoints->pop_back(); - // } - wpm.current_active_wp_id = -1; - wpm.yaw_reached = false; - wpm.pos_reached = false; - break; - - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("IGN WP CMD"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignoring MAVLINK_MSG_ID_WAYPOINT_COUNT from %u with count of %u\n", msg->sysid, wpc.count); -#endif - } - } - else - { - if (!(wpm.current_state == MAVLINK_WPM_STATE_IDLE || wpm.current_state == MAVLINK_WPM_STATE_GETLIST)) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Busy"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT because i'm doing something else already (state=%i).\n", wpm.current_state); -#endif - } - else if (wpm.current_state == MAVLINK_WPM_STATE_GETLIST && wpm.current_wp_id != 0) - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: Busy"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT because i'm already receiving waypoint %u.\n", wpm.current_wp_id); -#endif - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: ?"); -#else - if (MAVLINK_WPM_VERBOSE) printf("Ignored MAVLINK_MSG_ID_WAYPOINT_COUNT - FIXME: missed error description\n"); -#endif - } - } - } - else - { -#ifdef MAVLINK_WPM_NO_PRINTF - mavlink_wpm_send_gcs_string("REJ. WP CMD: target id mismatch"); -#else - if (MAVLINK_WPM_VERBOSE) printf("IGNORED WAYPOINT COMMAND BECAUSE TARGET SYSTEM AND COMPONENT OR COMM PARTNER ID MISMATCH\n"); -#endif - } - - } - break; - - case MAVLINK_MSG_ID_WAYPOINT: - { - mavlink_waypoint_t wp; - mavlink_msg_waypoint_decode(msg, &wp); - - // if (verbose) // printf("GOT WAYPOINT!"); - - if((msg->sysid == wpm.current_partner_sysid && msg->compid == wpm.current_partner_compid) && (wp.target_system == mavlink_system.sysid /*&& wp.target_component == mavlink_system.compid*/)) - { - wpm.timestamp_lastaction = now; - - //ensure that we are in the correct state and that the first waypoint has id 0 and the following waypoints have the correct ids - if ((wpm.current_state == MAVLINK_WPM_STATE_GETLIST && wp.seq == 0) || (wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS && wp.seq == wpm.current_wp_id && wp.seq < wpm.current_count)) - { - if (verbose && wpm.current_state == MAVLINK_WPM_STATE_GETLIST) // printf("Got MAVLINK_MSG_ID_WAYPOINT %u from %u changing state to MAVLINK_WPM_STATE_GETLIST_GETWPS\n", wp.seq, msg->sysid); - if (verbose && wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS && wp.seq == wpm.current_wp_id) // printf("Got MAVLINK_MSG_ID_WAYPOINT %u from %u\n", wp.seq, msg->sysid); - if (verbose && wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS && wp.seq-1 == wpm.current_wp_id) // printf("Got MAVLINK_MSG_ID_WAYPOINT %u (again) from %u\n", wp.seq, msg->sysid); - - wpm.current_state = MAVLINK_WPM_STATE_GETLIST_GETWPS; - mavlink_waypoint_t* newwp = &(wpm.rcv_waypoints[wp.seq]); - memcpy(newwp, &wp, sizeof(mavlink_waypoint_t)); - - wpm.current_wp_id = wp.seq + 1; - - // if (verbose) // printf ("Added new waypoint to list. X= %f\t Y= %f\t Z= %f\t Yaw= %f\n", newwp->x, newwp->y, newwp->z, newwp->param4); - - if(wpm.current_wp_id == wpm.current_count && wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS) - { - // if (verbose) // printf("Got all %u waypoints, changing state to MAVLINK_WPM_STATE_IDLE\n", wpm.current_count); - - mavlink_wpm_send_waypoint_ack(wpm.current_partner_sysid, wpm.current_partner_compid, 0); - - if (wpm.current_active_wp_id > wpm.rcv_size-1) - { - wpm.current_active_wp_id = wpm.rcv_size-1; - } - - // switch the waypoints list - // FIXME CHECK!!! - for (int i = 0; i < wpm.current_count; ++i) - { - wpm.waypoints[i] = wpm.rcv_waypoints[i]; - } - wpm.size = wpm.current_count; - - //get the new current waypoint - uint32_t i; - for(i = 0; i < wpm.size; i++) - { - if (wpm.waypoints[i].current == 1) - { - wpm.current_active_wp_id = i; - //// if (verbose) // printf("New current waypoint %u\n", current_active_wp_id); - wpm.yaw_reached = false; - wpm.pos_reached = false; - mavlink_wpm_send_waypoint_current(wpm.current_active_wp_id); - mavlink_wpm_send_setpoint(wpm.current_active_wp_id); - wpm.timestamp_firstinside_orbit = 0; - break; - } - } - - if (i == wpm.size) - { - wpm.current_active_wp_id = -1; - wpm.yaw_reached = false; - wpm.pos_reached = false; - wpm.timestamp_firstinside_orbit = 0; - } - - wpm.current_state = MAVLINK_WPM_STATE_IDLE; - } - else - { - mavlink_wpm_send_waypoint_request(wpm.current_partner_sysid, wpm.current_partner_compid, wpm.current_wp_id); - } - } - else - { - if (wpm.current_state == MAVLINK_WPM_STATE_IDLE) - { - //we're done receiving waypoints, answer with ack. - mavlink_wpm_send_waypoint_ack(wpm.current_partner_sysid, wpm.current_partner_compid, 0); - // printf("Received MAVLINK_MSG_ID_WAYPOINT while state=MAVLINK_WPM_STATE_IDLE, answered with WAYPOINT_ACK.\n"); - } - // if (verbose) - { - if (!(wpm.current_state == MAVLINK_WPM_STATE_GETLIST || wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS)) - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u because i'm doing something else already (state=%i).\n", wp.seq, wpm.current_state); - break; - } - else if (wpm.current_state == MAVLINK_WPM_STATE_GETLIST) - { - if(!(wp.seq == 0)) - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the first waypoint ID (%u) was not 0.\n", wp.seq); - } - else - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - } - else if (wpm.current_state == MAVLINK_WPM_STATE_GETLIST_GETWPS) - { - if (!(wp.seq == wpm.current_wp_id)) - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the waypoint ID (%u) was not the expected %u.\n", wp.seq, wpm.current_wp_id); - } - else if (!(wp.seq < wpm.current_count)) - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT because the waypoint ID (%u) was out of bounds.\n", wp.seq); - } - else - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - } - else - { - // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u - FIXME: missed error description\n", wp.seq); - } - } - } - } - else - { - //we we're target but already communicating with someone else - if((wp.target_system == mavlink_system.sysid /*&& wp.target_component == mavlink_system.compid*/) && !(msg->sysid == wpm.current_partner_sysid && msg->compid == wpm.current_partner_compid) && wpm.current_state != MAVLINK_WPM_STATE_IDLE) - { - // if (verbose) // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u from ID %u because i'm already talking to ID %u.\n", wp.seq, msg->sysid, wpm.current_partner_sysid); - } - else if(wp.target_system == mavlink_system.sysid /* && wp.target_component == mavlink_system.compid*/) - { - // if (verbose) // printf("Ignored MAVLINK_MSG_ID_WAYPOINT %u from ID %u because i have no idea what to do with it\n", wp.seq, msg->sysid); - } - } - break; - } - - case MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL: - { - mavlink_waypoint_clear_all_t wpca; - mavlink_msg_waypoint_clear_all_decode(msg, &wpca); - - if(wpca.target_system == mavlink_system.sysid /*&& wpca.target_component == mavlink_system.compid */ && wpm.current_state == MAVLINK_WPM_STATE_IDLE) - { - wpm.timestamp_lastaction = now; - - // if (verbose) // printf("Got MAVLINK_MSG_ID_WAYPOINT_CLEAR_LIST from %u deleting all waypoints\n", msg->sysid); - // Delete all waypoints - wpm.size = 0; - wpm.current_active_wp_id = -1; - wpm.yaw_reached = false; - wpm.pos_reached = false; - } - else if (wpca.target_system == mavlink_system.sysid /*&& wpca.target_component == mavlink_system.compid */ && wpm.current_state != MAVLINK_WPM_STATE_IDLE) - { - // if (verbose) // printf("Ignored MAVLINK_MSG_ID_WAYPOINT_CLEAR_LIST from %u because i'm doing something else already (state=%i).\n", msg->sysid, wpm.current_state); - } - break; - } - - default: - { - // if (debug) // printf("Waypoint: received message of unknown type"); - break; - } - } - - //check if the current waypoint was reached - if (wpm.pos_reached /*wpm.yaw_reached &&*/ && !wpm.idle) - { - if (wpm.current_active_wp_id < wpm.size) - { - mavlink_waypoint_t *cur_wp = &(wpm.waypoints[wpm.current_active_wp_id]); - - if (wpm.timestamp_firstinside_orbit == 0) - { - // Announce that last waypoint was reached - // if (verbose) // printf("*** Reached waypoint %u ***\n", cur_wp->seq); - mavlink_wpm_send_waypoint_reached(cur_wp->seq); - wpm.timestamp_firstinside_orbit = now; - } - - // check if the MAV was long enough inside the waypoint orbit - //if (now-timestamp_lastoutside_orbit > (cur_wp->hold_time*1000)) - if(now-wpm.timestamp_firstinside_orbit >= cur_wp->param2*1000) - { - if (cur_wp->autocontinue) - { - cur_wp->current = 0; - if (wpm.current_active_wp_id == wpm.size - 1 && wpm.size > 1) - { - //the last waypoint was reached, if auto continue is - //activated restart the waypoint list from the beginning - wpm.current_active_wp_id = 1; - } - else - { - if ((uint16_t)(wpm.current_active_wp_id + 1) < wpm.size) - wpm.current_active_wp_id++; - } - - // Fly to next waypoint - wpm.timestamp_firstinside_orbit = 0; - mavlink_wpm_send_waypoint_current(wpm.current_active_wp_id); - mavlink_wpm_send_setpoint(wpm.current_active_wp_id); - wpm.waypoints[wpm.current_active_wp_id].current = true; - wpm.pos_reached = false; - wpm.yaw_reached = false; - // if (verbose) // printf("Set new waypoint (%u)\n", wpm.current_active_wp_id); - } - } - } - } - else - { - wpm.timestamp_lastoutside_orbit = now; - } -} - diff --git a/libraries/GCS_MAVLink/missionlib/waypoints.h b/libraries/GCS_MAVLink/missionlib/waypoints.h deleted file mode 100644 index 4bc32a14a4..0000000000 --- a/libraries/GCS_MAVLink/missionlib/waypoints.h +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - - Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - ****************************************************************************/ - -/* This assumes you have the mavlink headers on your include path - or in the same folder as this source file */ -#include -#include - -// FIXME XXX - TO BE MOVED TO XML -enum MAVLINK_WPM_STATES -{ - MAVLINK_WPM_STATE_IDLE = 0, - MAVLINK_WPM_STATE_SENDLIST, - MAVLINK_WPM_STATE_SENDLIST_SENDWPS, - MAVLINK_WPM_STATE_GETLIST, - MAVLINK_WPM_STATE_GETLIST_GETWPS, - MAVLINK_WPM_STATE_GETLIST_GOTALL, - MAVLINK_WPM_STATE_ENUM_END -}; - -enum MAVLINK_WPM_CODES -{ - MAVLINK_WPM_CODE_OK = 0, - MAVLINK_WPM_CODE_ERR_WAYPOINT_ACTION_NOT_SUPPORTED, - MAVLINK_WPM_CODE_ERR_WAYPOINT_FRAME_NOT_SUPPORTED, - MAVLINK_WPM_CODE_ERR_WAYPOINT_OUT_OF_BOUNDS, - MAVLINK_WPM_CODE_ERR_WAYPOINT_MAX_NUMBER_EXCEEDED, - MAVLINK_WPM_CODE_ENUM_END -}; - - -/* WAYPOINT MANAGER - MISSION LIB */ - -#define MAVLINK_WPM_MAX_WP_COUNT 100 -#define MAVLINK_WPM_CONFIG_IN_FLIGHT_UPDATE ///< Enable double buffer and in-flight updates -#define MAVLINK_WPM_TEXT_FEEDBACK 1 ///< Report back status information as text -#define MAVLINK_WPM_SYSTEM_ID 1 -#define MAVLINK_WPM_COMPONENT_ID 1 -#define MAVLINK_WPM_PROTOCOL_TIMEOUT_DEFAULT 2000000 -#define MAVLINK_WPM_SETPOINT_DELAY_DEFAULT 1000000 -#define MAVLINK_WPM_PROTOCOL_DELAY_DEFAULT 40 - - -struct mavlink_wpm_storage { - mavlink_waypoint_t waypoints[MAVLINK_WPM_MAX_WP_COUNT]; ///< Currently active waypoints -#ifdef MAVLINK_WPM_CONFIG_IN_FLIGHT_UPDATE - mavlink_waypoint_t rcv_waypoints[MAVLINK_WPM_MAX_WP_COUNT]; ///< Receive buffer for next waypoints -#endif - uint16_t size; - uint16_t max_size; - uint16_t rcv_size; - enum MAVLINK_WPM_STATES current_state; - uint16_t current_wp_id; ///< Waypoint in current transmission - uint16_t current_active_wp_id; ///< Waypoint the system is currently heading towards - uint16_t current_count; - uint8_t current_partner_sysid; - uint8_t current_partner_compid; - uint64_t timestamp_lastaction; - uint64_t timestamp_last_send_setpoint; - uint64_t timestamp_firstinside_orbit; - uint64_t timestamp_lastoutside_orbit; - uint32_t timeout; - uint32_t delay_setpoint; - float accept_range_yaw; - float accept_range_distance; - bool yaw_reached; - bool pos_reached; - bool idle; -}; - -typedef struct mavlink_wpm_storage mavlink_wpm_storage; - -void mavlink_wpm_init(mavlink_wpm_storage* state); - -void mavlink_wpm_message_handler(const mavlink_message_t* msg); \ No newline at end of file diff --git a/libraries/GCS_MAVLink/sync b/libraries/GCS_MAVLink/sync deleted file mode 100755 index 424c243930..0000000000 --- a/libraries/GCS_MAVLink/sync +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -branch="master" -trap exit ERR -rm -rf _tmp -git clone git://github.com/pixhawk/mavlink.git -b $branch _tmp -rm -rf _tmp/.git -rsync -av _tmp/* . -rm -rf _tmp -svn add --force * diff --git a/libraries/GCS_MAVLink/update b/libraries/GCS_MAVLink/update new file mode 100755 index 0000000000..7e22a08c62 --- /dev/null +++ b/libraries/GCS_MAVLink/update @@ -0,0 +1,14 @@ +#!/bin/bash +if [[ $# != 1 ]] +then + echo "usage: $0 version" + exit +fi + +MAVLINK_VERSION=$1 +rm -rf VERSION mavlink* include lib share *.zip +wget https://github.com/downloads/mavlink/mavlink/mavlink-${MAVLINK_VERSION}.zip +unzip mavlink-${MAVLINK_VERSION}.zip +mv mavlink-${MAVLINK_VERSION}/* . +rm -rf mavlink* share lib +echo $MAVLINK_VERSION > VERSION